feat: Slice 1 (Module 02) — Document upload & list foundation#15
Merged
Conversation
…delete Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… endpoints (AC1-AC6) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Slice 1) - Add documents and document_shares tables to DB schema - Add DOCUMENT_STORAGE_PATH config with default value - Implement document storage service (write/read/delete on local filesystem) - Implement document repository (insert, list by patient ordered desc) - Implement uploadDocument use case with MIME allowlist and 10 MiB body limit - Implement listDocuments use case - Wire POST /documents and GET /documents routes with auth+patient-role guard - Fill in ts-rest contract for documents endpoints - Update AppDeps to include DOCUMENT_STORAGE_PATH; update auth test accordingly - Add web hooks (useDocuments, useUploadDocument), DocumentList component - Add patient /patient/documents page with file upload UI - Add apps/api/storage/ to .gitignore; add DOCUMENT_STORAGE_PATH to .env.example - Auto-create storage directory on API startup All 68 tests pass, pnpm verify clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…asts, fix FormData Content-Type Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
11 tasks
|
Claude finished @mGasiorek998's task in 3m 48s —— View job Review — Slice 1 (Module 02): Document upload & listVerdict: APPROVE — would merge. The slice delivers a clean end-to-end vertical (schema → storage → use case → route → contract → UI → tests) and all acceptance criteria from #9 are functionally covered. Notes below are mostly polish; one is worth checking before the next slice. Spec compliance (vs. issue #9 acceptance criteria)
Architecture
Security
Test quality
Suggestions (non-blocking)
Fix the EC-001 boundary + body-limit issue → Fix the dead missing-file branch → Align schema with module-02 spec → Checklist
|
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9
Summary
documentsanddocument_sharestables to the Drizzle schemaDOCUMENT_STORAGE_PATHenv var (defaults toapps/api/storage/documents/) with auto-create on startupwrite/read/deletewith UUID-named files)uploadDocumentandlistDocumentsuse cases with MIME allowlist enforcementPOST /documents(10 MiB bodyLimit, 413/415/422) andGET /documentsroutes withrequireAuth+requireRole(['patient'])packages/contracts/src/documents.tswith Zod schemas for both endpoints/patient/documentsweb page with file upload and document listTest plan
pnpm verifyexits 0 (68 tests pass, typecheck and lint clean)FILE_TOO_LARGEUNSUPPORTED_MEDIA_TYPEMISSING_FILEGET /documentsreturns list ordered byuploadedAtdesc, empty array when none🤖 Generated with Claude Code