feat: implement correction and original send functionality for Nama provider
- Added new DTOs for correction requests and responses in `nama-provider.dto.ts`. - Updated `nama-provider.adapter.ts` to include `originalSend` and `correctionSend` methods. - Enhanced `nama-provider.util.ts` with mapping functions for correction requests. - Created operational guidelines for agents in `AGENT.md`. - Updated Prisma migrations to support new invoice types and relationships. - Introduced new service and DTO for creating sales invoices in `sale-invoice-create.service.ts` and `sale-invoice-create.dto.ts`. - Added utility for handling Prisma errors in `prisma-error.util.ts`.
This commit is contained in:
@@ -383,3 +383,163 @@ export class NamaProviderRevokeResponseDto {
|
||||
@IsString()
|
||||
tsp_update_time: string
|
||||
}
|
||||
|
||||
/////////////// Correction DTOs ///////////////
|
||||
export class NamaProviderCorrectionBodyItemDto {
|
||||
@ApiProperty({ required: true, description: 'شناسه کالا / خدمت' })
|
||||
@IsString()
|
||||
sstid: string
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
description: `نرخ مالیات بر ارزش افزوده`,
|
||||
})
|
||||
@IsString()
|
||||
vra: string
|
||||
|
||||
// @ApiProperty()
|
||||
// @IsString()
|
||||
// sstt: string
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
description: 'مبلغ واحد',
|
||||
})
|
||||
@IsString()
|
||||
fee: string
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
description: 'مبلغ تخفیف',
|
||||
})
|
||||
@IsString()
|
||||
dis: string
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
description: 'واحد اندازه گیری',
|
||||
})
|
||||
@IsString()
|
||||
mu: string
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
description: 'تعداد / مقدار',
|
||||
})
|
||||
@IsString()
|
||||
am: string
|
||||
|
||||
@ApiProperty({
|
||||
description: ' اجرت ساخت (طلا)',
|
||||
})
|
||||
@IsString()
|
||||
consfee: string
|
||||
|
||||
@ApiProperty({
|
||||
description: 'حق العمل',
|
||||
})
|
||||
@IsString()
|
||||
bros: string
|
||||
|
||||
@ApiProperty({
|
||||
description: 'سود فروشنده',
|
||||
})
|
||||
@IsString()
|
||||
spro: string
|
||||
}
|
||||
|
||||
export class NamaProviderCorrectionHeaderDto {
|
||||
@ApiProperty({ required: true, description: 'موضوع صورتحساب' })
|
||||
@IsString()
|
||||
ins: string
|
||||
|
||||
@ApiProperty({ required: true, description: 'الگوی صورتحساب' })
|
||||
@IsString()
|
||||
inp: string
|
||||
|
||||
@ApiProperty({ required: true, description: 'نوع صورتحساب' })
|
||||
@IsString()
|
||||
inty: string
|
||||
|
||||
// @ApiProperty({required: true})
|
||||
// @IsString()
|
||||
// unique_tax_code: string
|
||||
|
||||
@ApiProperty({ required: true, description: 'سریال صورتحساب داخلی حافظه مالیاتی' })
|
||||
@IsString()
|
||||
inno: string
|
||||
|
||||
// @ApiProperty({ required: true })
|
||||
// @IsString()
|
||||
// tins: string
|
||||
|
||||
@ApiProperty({
|
||||
required: true,
|
||||
description: 'تاریخ و زمان صدور صورتحساب به صورت timestamp',
|
||||
})
|
||||
@IsString()
|
||||
indatim: string
|
||||
|
||||
@ApiProperty({ required: true, description: 'نام مشتری' })
|
||||
@IsString()
|
||||
name: string
|
||||
|
||||
@ApiProperty({
|
||||
required: false,
|
||||
description:
|
||||
'نوع شخصیت خریدار (در صورتیکه خریدار نوع ۲ باشه باید ۱ یا ۲ گذاشته بشه)',
|
||||
})
|
||||
@IsString()
|
||||
tob: string
|
||||
|
||||
@ApiProperty({ description: 'آدرس' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
address?: string
|
||||
|
||||
@ApiProperty({ description: 'شماره موبایل' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
mobile?: string
|
||||
|
||||
@ApiProperty({
|
||||
description: `شماره ملی / شناسه ملی / شناسه مشارکت مدنی / کد فراگیر خریدار`,
|
||||
})
|
||||
@IsString()
|
||||
bid: string
|
||||
|
||||
@ApiProperty({ required: true, description: 'روش تسویه' })
|
||||
@IsString()
|
||||
setm: string
|
||||
}
|
||||
|
||||
export class NamaProviderCorrectionRequestDto {
|
||||
@ApiProperty({ type: [NamaProviderCorrectionBodyItemDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => NamaProviderCorrectionBodyItemDto)
|
||||
body: NamaProviderCorrectionBodyItemDto[]
|
||||
|
||||
@ApiProperty({ type: [NamaProviderPaymentInfoDto] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => NamaProviderPaymentInfoDto)
|
||||
payment: NamaProviderPaymentInfoDto[]
|
||||
|
||||
@ApiProperty({ type: NamaProviderCorrectionHeaderDto })
|
||||
@ValidateNested()
|
||||
@Type(() => NamaProviderCorrectionHeaderDto)
|
||||
header: NamaProviderCorrectionHeaderDto
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
uuid: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
economic_code: string
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
fiscal_id: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user