feat: update invoice processing to use last_tsp_status for status mapping
This commit is contained in:
@@ -47,13 +47,13 @@ export class SalesInvoicesService {
|
||||
])
|
||||
|
||||
const summaryItems = items.map(invoice => {
|
||||
const { tsp_attempts, type, ...rest } = invoice
|
||||
const { last_tsp_status, type, ...rest } = invoice
|
||||
return {
|
||||
...rest,
|
||||
type: translateEnumValue('TspProviderRequestType', type),
|
||||
status: translateEnumValue(
|
||||
'TspProviderResponseStatus',
|
||||
invoice.tsp_attempts?.[0]?.status || TspProviderResponseStatus.NOT_SEND,
|
||||
last_tsp_status || TspProviderResponseStatus.NOT_SEND,
|
||||
),
|
||||
}
|
||||
})
|
||||
@@ -78,13 +78,13 @@ export class SalesInvoicesService {
|
||||
})
|
||||
|
||||
if (invoice) {
|
||||
const { tsp_attempts, type, ...rest } = invoice
|
||||
const { last_tsp_status, type, ...rest } = invoice
|
||||
const mappedInvoice = {
|
||||
...rest,
|
||||
type: translateEnumValue('TspProviderRequestType', type),
|
||||
status: translateEnumValue(
|
||||
'TspProviderResponseStatus',
|
||||
invoice.tsp_attempts?.[0]?.status || TspProviderResponseStatus.NOT_SEND,
|
||||
last_tsp_status || TspProviderResponseStatus.NOT_SEND,
|
||||
),
|
||||
settlement_type: translateEnumValue(
|
||||
'InvoiceSettlementType',
|
||||
|
||||
Reference in New Issue
Block a user