feat: implement SalesInvoiceTspSwitchService and SalesInvoiceTspService for handling TSP provider interactions
- Add SalesInvoiceTspSwitchService to manage TSP provider selection and sending invoices. - Introduce SalesInvoiceTspService for creating, sending, and retrieving sales invoices. - Implement NamaProviderSwitchAdapter for communication with the NAMA TSP provider API. - Define DTOs for request and response structures specific to the NAMA provider. - Enhance error handling and logging for TSP provider interactions.
This commit is contained in:
@@ -10,12 +10,13 @@
|
||||
*/
|
||||
|
||||
export const PaymentMethodType = {
|
||||
TERMINAL: 'TERMINAL',
|
||||
CASH: 'CASH',
|
||||
CHEQUE: 'CHEQUE',
|
||||
SET_OFF: 'SET_OFF',
|
||||
CASH: 'CASH',
|
||||
TERMINAL: 'TERMINAL',
|
||||
PAYMENT_GATEWAY: 'PAYMENT_GATEWAY',
|
||||
CARD: 'CARD',
|
||||
BANK: 'BANK',
|
||||
CHECK: 'CHECK',
|
||||
OTHER: 'OTHER'
|
||||
} as const
|
||||
|
||||
@@ -248,40 +249,40 @@ export const ConsumerType = {
|
||||
export type ConsumerType = (typeof ConsumerType)[keyof typeof ConsumerType]
|
||||
|
||||
|
||||
export const PartnerFiscalSwitchType = {
|
||||
export const TspProviderType = {
|
||||
NAMA: 'NAMA',
|
||||
SUN: 'SUN'
|
||||
} as const
|
||||
|
||||
export type PartnerFiscalSwitchType = (typeof PartnerFiscalSwitchType)[keyof typeof PartnerFiscalSwitchType]
|
||||
export type TspProviderType = (typeof TspProviderType)[keyof typeof TspProviderType]
|
||||
|
||||
|
||||
export const FiscalResponseStatus = {
|
||||
export const TspProviderResponseStatus = {
|
||||
SUCCESS: 'SUCCESS',
|
||||
FAILURE: 'FAILURE',
|
||||
NOT_SEND: 'NOT_SEND',
|
||||
QUEUED: 'QUEUED'
|
||||
} as const
|
||||
|
||||
export type FiscalResponseStatus = (typeof FiscalResponseStatus)[keyof typeof FiscalResponseStatus]
|
||||
export type TspProviderResponseStatus = (typeof TspProviderResponseStatus)[keyof typeof TspProviderResponseStatus]
|
||||
|
||||
|
||||
export const FiscalRequestType = {
|
||||
export const TspProviderRequestType = {
|
||||
MAIN: 'MAIN',
|
||||
UPDATE: 'UPDATE',
|
||||
REVOKE: 'REVOKE',
|
||||
REMOVE: 'REMOVE'
|
||||
} as const
|
||||
|
||||
export type FiscalRequestType = (typeof FiscalRequestType)[keyof typeof FiscalRequestType]
|
||||
export type TspProviderRequestType = (typeof TspProviderRequestType)[keyof typeof TspProviderRequestType]
|
||||
|
||||
|
||||
export const FiscalInvoiceCustomerType = {
|
||||
export const TspProviderCustomerType = {
|
||||
Unknown: 'Unknown',
|
||||
Known: 'Known'
|
||||
} as const
|
||||
|
||||
export type FiscalInvoiceCustomerType = (typeof FiscalInvoiceCustomerType)[keyof typeof FiscalInvoiceCustomerType]
|
||||
export type TspProviderCustomerType = (typeof TspProviderCustomerType)[keyof typeof TspProviderCustomerType]
|
||||
|
||||
|
||||
export const SKUGuildType = {
|
||||
@@ -289,3 +290,20 @@ export const SKUGuildType = {
|
||||
} as const
|
||||
|
||||
export type SKUGuildType = (typeof SKUGuildType)[keyof typeof SKUGuildType]
|
||||
|
||||
|
||||
export const InvoiceTemplateType = {
|
||||
SALE: 'SALE',
|
||||
FX_SALE: 'FX_SALE',
|
||||
GOLD_JEWELRY: 'GOLD_JEWELRY',
|
||||
CONTRACT: 'CONTRACT',
|
||||
UTILITY: 'UTILITY',
|
||||
AIR_TICKET: 'AIR_TICKET',
|
||||
EXPORT: 'EXPORT',
|
||||
BILL_OF_LADING: 'BILL_OF_LADING',
|
||||
PETROCHEMICAL: 'PETROCHEMICAL',
|
||||
COMMODITY_EXCHANGE: 'COMMODITY_EXCHANGE',
|
||||
INSURANCE: 'INSURANCE'
|
||||
} as const
|
||||
|
||||
export type InvoiceTemplateType = (typeof InvoiceTemplateType)[keyof typeof InvoiceTemplateType]
|
||||
|
||||
Reference in New Issue
Block a user