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

Conceptual visual showing rota baseline, workflow events, consequences, audit trail and trusted view.
Sanitised conceptual visual. Public screenshots and diagrams use fictional support-team data and do not expose real operational records.
Problem Rota changes create linked schedule, TOIL, payment, approval and audit consequences.
Built A SQL Server and FastAPI/HTMX prototype with workflow state, derived effects and trusted read models.
Evidence Architecture diagrams, workflow examples, validation checks and interface-ready evidence modules.
Boundary Personal prototype using fictionalised/sanitised data, not production payroll or HR software.

Choose your depth

Evidence Hub

Jump to the proof that matters most, or open media without making the whole page a long gallery.

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.

Layered operational model diagram showing configuration truth, generated baseline truth, workflow truth, derived effects and trusted read models
Layered operational model: configuration truth feeds generated baseline truth; workflows record operational changes; derived effects store TOIL and payment consequences; read models project the final operational view.

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.

Sickness cover consequence flow showing absence, cover assignment, extra payment, TOIL handling and trusted views
Example consequence chain: sickness on an OOH shift can create a coverage gap, trigger cover, create extra payment for the coverer, move or bank TOIL, and update final read models.

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.

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.

© 2026 Ardit Islami · Built with Jekyll