diff --git a/src/business-admin/business-admin.service.ts b/src/business-admin/business-admin.service.ts index 6deb72e..a771912 100644 --- a/src/business-admin/business-admin.service.ts +++ b/src/business-admin/business-admin.service.ts @@ -492,8 +492,13 @@ export class BusinessAdminService { where: { cellNumber: dto.ownerCellNumber }, }); + // Users can own multiple businesses. If the cell number already exists, + // leave that user unchanged and only attach the new business as owner. if (existing) { - throw new ConflictException('A user with this cell number already exists'); + if (!existing.isActive) { + throw new BadRequestException('Owner user is inactive'); + } + return existing; } const passwordHash = await bcrypt.hash(dto.ownerPassword, 10);