Add deal co-assignees and saved filters on people/pipeline lists.

Deals keep a primary owner plus shared assignees with matching visibility; Contacts and Pipeline can save and reuse filter presets.
This commit is contained in:
2026-09-27 14:25:32 +03:30
parent 00f8b91d78
commit c06c92b333
19 changed files with 553 additions and 20 deletions
@@ -3,7 +3,7 @@ import type { DealStatus, ImportContactsResult } from '@mento/shared';
import { Prisma } from '@prisma/client';
import { PrismaService } from '../prisma/prisma.service';
import type { Actor } from '../common/record-scope';
import { ownerWhere, resolveOwnerId } from '../common/record-scope';
import { dealAccessWhere, resolveOwnerId } from '../common/record-scope';
import { toJsonCustomFields } from '../common/custom-fields';
import { normalizePhone } from '../contacts/normalize';
import {
@@ -102,7 +102,7 @@ export class DealsExcelService {
async export(actor: Actor): Promise<Buffer> {
const rows = await this.prisma.deal.findMany({
where: { organizationId: actor.organizationId, ...ownerWhere(actor) },
where: { organizationId: actor.organizationId, ...dealAccessWhere(actor) },
include: {
person: {
select: { id: true, firstName: true, lastName: true, mobile: true },