refactor: update Dockerfile cache identifiers and clean up console logs across multiple services
This commit is contained in:
@@ -61,9 +61,7 @@ export class BusinessActivitiesService {
|
||||
consumer_id,
|
||||
this.defaultSelect,
|
||||
)
|
||||
return ResponseMapper.list(
|
||||
businessActivities.map(this.prepareBusinessActivityResponse),
|
||||
)
|
||||
return ResponseMapper.list(businessActivities)
|
||||
}
|
||||
|
||||
async findOne(consumer_id: string, id: string) {
|
||||
@@ -72,7 +70,7 @@ export class BusinessActivitiesService {
|
||||
id,
|
||||
this.defaultSelect,
|
||||
)
|
||||
return ResponseMapper.single(this.prepareBusinessActivityResponse(businessActivity))
|
||||
return ResponseMapper.single(businessActivity)
|
||||
}
|
||||
|
||||
async update(consumer_id: string, id: string, data: any) {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { QUERY_CONSTANTS } from '@/common/queryConstants'
|
||||
import { translateEnumValue } from '@/common/utils'
|
||||
import { TspProviderResponseStatus } from '@/generated/prisma/enums'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
import { Injectable } from '@nestjs/common'
|
||||
import { ResponseMapper } from 'common/response/response-mapper'
|
||||
@@ -6,6 +9,18 @@ import { ResponseMapper } from 'common/response/response-mapper'
|
||||
export class StatisticsService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
private readonly invoiceMapper = (invoice: any) => {
|
||||
const { tsp_attempts, ...rest } = invoice || {}
|
||||
|
||||
return {
|
||||
...rest,
|
||||
status: translateEnumValue(
|
||||
'TspProviderResponseStatus',
|
||||
invoice.tsp_attempts?.[0]?.status || TspProviderResponseStatus.NOT_SEND,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
async getInvoices(consumer_id: string) {
|
||||
const startOfToday = new Date()
|
||||
startOfToday.setHours(0, 0, 0, 0)
|
||||
@@ -20,10 +35,7 @@ export class StatisticsService {
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
code: true,
|
||||
total_amount: true,
|
||||
created_at: true,
|
||||
...QUERY_CONSTANTS.SALE_INVOICE.summarySelect,
|
||||
consumer_account: {
|
||||
select: {
|
||||
role: true,
|
||||
@@ -54,6 +66,6 @@ export class StatisticsService {
|
||||
},
|
||||
},
|
||||
})
|
||||
return ResponseMapper.list(invoices)
|
||||
return ResponseMapper.list(invoices.map(this.invoiceMapper))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,6 @@ export class PosService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
async getInfo(pos_id: string) {
|
||||
console.log('pos_id', pos_id)
|
||||
|
||||
const pos = await this.prisma.pos.findUniqueOrThrow({
|
||||
where: {
|
||||
id: pos_id,
|
||||
|
||||
@@ -80,8 +80,6 @@ export class NamaProviderSwitchAdapter implements IProviderSwitchAdapter {
|
||||
): Promise<TspProviderSendItemResultDto> {
|
||||
const mappedRequest = this.namaProviderUtils.mapToNamaRequestDto(payload)
|
||||
try {
|
||||
console.log(mappedRequest)
|
||||
|
||||
const response = await this.httpClient.request(
|
||||
this.buildSendUrl(),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user