dow-prod-tracker/prisma
DJP 827ed587bb Attachments panel — files + external links per deliverable
New first-class attachments concept on the deliverable detail page,
replacing the "stash a Figma URL in the notes" workaround. Two kinds
share one row:

- FILE   — uploaded via the existing /data/uploads volume, served
           through /api/uploads/deliverables/:id/:filename. 100MB cap.
           Images render a thumbnail inline; PDFs/docs get a file icon
           + download link. Blob cleaned up on delete.
- LINK   — external URL (Figma / Drive / Dropbox / ad-hoc). Figma URLs
           detected against the file/proto/design/board path pattern
           and get an in-line iframe preview via Figma's embed host.
           Other URLs open in a new tab with an external-link icon.

Schema:
- DeliverableAttachment model + migration. Cascade-deletes with the
  parent deliverable. Optional stageDefinitionId tag scopes an asset
  to a specific stage (null = whole deliverable).
- Extended serving route's MIME allowlist: PDF, Office docs, CSV,
  text, ZIP, AI/PSD. Was tight to video/image-only before.

Plumbing:
- attachment-service with listAttachments / createLink /
  createFile / delete. Visibility-scoped (assertProjectVisible via
  deliverable.projectId).
- POST /api/deliverables/:id/attachments — content-type discriminates
  multipart (file) vs JSON (link). DELETE at the nested route.
- useAttachments / useCreateLinkAttachment / useUploadFileAttachment /
  useDeleteAttachment hooks; invalidate ["attachments", deliverableId].

UI panel renders above Pipeline Stages so assets are always in sight.
Read-only for CLIENT_VIEWER; all other roles can upload/paste/delete.
2026-04-21 15:25:48 -04:00
..
migrations Attachments panel — files + external links per deliverable 2026-04-21 15:25:48 -04:00
schema.prisma Attachments panel — files + external links per deliverable 2026-04-21 15:25:48 -04:00
seed-dow.ts Board drag-and-drop with forward/rework pipeline rules 2026-04-21 12:45:17 -04:00
seed-tracker-data.ts feat: enhance UI components and add assignment feature to deliverables 2026-03-02 13:46:55 -06:00
seed.ts Database cleanup pre rollout 2026-04-06 14:35:56 -05:00