Files
psp_api/src/modules/consumer/saleInvoices/fiscal/switch/nama/nama-fiscal-switch.dto.ts
T
ahasani ad470d2166 feat: add stock keeping unit management with create, update, and retrieval functionalities
- Implemented CreateStockKeepingUnitDto for creating stock keeping units.
- Added StockKeepingUnitsService for handling business logic related to stock keeping units.
- Created StockKeepingUnitsController to manage HTTP requests for stock keeping units.
- Developed UpdateStockKeepingUnitDto for updating existing stock keeping units.
- Introduced StockKeepingUnitsServiceFindAllResponseDto for response structure.
- Established stock keeping units module for encapsulation of related components.

feat: enhance sales invoice fiscal management with new endpoints

- Created SalesInvoicesFilterDto for filtering sales invoices.
- Implemented PosSalesInvoiceFiscalController for managing fiscal operations on sales invoices.
- Developed PosSalesInvoiceFiscalService to handle fiscal logic and interactions.
- Added methods for sending, retrying, and checking the status of fiscal invoices.
- Integrated error handling and response mapping for fiscal operations.
2026-05-01 19:43:59 +03:30

195 lines
3.3 KiB
TypeScript

import { ApiProperty } from '@nestjs/swagger'
import { Type } from 'class-transformer'
import {
IsArray,
IsEnum,
IsObject,
IsOptional,
IsString,
ValidateNested,
} from 'class-validator'
import { TaxSendStatus } from '../../dto/tax-switch.dto'
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({ required: true })
@IsString()
ins: string
@ApiProperty()
@IsString()
inp: string
@ApiProperty({ required: true })
@IsString()
inty: string
// @ApiProperty({required: true})
// @IsString()
// unique_tax_code: string
@ApiProperty({ required: true })
@IsString()
inno: string
@ApiProperty({ required: true })
@IsString()
tins: string
@ApiProperty({ required: true })
@IsString()
indatim: string
@ApiProperty({ required: true })
@IsString()
name: string
@ApiProperty({ required: true })
@IsString()
tob: string
@ApiProperty()
@IsOptional()
@IsString()
address?: string
@ApiProperty()
@IsOptional()
@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
}
export class NamaTaxSendItemResponseDto {
@ApiProperty()
@IsString()
invoice_item_id: string
@ApiProperty({ enum: TaxSendStatus })
@IsEnum(TaxSendStatus)
status: TaxSendStatus
@ApiProperty({ required: false, nullable: true })
@IsOptional()
@IsString()
tax_id?: string | null
@ApiProperty({ required: false, nullable: true, type: Object })
@IsOptional()
@IsObject()
request_payload?: unknown
@ApiProperty({ required: false, nullable: true, type: Object })
@IsOptional()
@IsObject()
response_payload?: unknown
@ApiProperty({ required: false, nullable: true })
@IsOptional()
@IsString()
error_message?: string | null
@ApiProperty({ required: false, nullable: true })
@IsOptional()
@IsString()
sent_at?: string | null
@ApiProperty({ required: false, nullable: true })
@IsOptional()
@IsString()
received_at?: string | null
}
export class NamaTaxGetResponseDto {
@ApiProperty()
@IsString()
tax_id: string
@ApiProperty({ enum: TaxSendStatus })
@IsEnum(TaxSendStatus)
status: TaxSendStatus
@ApiProperty({ required: false, nullable: true, type: Object })
@IsOptional()
@IsObject()
response_payload?: unknown
@ApiProperty({ required: false, nullable: true })
@IsOptional()
@IsString()
received_at?: string | null
}