feat: handle new registration flow

This commit is contained in:
Abdalhamid Alhamad
2025-05-19 17:00:32 +03:00
parent 35ab3df7c1
commit 49326e983f
13 changed files with 140 additions and 132 deletions

View File

@ -89,13 +89,13 @@ export class CustomerService {
}
@Transactional()
async createGuardianCustomer(userId: string, body: CreateCustomerRequestDto) {
async createGuardianCustomer(userId: string, body: Partial<CreateCustomerRequestDto>) {
this.logger.log(`Creating guardian customer for user ${userId}`);
const existingCustomer = await this.customerRepository.findOne({ id: userId });
if (existingCustomer) {
this.logger.error(`Customer ${userId} already exists`);
throw new BadRequestException('CUSTOMER.ALRADY_EXISTS');
throw new BadRequestException('CUSTOMER.ALREADY_EXISTS');
}
// await this.validateCivilIdForCustomer(userId, body.civilIdFrontId, body.civilIdBackId);