mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 13:49:40 +00:00
feat: adding enhancment for zod admin portal kyc and add customer additional fields
This commit is contained in:
@ -0,0 +1,89 @@
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user