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:
Alireza Hassani
2026-08-27 06:46:28 +03:30
co-authored by Cursor
parent 3d3abeb65b
commit fb04425df7
12 changed files with 242 additions and 55 deletions
+24
View File
@@ -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() }
: {}),
},
});