Big Circle · Government contracts · Production
Contract accounting platform
Billable hours that land on the right government contract, and migrations that stop before they corrupt.
- Role
- Backend engineer, Big Circle
- Area
- Data and concurrency
- Stack
- PostgreSQL, TypeScript, Advisory locks, Triggers, Data migrations, RBAC
The short version
A platform where teams log billable hours against government contracts. Three problems: a race between concurrent writes was stranding hours on retired charge codes, finance dashboards were silently serving stale numbers, and the data model mapping hours to contracts was split across two layers.
The problem
Teams log billable hours against government contracts. A race between two writes was stranding hours on retired charge codes, and a failing cost recompute was swallowed into an audit row, so finance dashboards showed numbers hours old with no error.
What I did
I designed a per contract Postgres advisory lock protocol with triggers on eight tables, fixed the recompute and surfaced its failures to users, and unified the data model across 238 files and 14 migrations gated by preflight checks.
What it protects now
Hours land on the right contract, finance sees current numbers or a visible error, and a migration stops before it touches ambiguous data.
How it is built
- A per contract Postgres advisory lock protocol that closed the check then write race
- Triggers on eight tables, so stale clients, imports and background jobs cannot bring deleted state back
- Charge code and CLIN mapping collapsed into one project code model across 238 files
- 14 coordinated migrations, each gated by preflight checks that abort rather than half migrate ambiguous data, for a net removal of about 4,800 lines
- Found why finance dashboards served stale figures: a unique constraint violation aborted a contract's whole cost recompute and was swallowed into an audit row. Fixed the uniqueness scope and surfaced recompute failures to users
- Dynamic role based access control with database defined roles, invitations and field level permissions
- A Vitest and Postgres backed integration harness with GitHub Actions quality gates and secret scanning: 141 test files, including cross contract IDOR and per permission suites
- PostgreSQL
- TypeScript
- Advisory locks
- Triggers
- Data migrations
- RBAC
- Vitest
- GitHub Actions