update switch providers and nama provider. fix original send

This commit is contained in:
2026-05-27 21:55:02 +03:30
parent 4836ee4d01
commit 816c5ebb50
31 changed files with 1381 additions and 1287 deletions
+129
View File
@@ -0,0 +1,129 @@
import { CustomerType, PaymentMethodType } from '@/generated/prisma/enums'
import { ApiProperty } from '@nestjs/swagger'
import { Type } from 'class-transformer'
import {
IsDateString,
IsEnum,
IsNumber,
IsObject,
IsOptional,
IsString,
Min,
ValidateNested,
} from 'class-validator'
export class CustomerUnknownInfoDto {
@ApiProperty({})
@IsString()
@IsOptional()
name: string
@ApiProperty({})
@IsString()
@IsOptional()
economic_code: string
}
export class CustomerLegalInfoDto {
@ApiProperty({ required: true })
@IsString()
name: string
@ApiProperty({ required: true })
@IsString()
economic_code: string
}
export class CustomerIndividualInfoDto {
@ApiProperty({ required: true })
@IsString()
first_name: string
@ApiProperty({ required: true })
@IsString()
last_name: string
@ApiProperty({ required: true })
@IsString()
national_id: string
@ApiProperty({ required: true })
@IsString()
mobile_number: string
}
export class CustomerInfoDto {
@ApiProperty({ required: true, enum: CustomerType })
@IsEnum(CustomerType)
type: CustomerType
@ApiProperty({})
@Type(() => CustomerLegalInfoDto)
@ValidateNested({ each: true })
legal_info?: CustomerLegalInfoDto
@ApiProperty({})
@Type(() => CustomerIndividualInfoDto)
@ValidateNested({ each: true })
individual_info?: CustomerIndividualInfoDto
@ApiProperty({})
@Type(() => CustomerUnknownInfoDto)
@ValidateNested({ each: true })
unknown_info?: CustomerUnknownInfoDto
}
export class TerminalInfoDto {
@ApiProperty({ required: false })
@IsOptional()
@IsString()
tracking_code?: string
@ApiProperty({ required: false })
@IsOptional()
@IsString()
card_number?: string
}
export class PaymentInfoDto {
@ApiProperty({ required: true, enum: PaymentMethodType })
@IsEnum(PaymentMethodType)
payment_method: PaymentMethodType
@ApiProperty({ required: true })
@IsNumber({ allowInfinity: false, allowNaN: false })
@Min(0)
amount: number
@ApiProperty({ required: false })
@IsOptional()
@IsDateString()
paid_at?: Date
@ApiProperty({ type: TerminalInfoDto })
@IsOptional()
@IsObject()
terminal_info: TerminalInfoDto
}
export class goldTypePayload {
@ApiProperty({ required: false })
@IsOptional()
@IsString()
karat: string
@ApiProperty({ required: false })
@IsOptional()
@IsString()
profit: string
@ApiProperty({ required: false })
@IsOptional()
@IsString()
wages: string
@ApiProperty({ required: false })
@IsOptional()
@IsString()
commission: string
}