Clarify technical-info docs and ship pending owner/color fixes.
Document that product specs need /technical-info for labels, auto-verify admin-created business owners, and expand category color presets with Farsi aliases. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
3d3abeb65b
commit
fb04425df7
@@ -141,6 +141,13 @@ export class UsersService {
|
||||
roleId: targetRole.id,
|
||||
},
|
||||
});
|
||||
|
||||
if (dto.roleSlug === 'business_owner') {
|
||||
await tx.user.update({
|
||||
where: { id: userId },
|
||||
data: { cellVerifiedAt: user.cellVerifiedAt ?? new Date() },
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const userRoles = await this.prisma.userRole.findMany({
|
||||
@@ -466,6 +473,20 @@ export class UsersService {
|
||||
}
|
||||
}
|
||||
|
||||
const isBusinessOwner =
|
||||
Boolean(
|
||||
await this.prisma.businessUser.findFirst({
|
||||
where: { userId, isOwner: true },
|
||||
select: { id: true },
|
||||
}),
|
||||
) ||
|
||||
Boolean(
|
||||
await this.prisma.userRole.findFirst({
|
||||
where: { userId, role: { slug: 'business_owner' } },
|
||||
select: { id: true },
|
||||
}),
|
||||
);
|
||||
|
||||
const updated = await this.prisma.user.update({
|
||||
where: { id: userId },
|
||||
data: {
|
||||
@@ -477,6 +498,9 @@ export class UsersService {
|
||||
dto.lastNameEn !== undefined ? dto.lastNameEn.trim() || null : undefined,
|
||||
email: dto.email !== undefined ? dto.email.trim() || null : undefined,
|
||||
cellNumber: dto.cellNumber?.trim(),
|
||||
...(isBusinessOwner
|
||||
? { cellVerifiedAt: user.cellVerifiedAt ?? new Date() }
|
||||
: {}),
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user