Unified search algorithm across all lists; per-section record visibility (contacts, deals, activities, leads, finance, tickets, notes, projects)

This commit is contained in:
2026-10-06 15:04:46 +03:30
parent 43717392b2
commit e08f1452ef
38 changed files with 699 additions and 420 deletions
+4 -4
View File
@@ -232,12 +232,12 @@ Rules:
const periods = tehranPeriods();
const { now, dayKey } = periods;
const orgId = actor.organizationId;
const dealScope = ownerWhere(actor);
const dealScope = ownerWhere(actor, 'deals');
const activityScope = assigneeWhere(actor);
const personScope = ownerWhere(actor);
const companyScope = ownerWhere(actor);
const invoiceScope = ownerWhere(actor);
const quoteScope = ownerWhere(actor);
const invoiceScope = ownerWhere(actor, 'finance');
const quoteScope = ownerWhere(actor, 'finance');
const ticketScope = ticketAccessWhere(actor);
const createdBetween =
@@ -531,7 +531,7 @@ Rules:
this.prisma.deal.findMany({
where: {
organizationId: orgId,
...ownerWhere(actor),
...ownerWhere(actor, 'deals'),
...(personId ? { personId } : { status: 'open' }),
},
select: {