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:
@@ -0,0 +1,124 @@
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { Type } from 'class-transformer'
|
||||
import { IsArray, IsString, ValidateNested } from 'class-validator'
|
||||
|
||||
export class NamaTaxBodyItemDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
sstid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
vra: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
sstt: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
fee: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
dis: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
mu: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
am: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
consfee: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
bros: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
spro: string
|
||||
}
|
||||
|
||||
export class NamaTaxHeaderDto {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
ins: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
inp: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
inty: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
unique_tax_code: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
inno: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
tins: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
indatim: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
tob: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
address: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
mobile: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
bid: string
|
||||
}
|
||||
|
||||
export class NamaTaxRequestDto {
|
||||
@ApiProperty({ type: [NamaTaxBodyItemDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => NamaTaxBodyItemDto)
|
||||
body: NamaTaxBodyItemDto[]
|
||||
|
||||
@ApiProperty({ type: [Object] })
|
||||
@IsArray()
|
||||
payment: unknown[]
|
||||
|
||||
@ApiProperty({ type: NamaTaxHeaderDto })
|
||||
@ValidateNested()
|
||||
@Type(() => NamaTaxHeaderDto)
|
||||
header: NamaTaxHeaderDto
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
uuid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
economic_code: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
fiscal_id: string
|
||||
}
|
||||
Reference in New Issue
Block a user