Component relationships
Versioned workflow and transaction boundary
A declarative state machine defines permitted transitions, roles and required evidence. Each case retains its workflow version. Material lines can split and progress independently; quantities, parent relationships and current state are checked before a transition is accepted.
Server-side handlers recheck stale concurrent actions. Business changes, audit information and pending notifications are committed together through explicit SQL transactions.
Evidence and document lifecycle
Uploaded evidence and generated reports belong to a case or line. Content-type, access and review-state checks govern storage and retrieval. Report generation records versions and the selected evidence; signed and unsigned document states remain distinguishable.
Notification reliability
A separate worker claims committed outbox work and performs delivery outside the case transaction. Immutable attachment snapshots keep the sent content tied to the recorded action. Ambiguous provider responses remain explicit rather than automatically generating duplicate mail.
Normalized analytics and cost estimates
Relational case, line and activity records feed operational views and monthly comparisons. Deleted/test cases and replaced lines are excluded from business aggregates. Counts, treatment categories and their order-volume denominators remain distinct.
Estimated costs combine configurable handling and transport parameters with recorded material quantities, packaging, material values and carrier-credit adjustments. Missing inputs produce an incomplete estimate; pending treatment and the current month remain provisional. These are estimates, not accounting valuations.
Software paradigm
ARES is a procedural Flask application around a relational model and declarative workflow definitions. Request handlers and service functions coordinate SQL transactions; workflow, document generation, reporting and outbox delivery retain separate responsibilities.