mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
feat: onbard junior by qrcode
This commit is contained in:
@ -0,0 +1,31 @@
|
||||
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];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user