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:
2026-05-03 16:23:17 +03:30
parent ad470d2166
commit a486127ade
62 changed files with 4136 additions and 5015 deletions
+4 -6
View File
@@ -1,10 +1,6 @@
import { PasswordUtil } from '@/common/utils/password.util'
import { generateTrackingCode } from '@/common/utils/tracking-code-generator.util'
import {
ConsumerType,
GoodPricingModel,
PartnerFiscalSwitchType,
} from '@/generated/prisma/enums'
import { ConsumerType, GoodPricingModel, TspProviderType } from '@/generated/prisma/enums'
import { GoodCreateManyInput } from '@/generated/prisma/models'
import { prisma } from '../src/lib/prisma'
@@ -135,10 +131,12 @@ async function main() {
{
name: 'طلا',
code: 'Gold',
invoice_template: 'GOLD_JEWELRY',
},
{
name: 'میوه و تره‌بار',
code: 'Fruit',
invoice_template: 'SALE',
},
],
})
@@ -405,7 +403,7 @@ async function main() {
name: 'تیس',
code: 'TIS',
status: 'ACTIVE',
fiscal_switch_type: PartnerFiscalSwitchType.NAMA,
tsp_provider: TspProviderType.NAMA,
accounts: {
create: {
role: 'OWNER',