Document Review
Full-screen document review interface for the internal team. Part of the Document Obtaining workflow — team members review documents uploaded by customers through the Portal.
Architecture
| Layer | Location |
|---|---|
| Review page | frontend/src/pages/internal/DocumentReviewDetail.tsx |
| Components | frontend/src/components/document-review/ (7 files: ReviewLayout, PdfViewer, ActionsSection, ApplicantSection, ChecklistSection, RejectionSection, StatusSection) |
| Rejection settings | frontend/src/pages/internal/RejectionReasonsSettings.tsx |
| Rejection bundle processor | backend/src/lib/jobs/processors/rejection-bundle.ts (BullMQ) |
Review Workflow
Customer uploads document via [[Portal]]
--> Fulfillment created (documentObtainingFulfillments, fileId FK into CAS)
--> Assigned to reviewer (assignedDepartmentId + reviewerId on the request batch)
--> Reviewer opens full-screen review interface
--> Approve or Reject with reasons
--> If rejected: rejections bundled (10-min window) into one consolidated email
via the rejection-bundle BullMQ processor, re-upload requested
Since the files-collection-canonical work (PR#1752), uploaded documents enter the canonical file chain (collection → member → version); document obtaining writes that chain on upload as of PR#2005, with a fulfillment-chain-reconciliation job backfilling stragglers.
Review Interface
The DocumentReviewDetail page provides:
- Full-screen document viewer (PDF, images)
- Side panel with document metadata and history
- Approve/reject action buttons
- Rejection reason selection (from admin-configured list)
- Review checklist tracking
Rejection System
| Concept | Purpose |
|---|---|
| Rejection reasons | Admin-configurable list (documentObtainingRejectionReasons table, with active toggle + sort order) |
| Rejection bundles | documentObtainingRejectionBundles — rejections within a 10-minute window are consolidated into one customer email by the rejection-bundle BullMQ processor |
| Rejection history | Track all review decisions per document |
Rejection reasons are managed at frontend/src/pages/internal/RejectionReasonsSettings.tsx, accessible from the Admin Dashboard.
Review Checklist
The documentObtainingReviewChecklistResults table tracks criteria that must be verified during review. Each document type can have different checklist items that the reviewer must confirm before approval.
Document Templates
Document templates (and their filters) are baselined from staging into local/preview/development via an atlas migration (PR#1789); mock data no longer touches them.
Related
- Document Obtaining — the broader document collection workflow
- Files — underlying file storage
- Portal — where customers upload documents
- Users — reviewer assignment
- Departments — department-based review assignment
- Documents — document entity definitions
- Notifications — rejection notifications to customers
- Admin Dashboard — rejection reason configuration