mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 05:42:27 +00:00
90 lines
2.4 KiB
TypeScript
90 lines
2.4 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { Customer } from '~/customer/entities';
|
|
import { CustomerStatus, KycStatus } from '~/customer/enums';
|
|
import { DocumentMetaResponseDto } from '~/document/dtos/response';
|
|
|
|
export class InternalCustomerDetailsResponseDto {
|
|
@ApiProperty()
|
|
id!: string;
|
|
|
|
@ApiProperty()
|
|
customerStatus!: CustomerStatus;
|
|
|
|
@ApiProperty()
|
|
kycStatus!: KycStatus;
|
|
|
|
@ApiProperty()
|
|
rejectionReason!: string | null;
|
|
|
|
@ApiProperty()
|
|
fullName!: string;
|
|
|
|
@ApiProperty()
|
|
phoneNumber!: string;
|
|
|
|
@ApiProperty()
|
|
dateOfBirth!: Date;
|
|
|
|
@ApiProperty()
|
|
nationalId!: string;
|
|
|
|
@ApiProperty()
|
|
nationalIdExpiry!: Date;
|
|
|
|
@ApiProperty()
|
|
countryOfResidence!: string;
|
|
|
|
@ApiProperty()
|
|
sourceOfIncome!: string;
|
|
|
|
@ApiProperty()
|
|
profession!: string;
|
|
|
|
@ApiProperty()
|
|
professionType!: string;
|
|
|
|
@ApiProperty()
|
|
isPep!: boolean;
|
|
|
|
@ApiProperty()
|
|
gender!: string;
|
|
|
|
@ApiProperty()
|
|
isJunior!: boolean;
|
|
|
|
@ApiProperty()
|
|
isGuardian!: boolean;
|
|
|
|
@ApiProperty({ type: DocumentMetaResponseDto })
|
|
civilIdFront!: DocumentMetaResponseDto;
|
|
|
|
@ApiProperty({ type: DocumentMetaResponseDto })
|
|
civilIdBack!: DocumentMetaResponseDto;
|
|
|
|
@ApiPropertyOptional({ type: DocumentMetaResponseDto })
|
|
profilePicture!: DocumentMetaResponseDto | null;
|
|
|
|
constructor(customer: Customer) {
|
|
this.id = customer.id;
|
|
this.customerStatus = customer.customerStatus;
|
|
this.kycStatus = customer.kycStatus;
|
|
this.rejectionReason = customer.rejectionReason;
|
|
this.fullName = `${customer.firstName} ${customer.lastName}`;
|
|
this.phoneNumber = customer.user.fullPhoneNumber;
|
|
this.dateOfBirth = customer.dateOfBirth;
|
|
this.nationalId = customer.nationalId;
|
|
this.nationalIdExpiry = customer.nationalIdExpiry;
|
|
this.countryOfResidence = customer.countryOfResidence;
|
|
this.sourceOfIncome = customer.sourceOfIncome;
|
|
this.profession = customer.profession;
|
|
this.professionType = customer.professionType;
|
|
this.isPep = customer.isPep;
|
|
this.gender = customer.gender;
|
|
this.isJunior = customer.isJunior;
|
|
this.isGuardian = customer.isGuardian;
|
|
this.civilIdFront = new DocumentMetaResponseDto(customer.civilIdFront);
|
|
this.civilIdBack = new DocumentMetaResponseDto(customer.civilIdBack);
|
|
this.profilePicture = customer.profilePicture ? new DocumentMetaResponseDto(customer.profilePicture) : null;
|
|
}
|
|
}
|