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:
@@ -1,4 +1,6 @@
|
||||
import { ConsumerSelect } from '@/generated/prisma/models'
|
||||
import { ConsumerSelect, ConsumerWhereInput } from '@/generated/prisma/models'
|
||||
|
||||
const now = new Date()
|
||||
|
||||
export const infoSelect: ConsumerSelect = {
|
||||
legal: {
|
||||
@@ -29,3 +31,51 @@ export const infoSelect: ConsumerSelect = {
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const activeBusinessCount: ConsumerSelect = {
|
||||
_count: {
|
||||
select: {
|
||||
business_activities: {
|
||||
where: {
|
||||
license_activation: {
|
||||
OR: [
|
||||
{
|
||||
expires_at: {
|
||||
gt: now,
|
||||
},
|
||||
},
|
||||
{
|
||||
license_renews: {
|
||||
some: {
|
||||
expires_at: {
|
||||
gt: now,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export const consumerRelatedPartner = (partner_id: string): ConsumerWhereInput => ({
|
||||
OR: [
|
||||
{
|
||||
legal: {
|
||||
is: {
|
||||
partner_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
individual: {
|
||||
is: {
|
||||
partner_id,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user