Document Archive Document Flow
Document archive Active/Inactive flag and physical document lifecycle — archive, checkout, return, progress, handover, correct.
Document Archive Document Flow
Document Archive separates a logical active/inactive flag from physical document state. Lifecycle actions run through DocumentLifecycleActionDialog (wizard Confirm / Cancel), not ETA-style Decline verbs.
Hub: Target Document Flow. Overview: Document Archive.
Logical & physical status
| Enum | Values |
|---|---|
DocumentArchiveStatus |
Active, Inactive |
PhysicalDocumentState |
NotTracked, Archived, CheckedOut, InProgress, HandedOver |
Physical document state — archive through handover
flowchart TB Start((New document)) --> NT[NotTracked] NT -->|Archive| Archived[Archived] Archived -->|Checkout| CheckedOut[CheckedOut] CheckedOut -->|Return| Archived Archived -->|Mark in progress| InProgress[InProgress] InProgress -->|Handover| HandedOver[HandedOver] HandedOver -->|Correct| Archived class Start egkStart class NT egkDraft class Archived egkSuccess class CheckedOut,InProgress egkActive class HandedOver egkWarn
Lifecycle dialog actions
| Action parameter | Purpose |
|---|---|
archive |
Move into archive |
checkout |
Check out physical document |
return |
Return from checkout |
progress |
Mark in progress |
handover |
Hand over |
correct |
Correction path |
Dialog buttons: Cancel (dismiss) and Confirm (apply).
#Post-action sync
After Confirm, archive grids and detail views reload so physical state and Actions reflect the new state.
#ETA official PDF archiving
Official ETA invoice PDFs (English and Arabic) for E-Invoices and E-Received Invoices are downloaded asynchronously and stored under the Document Archive storage provider using a dedicated path layout:
{TenantId}/Sales|Received/{EN|AR}/{yyyy}/{MM}/{dd}/{UUID}/{UUID}.pdf
Each file is registered as an ArchivedDocument (module keys EInvoices / EReceivedInvoices) with SHA-256 integrity. View and download use authorized Document Archive endpoints — never direct filesystem URLs. See architecture note Docs/architecture/22-execution-log-eta-pdf-archive.md.
#Scenarios
| Scenario | Result |
|---|---|
| Archive | PhysicalDocumentState → Archived |
| Checkout | → CheckedOut |
| Return | Back toward Archived |
| Cancel dialog | No state change |
| ETA PDF becomes available | Background job archives EN/AR PDFs locally |