feat: add DTOs and services for tax switch integration

- Created SendBulkSaleInvoicesDto for handling bulk sale invoice requests.
- Implemented TaxSwitchSendPayloadDto and related DTOs for tax switch item payloads and results.
- Developed SalesInvoiceTaxSwitchService to manage tax switch operations, including sending and retrieving tax information.
- Added SalesInvoiceTaxService for handling sales invoice tax logic, including bulk sending and persistence of results.
- Introduced NamaTaxSwitchAdapter to interact with the tax switch service, simulating external API responses.
- Created SendBulkSalesInvoicesDto for POS module to handle bulk sales invoice requests.
This commit is contained in:
2026-04-27 22:11:05 +03:30
parent dee96b6e91
commit 58a7c359d8
68 changed files with 7896 additions and 3534 deletions
@@ -1,3 +1,4 @@
import { QUERY_CONSTANTS } from '@/common/queryConstants'
import { ComplexSelect } from '@/generated/prisma/models'
import { PrismaService } from '@/prisma/prisma.service'
import { BadRequestException, Injectable } from '@nestjs/common'
@@ -53,8 +54,6 @@ export class BusinessActivityComplexesService {
data: CreateConsumerComplexDto,
) {
const complex = await this.prisma.$transaction(async tx => {
const now = new Date()
const relatedLicense = await tx.licenseAccountAllocation.findFirst({
where: {
license_activation: {
@@ -62,22 +61,7 @@ export class BusinessActivityComplexesService {
id: business_activity_id,
consumer_id,
},
OR: [
{
expires_at: {
gte: now,
},
},
{
license_renews: {
some: {
expires_at: {
gte: now,
},
},
},
},
],
...QUERY_CONSTANTS.LICENSE_ACTIVATION.activeOnDate(),
},
account_id: null,
},
@@ -1,3 +1,4 @@
import { QUERY_CONSTANTS } from '@/common/queryConstants'
import { PasswordUtil } from '@/common/utils/password.util'
import {
AccountStatus,
@@ -189,22 +190,7 @@ export class ComplexPosesService {
business_activity: {
consumer_id,
},
OR: [
{
expires_at: {
gte: now,
},
},
{
license_renews: {
some: {
expires_at: {
gte: now,
},
},
},
},
],
...QUERY_CONSTANTS.LICENSE_ACTIVATION.activeOnDate(),
},
},
select: {