Ask for organization business field at signup, including jewelry.

Store Didar-style industry on the org so registration, settings, and Ask Mento share the same catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-03 16:45:59 +03:30
co-authored by Cursor
parent ce94658fcd
commit d2f66d11fc
14 changed files with 286 additions and 8 deletions
+11 -1
View File
@@ -11,6 +11,7 @@ import {
noteAccessWhere,
ownerWhere,
} from '../common/record-scope';
import { BUSINESS_FIELD_LABELS, isBusinessField } from '@mento/shared';
import { AiService } from './ai.service';
type CatalogItem = AskMentoSourceDto;
@@ -101,7 +102,11 @@ Rules:
if (!person) throw new NotFoundException('شخص پیدا نشد');
}
const [notes, activities, deals, memories] = await Promise.all([
const [org, notes, activities, deals, memories] = await Promise.all([
this.prisma.organization.findUnique({
where: { id: actor.organizationId },
select: { name: true, businessField: true },
}),
this.prisma.note.findMany({
where: {
organizationId: actor.organizationId,
@@ -167,8 +172,13 @@ Rules:
]);
const catalog: CatalogItem[] = [];
const field =
org?.businessField && isBusinessField(org.businessField)
? BUSINESS_FIELD_LABELS[org.businessField]
: 'نامشخص';
const lines: string[] = [
`Today: ${new Date().toISOString()}`,
`Organization: ${org?.name ?? '—'} | business field: ${field}`,
personId ? `Focus personId: ${personId}` : 'Scope: current user records',
];