Refactor code structure for improved readability and maintainability

This commit is contained in:
2026-05-10 09:44:49 +03:30
parent 4e61ff618e
commit afa83895a2
28 changed files with 1663 additions and 2186 deletions
@@ -39,6 +39,11 @@ export class SalesInvoicesController {
return this.salesInvoicesService.send(id, posInfo)
}
@Post(':id/retry')
retry(@Param('id') id: string, @PosInfo() posInfo: IPosPayload) {
return this.salesInvoicesService.retry(id, posInfo)
}
@Post(':id/revoke')
revoke(@Param('id') id: string, @PosInfo() posInfo: IPosPayload) {
return this.salesInvoicesService.revoke(id, posInfo)
@@ -253,6 +253,19 @@ export class SalesInvoicesService {
}
async send(invoiceId: string, posInfo: IPosPayload) {
await this.checkAccessToInvoice(posInfo.consumer_account_id, posInfo.pos_id)
const invoice = await this.salesInvoiceTaxService.originalSend(
posInfo.pos_id,
invoiceId,
)
return ResponseMapper.single(invoice)
}
async retry(invoiceId: string, posInfo: IPosPayload) {
await this.checkAccessToInvoice(posInfo.consumer_account_id, posInfo.pos_id)
const invoice = await this.salesInvoiceTaxService.originalSend(
posInfo.pos_id,
invoiceId,