Flagship systems case study
24/7 Rota Consequence Engine
A sanitised reference implementation modelling how 24/7 rota changes affect TOIL, payments, cover, approvals and final shift visibility.
Prototype and sanitised reference implementation Systems 2026
SQL Server· FastAPI· HTMX· Jinja2· pyodbc· Workflow Modelling· Data Architecture· Read Models
Choose your depth
Evidence Hub
Jump to the proof that matters most, or open media without making the whole page a long gallery.
The project in one guided read.
Model ArchitectureLayered truth model and read-model projection.
Flow Workflow exampleSICK → Cover → TOIL/payment consequences.
Proof ValidationChecks used to prove consequences stayed consistent.
Media GalleryDiagrams and future screenshot/video slots.
Depth AppendixExtra notes without overloading the main page.
The short case
Not just a rota calendar
The visible rota was only the surface. The harder problem was preserving causality when operational changes affect multiple downstream records.
I built this project to push beyond day-to-day SQL querying into deeper system design: schema boundaries, stored procedures, workflow tables, derived effects, read models and validation logic.
The core design challenge was that a rota change is rarely just a calendar edit. A sickness record, cover assignment, reassignment or swap can affect primary shift visibility, supplemental work, TOIL movement, payment adjustments, approval state and audit history. If those consequences are inferred loosely, the final rota can look correct while the underlying truth is inconsistent.
The solution became a layered operational model. Generated rota rows stay as baseline truth. Workflow rows record what changed and why. Derived effect tables store TOIL and payment consequences. Read models project the trusted operational view used by the interface.
The strongest lesson was architectural: the system became easier to reason about once each layer owned one type of truth. Instead of one broad “change shift” concept, the model separates annual leave, sickness, cover, reassignment and swaps by their operational meaning.
Architecture
Layered truth model
The key decision was to avoid overwriting generated rota truth directly.
Configuration truth
Staff scope, profiles, shift types, rota pattern versions, pattern slots, payment rules and TOIL causality configuration.
Generated baseline truth
Pattern-generated rota rows and generated TOIL links provide the original reference state.
Workflow truth
Annual leave, sickness, cover, reassignment, swaps, approval, rejection and cancellation state.
Derived effects
Payment events, TOIL resolution, TOIL events and TOIL schedule adjustments linked back to parent workflows.
Trusted read models
Effective primary schedule, supplemental work, TOIL occurrence projection, bank balance and payment-event reporting.
Workflow example
SICK → Cover → Payment / TOIL consequences
One scenario is enough to show why the project is more than a shift viewer.
Absence changes primary truth
The original generated shift remains auditable, but the effective primary view reflects the approved absence.
Cover is supplemental
The coverer does not simply replace the absent worker’s row. Cover creates an additional work event with its own consequences.
Consequences are explicit
Payment and TOIL outcomes are stored as derived effect rows rather than guessed from the final display.
Validation
Testing the consequence chain
The project needed evidence that workflow scenarios created the expected truth-state, not just successful UI interactions.
No duplicate primary rows
Effective schedule projection must not create competing primary truth for the same staff/date.
No orphaned effects
Payment, TOIL and schedule adjustment rows should remain linked to the workflow that caused them.
Cancellation unwinds effects
Cancelled workflows should no longer influence trusted operational views.
Annual leave / sickness
Replacement workflows alter effective primary state while keeping baseline rows intact.
Cover
Cover is supplemental work and can create OOH extra payment plus TOIL transfer or banking effects.
Reassignment / swaps
Different workflow families are separated so same-looking rota actions can carry different consequences.
Daily board
Designed to show final operational coverage and surface redirected or supplemental work clearly.
Workflow launcher
Administrative workflows are routed through structured preflight, submit and decision paths.
Ledger views
TOIL and payment evidence can be exposed as reviewable operational records.
This is a personal prototype and sanitised reference implementation. It is not production payroll, HR, legal-compliance, or enterprise workforce-management software. No real staff, customer or operational data is published.
Media gallery
Evidence without loading every asset into the main scroll
Diagrams open in a modal. Later, real screenshots and walkthrough videos can use the same pattern.
Appendix
Deeper notes, available on demand
These sections preserve technical depth without forcing every reader through the entire implementation story.
Legacy diagnosis
The project began with investigation into how an older rota setup could continue displaying schedule rows while derived consequences became unreliable. That led to the core design lesson: identify which layer owns the truth before patching symptoms.
Workflow family taxonomy
Annual leave and sickness replace primary state. Cover creates supplemental work. Reassignment models one-way substitution or redirection. Same-date swaps model reciprocal movement with separate payment and TOIL treatment rules.
Primary vs supplemental truth
The system separates effective primary schedule from supplemental work so a cover assignment does not corrupt the original rota pattern or primary shift ownership.
Future direction
The reusable idea is not another generic rota calendar. The stronger direction is a consequence and reconciliation layer for complex 24/7 operations, with managed rota truth, import/reconciliation mode, or report-only audit mode.