mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-03-10 18:41:46 +00:00
32 lines
901 B
TypeScript
32 lines
901 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { Guardian } from '~/guardian/entities/guradian.entity';
|
|
import { Junior } from '~/junior/entities';
|
|
import { GuardianRelationship } from '~/junior/enums';
|
|
|
|
export class QrCodeValidationDetailsResponse {
|
|
@ApiProperty()
|
|
fullname!: string;
|
|
|
|
@ApiProperty()
|
|
phoneNumber!: string;
|
|
|
|
@ApiProperty()
|
|
email!: string;
|
|
|
|
@ApiProperty()
|
|
relationship?: string;
|
|
|
|
@ApiProperty()
|
|
dateOfBirth!: Date;
|
|
|
|
constructor(junior: Junior, guardian?: Guardian) {
|
|
const person = guardian ? guardian : junior;
|
|
|
|
this.fullname = `${person.customer.firstName} ${person.customer.lastName}`;
|
|
this.phoneNumber = person.customer.user.phoneNumber;
|
|
this.email = person.customer.user.email;
|
|
this.dateOfBirth = person.customer.dateOfBirth;
|
|
this.relationship = guardian ? junior.relationship : GuardianRelationship[junior.relationship];
|
|
}
|
|
}
|