set invoke in nama
This commit is contained in:
@@ -39,6 +39,11 @@ export class SalesInvoicesController {
|
||||
return this.salesInvoicesService.send(id, posInfo)
|
||||
}
|
||||
|
||||
@Post(':id/revoke')
|
||||
revoke(@Param('id') id: string, @PosInfo() posInfo: IPosPayload) {
|
||||
return this.salesInvoicesService.revoke(id, posInfo)
|
||||
}
|
||||
|
||||
// @Post('send/bulk')
|
||||
// sendBulk(@Body() data: SendBulkSalesInvoicesDto, @PosInfo() posInfo: IPosPayload) {
|
||||
// return this.salesInvoicesService.sendBulk(data.invoice_ids, posInfo)
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
import { SaleInvoiceTspModule } from '@/modules/tspProviders/sales-invoice-tsp.module'
|
||||
import { Module } from '@nestjs/common'
|
||||
import { HttpClientUtil } from '../../../common/utils/http-client.util'
|
||||
import { SalesInvoiceTspSwitchService } from '../../tspProviders/sales-invoice-tsp-switch.service'
|
||||
import { SalesInvoiceTspService } from '../../tspProviders/sales-invoice-tsp.service'
|
||||
import { NamaProviderSwitchAdapter } from '../../tspProviders/switch/nama/nama-provider.adapter'
|
||||
import { SalesInvoicesController } from './sales-invoices.controller'
|
||||
import { SalesInvoicesService } from './sales-invoices.service'
|
||||
|
||||
@Module({
|
||||
imports: [SaleInvoiceTspModule],
|
||||
controllers: [SalesInvoicesController],
|
||||
providers: [
|
||||
SalesInvoicesService,
|
||||
HttpClientUtil,
|
||||
SalesInvoiceTspService,
|
||||
SalesInvoiceTspSwitchService,
|
||||
NamaProviderSwitchAdapter,
|
||||
],
|
||||
providers: [SalesInvoicesService],
|
||||
})
|
||||
export class PosSalesInvoicesModule {}
|
||||
|
||||
@@ -273,6 +273,14 @@ export class SalesInvoicesService {
|
||||
return ResponseMapper.single(invoice)
|
||||
}
|
||||
|
||||
async revoke(invoiceId: string, posInfo: IPosPayload) {
|
||||
await this.checkAccessToInvoice(posInfo.consumer_account_id, posInfo.pos_id)
|
||||
|
||||
const invoice = await this.salesInvoiceTaxService.revoke(posInfo.pos_id, invoiceId)
|
||||
|
||||
return ResponseMapper.single(invoice)
|
||||
}
|
||||
|
||||
async inquiry(consumer_account_id: string, pos_id: string, invoiceId: string) {
|
||||
const consumer_id = await this.checkAccessToInvoice(consumer_account_id, pos_id)
|
||||
const invoice = await this.salesInvoiceTaxService.get(invoiceId, pos_id, consumer_id)
|
||||
|
||||
Reference in New Issue
Block a user