feat(docs): nested-entity 'This deal' / 'From client' split (B4 #8 phase 4)

Finishes B4 #8 by completing the UI half of the per-interest filing
model. Backend foundations (files.interest_id column, ensureEntityFolder
for 'interest', upload-zone scope radio, outcome rename hook, backfill)
shipped earlier in this audit cycle.

- listFiles validator + service: optional interestId filter
- listFilesAggregatedByEntity: routes entityType='interest' to a new
  helper that returns "THIS DEAL" + "FROM CLIENT" + symmetric-reach
  company/yacht groups
- InterestDocumentsTab: Attachments section now renders two cohorts
  via two paginated queries, with client-side de-duplication so files
  filed under this deal don't double-count under "From client"
- FileRow type exposes the optional interestId so the de-dupe filter
  doesn't need a re-fetch
This commit is contained in:
2026-05-23 01:06:45 +02:00
parent 5bd0e1ad9a
commit 70d1e7e9b2
5 changed files with 169 additions and 30 deletions

View File

@@ -32,6 +32,10 @@ export interface FileRow {
category: string | null;
createdAt: string | Date;
uploadedBy: string;
/** Optional — present when the file is scoped to a sales deal.
* Consumers like InterestDocumentsTab filter on this to split the
* "This deal" vs "From client" cohorts. */
interestId?: string | null;
}
interface FileGridProps {