mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
ZOD-333-junior-incorrect-relationship-label-displayed-as-child-instead-of-daughter-or-son-in-child-confirmation-details-after-the-scan-the-qr-code
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Gender } from '~/customer/enums';
|
||||
import { Guardian } from '~/guardian/entities/guradian.entity';
|
||||
import { Junior } from '~/junior/entities';
|
||||
import { GuardianRelationship } from '~/junior/enums';
|
||||
import { ChildRelationshipLabel, GuardianRelationship, Relationship } from '~/junior/enums';
|
||||
|
||||
export class QrCodeValidationDetailsResponse {
|
||||
@ApiProperty()
|
||||
@ -26,6 +27,17 @@ export class QrCodeValidationDetailsResponse {
|
||||
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];
|
||||
|
||||
if (guardian) {
|
||||
this.relationship = junior.relationship;
|
||||
} else {
|
||||
if (junior.relationship === Relationship.PARENT) {
|
||||
this.relationship = junior.customer.gender === Gender.MALE
|
||||
? ChildRelationshipLabel.SON
|
||||
: ChildRelationshipLabel.DAUGHTER;
|
||||
} else {
|
||||
this.relationship = GuardianRelationship[junior.relationship];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user