feat: implement tax switch functionality with Nama adapter
- Add DTOs for tax switch operations including payloads and results. - Create SalesInvoiceFiscalSwitchService to handle sending and retrieving tax data. - Implement SalesInvoiceFiscalService for managing invoice tax submissions and results persistence. - Develop NamaTaxSwitchAdapter for interfacing with the external tax service. - Introduce NamaTaxRequestDto and related classes for structured tax requests.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { translateEnumValue } from '@/common/utils'
|
||||
import { PasswordUtil } from '@/common/utils/password.util'
|
||||
import { AccountStatus, AccountType } from '@/generated/prisma/enums'
|
||||
import { PrismaService } from '@/prisma/prisma.service'
|
||||
@@ -16,6 +17,22 @@ export class AccountsService {
|
||||
id: true,
|
||||
role: true,
|
||||
created_at: true,
|
||||
pos: {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
complex: {
|
||||
select: {
|
||||
name: true,
|
||||
business_activity: {
|
||||
select: {
|
||||
name: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
account: {
|
||||
select: {
|
||||
username: true,
|
||||
@@ -24,7 +41,15 @@ export class AccountsService {
|
||||
},
|
||||
},
|
||||
})
|
||||
return ResponseMapper.list(accounts)
|
||||
|
||||
const mappedAccounts = accounts.map(account => {
|
||||
return {
|
||||
...account,
|
||||
role: translateEnumValue('ConsumerRole', account.role),
|
||||
status: translateEnumValue('AccountStatus', account.account.status),
|
||||
}
|
||||
})
|
||||
return ResponseMapper.list(mappedAccounts)
|
||||
}
|
||||
|
||||
async findOne(id: string) {
|
||||
|
||||
@@ -17,6 +17,9 @@ export class BusinessActivitiesService {
|
||||
},
|
||||
id: true,
|
||||
name: true,
|
||||
economic_code: true,
|
||||
fiscal_id: true,
|
||||
partner_token: true,
|
||||
created_at: true,
|
||||
} as BusinessActivitySelect
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PartnerStatus } from '@/generated/prisma/enums'
|
||||
import { PartnerFiscalSwitchType, PartnerStatus } from '@/generated/prisma/enums'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsNumber, IsOptional, IsString } from 'class-validator'
|
||||
|
||||
@@ -11,10 +11,14 @@ export class CreatePartnerDto {
|
||||
@ApiProperty({ required: true })
|
||||
code: string
|
||||
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
@IsEnum(PartnerFiscalSwitchType)
|
||||
@ApiProperty({ required: true })
|
||||
license_quota?: number
|
||||
fiscal_switch_type: PartnerFiscalSwitchType
|
||||
|
||||
// @IsOptional()
|
||||
// @IsNumber()
|
||||
// @ApiProperty({ required: true })
|
||||
// license_quota?: number
|
||||
|
||||
@IsString()
|
||||
@ApiProperty({ required: true })
|
||||
|
||||
@@ -27,6 +27,7 @@ export class PartnersService {
|
||||
code: true,
|
||||
status: true,
|
||||
logo_url: true,
|
||||
fiscal_switch_type: true,
|
||||
created_at: true,
|
||||
license_charge_transactions: {
|
||||
select: {
|
||||
|
||||
Reference in New Issue
Block a user