update get status of tsp provider

This commit is contained in:
2026-05-27 22:44:01 +03:30
parent 816c5ebb50
commit cd3492d625
9 changed files with 116 additions and 164 deletions
@@ -53,7 +53,7 @@ export class SalesInvoiceTspService {
},
})
const result = await trySend(this.tspSwitchService, payload)
const result = await this.tspSwitchService.send(payload)
return await onResult(this.prisma, result, attempt.id)
}
@@ -152,31 +152,7 @@ export class SalesInvoiceTspService {
business_activity.partner_token,
)
if (!result) {
throw new NotFoundException('نتیجه ارسال فاکتور یافت نشد.')
}
const updatedAttempt = await this.prisma.saleInvoiceTspAttempts.update({
where: {
id: attempt.id,
},
data: {
provider_response: JSON.parse(JSON.stringify(result)),
status: result.status,
received_at: result.received_at,
},
select: {
status: true,
invoice: true,
message: true,
},
})
return {
invoice: updatedAttempt.invoice,
status: updatedAttempt.status,
message: updatedAttempt.message,
}
return await onResult(this.prisma, result, attempt.id)
}
async correctionSend(