fix: fix issue with customer relationship in creating junior

This commit is contained in:
Abdalhameed Ahmad
2025-08-24 20:12:57 +03:00
parent 740135051d
commit 4552a7fc93

View File

@ -30,10 +30,13 @@ export class CustomerService {
return this.findCustomerById(userId); return this.findCustomerById(userId);
} }
createJuniorCustomer(guardianId: string, juniorId: string, body: CreateJuniorRequestDto) { async createJuniorCustomer(guardianId: string, juniorId: string, body: CreateJuniorRequestDto) {
this.logger.log(`Creating junior customer for user ${juniorId}`); this.logger.log(`Creating junior customer for user ${juniorId}`);
return this.customerRepository.createCustomer(juniorId, body, false); await this.customerRepository.createCustomer(juniorId, body, false);
this.logger.log(`Junior customer created for user ${juniorId} successfully`);
return this.customerRepository.findOne({ id: juniorId });
} }
async findCustomerById(id: string) { async findCustomerById(id: string) {