PR: #757: feat(intake): send document intake origin [Story-3127] by @ankitmaheshwari-com
View PR →

Files changed

6 file(s), +117 / -18 lines

Path Role + -
docs/architecture/document-intake/01-upload-and-intake.mdDocumentation+4-3
src/components/matters/import-into-matter-sheet-v2.tsxComponent+11-6
src/components/matters/use-document-upload-queue.test.tsxComponent+57-2
src/components/matters/use-document-upload-queue.tsComponent+23-3
src/components/matters/use-matter-import-v2.tsComponent+16-4
src/lib/matters/upload-queue.tsLibrary+6-0

Story-3127: Declare document intake origin

Every document imported from the matter drawer now declares the transport door that delivered its bytes. This makes downstream questions such as “has this firm ever used Drive?” depend on recorded facts instead of nullable rows.

Door-to-origin contract

Door counsel used Finalize value
Browse or drag-and-drop from the device local
Google Drive picker drive
Dropbox picker dropbox

Why origin stays separate from home

Origin records how the bytes arrived. Home records where the document belongs. A local file dropped into Strategy therefore still finalizes with intakeOrigin: "local"; its selected home does not rewrite that fact. Privileged remains non-droppable in the existing drawer.

Pipeline boundary

The existing queue remains intact. All three doors still converge on the same presign → direct S3 PUT → finalize sequence. The drawer now carries its already-known door through that sequence and adds only intakeOrigin to the existing finalize request.

Contract and automated proof

The app's vendored OpenAPI mirror and generated client types are synced from the producer contract. Queue tests exercise successful finalization from each door and assert the exact local, drive, and dropbox request values. Real endpoint persistence evidence, or any verification gap, is recorded explicitly in the pull request.