Target Document Flow
Enterprise document lifecycle, statuses, actions, and UI synchronization across EGKits applications and modules.
Target Document Flow
The Target Document Flow is the EGKits platform model for how business documents move from creation through completion: statuses, valid transitions, Actions menu rules, and what the UI refreshes after every successful or failed action.
This guide is the hub. Module guides document only behavior that is implemented today — status names, action labels, and enablement rules match the application UI and shared policy code.
- Draft / planned
- In progress / submitted
- Valid / approved / completed
- Pending window / exception
- Rejected / invalid
- Cancelled / closed
- Decision gate
#Who this is for
| Audience | What you get |
|---|---|
| Business users | Which Actions are available for each status, and what happens next |
| Administrators | Permissions, approval chains, and ETA objection windows |
| Developers | Shared policy (EtaActionPolicy), domain transition methods, and post-action sync contract |
| Customers / partners | Visual lifecycle and cross-module document chains without reading source |
#Platform principles
- Status is the primary gate — Actions are enabled or disabled from the document’s current status plus a small set of flags (ETA UUID, pending rejection/cancellation, reversal windows, fully credited/returned).
- One policy where it matters — Egyptian Tax Authority (ETA) documents share a single policy used by both API and Blazor (
EtaActionPolicy+EtaActionGate). Purchasing and finance documents enforce transitions in domain aggregates and mirror those rules in the Actions menu. - Actions stay visible when denied — ETA screens keep menu items and show a localized denial tooltip. Purchasing/AP often hide items that do not apply. Some modules use inline icon buttons instead of a MudMenu.
- Immediate UI sync after every action — grids reload, details refetch, status chips update, and the Actions menu re-evaluates against the new state.
- No invented verbs — Decline Rejection and Decline Cancellation exist only for ETA invoice reversal workflows. Other modules use Approve / Reject / Cancel (or module-specific verbs) as implemented.
#Platform architecture
Platform architecture — UI, policy, backend, persistence
flowchart TB
subgraph Apps["EGKits Blazor apps"]
direction TB
UI[Actions menu / row controls]
Gate[EtaActionGate / status helpers]
end
subgraph Shared["Shared library"]
direction TB
Policy[EtaActionPolicy]
State[EtaDocumentState]
end
subgraph Backend["Backend"]
direction TB
API[REST workflow endpoints]
Domain[Domain aggregates]
ETA[ETA / tax authority]
end
subgraph Data["Persistence"]
direction TB
DB[(Tenant database)]
end
UI --> Gate
Gate --> Policy
Policy --> State
UI -->|POST action| API
API --> Domain
Domain --> DB
API -->|submit / cancel / reject / decline| ETA
ETA -->|status sync| API
API -->|reload row / grid| UI
class UI,Gate egkActive
class Policy,State egkDraft
class API,Domain egkActive
class ETA egkWarn
class DB egkSuccess
Post-action synchronization contract
Post-action sync — invoke action through UI refresh
sequenceDiagram
autonumber
actor User
participant Menu as Actions
participant API as Backend
participant Domain as Domain
participant Grid as Grid
participant Details as Details
User->>Menu: Invoke action
Menu->>API: POST /{id}/{action}
API->>Domain: Enforce transition
Domain-->>API: New status / error
alt Success
API-->>Menu: 2xx + payload
Menu->>Grid: ReloadDataAsync
Menu->>Details: Refetch row when open
else Business rule failure
API-->>Menu: 4xx + message
Menu->>User: Snackbar / dialog
end
| Surface | On success | On failure |
|---|---|---|
| Grid | Reload | Unchanged; error snackbar |
| Details / composer | Refetch by id (ETA composers) | Unchanged |
| Status chip | New status from reloaded row | Previous status |
| Actions menu | Re-run policy / status helpers | Previous availability |
#Module document-flow guides
#Compliance & finance
| Guide | Covers |
|---|---|
| ETA Document Flow | E-Invoices, E-Receipts, E-Received Invoices |
| Purchasing Document Flow | PR → RFQ → PO → GRN → Return + Document flow timeline |
| Accounts Payable Document Flow | AP Invoice submit / approve / reject / cancel / pay |
| Sales Document Flow | Quotation, Sales Order, Delivery Note, Sales Return |
| Accounts Receivable Document Flow | AR Invoice, Credit Note, Payment |
| General Ledger Document Flow | Journal Entry post / void / reverse |
| Material Control Document Flow | Requisitions, issues, transfers, counts |
| Legal Document Flow | Matters, documents, contracts, time entry |
| Fixed Assets Document Flow | Place in service, depreciate, transfer, dispose, write-off |
#Industry & operations
| Guide | Covers |
|---|---|
| HR Document Flow | Payroll runs, payslips, leave encashment |
| POS Document Flow | Sessions and transactions (void / refund) |
| VMS Document Flow | Trips and maintenance work orders |
| CRM Document Flow | Leads and opportunities |
| Real Estate Document Flow | Leases, reservations, units |
| Services Document Flow | Subscriptions and subscription invoices |
| Hospitality Document Flow | Reservation status field |
| LMS Document Flow | Enrollment and related LMS statuses |
| HealthCare Document Flow | Appointments, encounters, orders, claims |
| HelpDesk Document Flow | Tickets + knowledge-base articles + SLA pause |
| Todos Document Flow | Task statuses |
#Collaboration, CMS, AI
| Guide | Covers |
|---|---|
| CMS Document Flow | Page publish / review / archive |
| Mail Document Flow | Contact & subscription statuses; outbox notes |
| Newsletter Document Flow | Campaigns and send queue |
| Document Archive Document Flow | Physical document lifecycle actions |
| AI Assistant Document Flow | Agent plans + conversations |
#Complete application & module inventory
Coverage lock: 43 Blazor EGKits* apps · 27 top-level Backend/Modules projects (excluding umbrella Modules.Domain / Modules.Infrastructure) · 25 module document-flow guides + this hub. Every app and module is listed below — either with a lifecycle guide or under an explicit no document lifecycle rationale. Helper-only folders under Modules.Domain are listed so nothing looks “missing.”
Document-lifecycle coverage (guide exists) — 27 apps
| # | Blazor app | Backend module / domain | Document-flow guide |
|---|---|---|---|
| 1 | EGKitsEInvoices | EInvoices | ETA |
| 2 | EGKitsEReceipts | EReceipts | ETA |
| 3 | EGKitsEReceivedInvoices | EPurInvoices (EReceivedInvoices domain) |
ETA |
| 4 | EGKitsPurchasing | Purchasing | Purchasing |
| 5 | EGKitsAccountsPayable | AccountsPayable | AP |
| 6 | EGKitsAccountsReceivable | AccountsReceivable | AR |
| 7 | EGKitsGeneralLedger | GeneralLedger | GL |
| 8 | EGKitsFixedAssets | FixedAssets | Fixed Assets |
| 9 | EGKitsSales | Sales | Sales |
| 10 | EGKitsMaterial | MaterialControl (Materials domain) |
Material Control |
| 11 | EGKitsLegal | Legal (Modules.Domain only) |
Legal |
| 12 | EGKitsHR | HR | HR |
| 13 | EGKitsPOS | POS | POS |
| 14 | EGKitsVMS | Vms | VMS |
| 15 | EGKitsCRM | CRM | CRM |
| 16 | EGKitsRealEstate | RealEstate | Real Estate |
| 17 | EGKitsServices | Services | Services |
| 18 | EGKitsHospitality | Hospitality | Hospitality |
| 19 | EGKitsLMS | LMS | LMS |
| 20 | EGKitsHealthCare | HealthCare | HealthCare |
| 21 | EGKitsHelpDesk | HelpDesk (Modules.Domain only) |
HelpDesk |
| 22 | EGKitsTodos | Todo | Todos |
| 23 | EGKitsCMS | Cms | CMS |
| 24 | EGKitsMail | UnifiedEmail (Modules.Domain only) |
|
| 25 | EGKitsNewsletter | Newsletter | Newsletter |
| 26 | EGKitsDocumentArchive | DocumentArchiving (Modules.Domain only) |
Document Archive |
| 27 | EGKitsAIAssistant | AIAssistant | AI Assistant |
No document lifecycle (explicit — 16 apps)
These apps have no business-document Actions state machine. Listed so coverage is complete — not omitted.
| # | Blazor app | Backend / notes | Rationale |
|---|---|---|---|
| 1 | EGKitsCatalog | Catalog | Master data CRUD; no document status enum |
| 2 | EGKitsTradingPartnersHub | TradingPartners | IsActive / blacklist flags; no document SM |
| 3 | EGKitsAudit | Framework audit | Read-only trails — Audit Trail |
| 4 | EGKitsChat | Chat (Modules.Domain) |
Realtime messaging — Chat |
| 5 | EGKitsNotification | Framework notifications | SignalR fan-out; read/unread only |
| 6 | EGKitsReport | Reporting | Job/execution plumbing — Reports |
| 7 | EGKitsSKitsConfigs | SKitsConfigs | Lookup / config master data |
| 8 | EGKitsIdentity | Framework identity | User/role active toggles — Identity & Access |
| 9 | EGKitsAuth | Framework auth | Sign-in / session; no business documents |
| 10 | EGKitsMultitenancy | Framework multitenancy | Multitenancy |
| 11 | EGKitsDoc | Docs (Modules.Domain) |
Placeholder; use Document Archive flow |
| 12 | EGKitsShortcuts | UI shortcuts | No domain documents |
| 13 | EGKitsAutocomplete | Shared UI | No domain documents |
| 14 | EGKitsComponents | Shared UI | No domain documents |
| 15 | EGKitsPublic | Public site / docs | Documentation host (this site) |
| 16 | EGKits | Shell / host | App shell |
App count check: 27 lifecycle + 16 no-lifecycle = 43 EGKits* projects.
Backend/Modules top-level projects (27)
Every folder under Backend/Modules except the two composition umbrellas:
| Module project | Coverage |
|---|---|
| AccountsPayable | AP Document Flow |
| AccountsReceivable | AR Document Flow |
| AIAssistant | AI Assistant Document Flow |
| Catalog | No lifecycle (master data) — EGKitsCatalog |
| Cms | CMS Document Flow |
| CRM | CRM Document Flow |
| EInvoices | ETA Document Flow |
| EPurInvoices | ETA Document Flow |
| EReceipts | ETA Document Flow |
| FixedAssets | Fixed Assets Document Flow |
| GeneralLedger | GL Document Flow |
| HealthCare | HealthCare Document Flow |
| Hospitality | Hospitality Document Flow |
| HR | HR Document Flow |
| LMS | LMS Document Flow |
| MaterialControl | Material Control Document Flow |
| Newsletter | Newsletter Document Flow |
| POS | POS Document Flow |
| Purchasing | Purchasing Document Flow |
| RealEstate | Real Estate Document Flow |
| Reporting | No lifecycle (jobs) — EGKitsReport |
| Sales | Sales Document Flow |
| Services | Services Document Flow |
| SKitsConfigs | No lifecycle — EGKitsSKitsConfigs |
| Todo | Todos Document Flow |
| TradingPartners | No lifecycle — EGKitsTradingPartnersHub |
| Vms | VMS Document Flow |
| Modules.Domain | Umbrella — see domain folders below |
| Modules.Infrastructure | Umbrella — wiring only |
Modules.Domain folders without a dedicated Blazor product app
Domain code that lives only under Modules.Domain (or is helper/stub) and is not a separate Backend/Modules/{Name} product — still accounted for:
| Domain folder | How it is covered |
|---|---|
| Legal | Legal Document Flow via EGKitsLegal |
| HelpDesk | HelpDesk Document Flow via EGKitsHelpDesk |
| DocumentArchiving | Document Archive Document Flow via EGKitsDocumentArchive |
| UnifiedEmail | Mail Document Flow via EGKitsMail |
| Chat | No lifecycle — EGKitsChat |
| Docs | No lifecycle — EGKitsDoc → prefer Document Archive guide |
| Materials | Alias of Material Control domain — Material Control |
| HotelManagement | Legacy exception stubs only; live hospitality lifecycle is Hospitality — Hospitality Document Flow |
| Payments | Shared webhook dedup helper only — payment document lifecycles live in AP / AR |
| Taxation | Tax calculation helpers for imports/lines — not a document Actions SM; ETA tax documents use ETA |
| Reporting | Shared with Reporting module — EGKitsReport (no document Actions SM) |
| Common | Shared primitives — not a product module |
| EReceivedInvoices | Domain name for EPurInvoices / EGKitsEReceivedInvoices — ETA |
Other Modules.Domain folders (AccountsPayable, Sales, POS, …) mirror the top-level module projects already listed above.
#Canonical action vocabulary
| Action | Typical meaning | Where implemented |
|---|---|---|
| Create | New draft document | All document modules |
| Edit | Change while unlocked | ETA + drafts elsewhere |
| Validate | Pre-submission check | E-Invoices, E-Receipts, Payroll runs |
| Submit | Send for approval or to ETA | Purchasing, AP, ETA, CMS review |
| Approve | Accept a submitted document | Purchasing, AP, Legal, HR payroll, CMS, AI plans, HelpDesk N/A for tickets (status change) |
| Reject | Refuse a submitted document or received ETA invoice | Purchasing, AP, E-Received Invoices, CMS, AI plans |
| Cancel | Withdraw a local or ETA document | Purchasing, AP, ETA sent invoices, VMS, AI plans, etc. |
| Decline Rejection | Issuer objects to recipient rejection (ETA) | E-Invoices only |
| Decline Cancellation | Recipient objects to issuer cancellation (ETA) | E-Received Invoices only |
| Document flow | Open procurement lineage timeline | Purchasing |
| Publish / Unpublish / Archive | CMS page lifecycle | CMS |
| Execute | Run approved AI agent plan | AI Assistant |
#Keeping diagrams synchronized
- Update the shared policy or domain transition method first.
- Update the matching guide in this series (status table + diagram + action matrix).
- Keep UI labels identical to localization keys shown in the Actions menu.
- Prefer several focused diagrams (and expandable
<details class="egk-flow-section">sections) over one oversized chart. - Diagram chrome (zoom, fullscreen, print) is provided automatically by
doc-mermaid.jsfor every Mermaid fence in Public docs — do not add per-guide toolbar markup. - When adding a new Blazor app or backend module, add a row to the inventory tables above in the same PR.