01 / 03
Case study · HR & Payroll Systems · 2026
OM Incentive Payroll Platform
The calculations were simple. The process needed control.
OM Incentive Payroll Platform (OMIP) is an internal web app that replaces spreadsheet-led commission payroll with one workflow for calculation, review, release and payment confirmation. Every stage is controlled, and every important change is on record.
-
5
stages from computation to paid
-
3
roles, each seeing its own level of detail
-
758
automated tests across 61 files (at the recorded milestone)
-
Exact
decimal arithmetic for money, with no floating-point maths
01 The challenge
The arithmetic wasn’t the problem. Trusting the process was.
Incentives were calculated and managed in spreadsheets. The formulas were straightforward. What was missing was the structure around them: nothing forced a review before payment, changes were hard to trace, history lacked its calculation detail, and compensation data had few boundaries.
I set out to replace that with a system where every stage has a purpose, every important action leaves a trace, and financial information is handled the same way every time.
- 01
Calculation reliability
Formula and rounding differences hid discrepancies. Results had to be consistent and reproducible.
- 02
No enforced approval
Review was optional. A payout had to pass an approval stage before payment.
- 03
Limited accountability
It was hard to say who changed a figure or approved a bonus.
- 04
Sensitive data
Employees, reviewers and administrators each needed their own level of access.
Constraints Private internal app · 10–30 expected users · no email dependency · USD calculations with a manually locked PHP rate per payroll period · history preserved without inventing missing details.
02 The solution
One payroll run. Five controlled stages.
One principle: a payroll session moves through a defined sequence, and each stage opens only when the one before it is done. Calculation, review and payment are one controlled workflow, not three separate activities.
One button, two states
Each stage has a single button that switches between Submit and Undo. Submit moves forward and freezes the stage. Undo steps back one stage without generally erasing what was entered, so a correction doesn’t mean rebuilding a run. Paid is final.
-
Computation
The Administrator creates a session, picks the period and enters the PHP rate. The system snapshots the active roster. Revenue and commission percentages are entered with live previews.
-
Review
Computation becomes read-only. The VP reviews the figures, adds bonuses and approves. An Administrator can act as backup reviewer.
-
Release
The Administrator gets a read-only view of the whole calculation chain, recomputed and shown together.
-
Payment pending
Payment happens outside the app. The Administrator marks each employee paid; the session can’t be confirmed until every row is.
-
Paid
Once confirmed, the session is frozen for good and appears in History.
03 Key decisions
Built for accuracy, accountability and controlled access.
01
Money that adds up, every time
OM Incentive Payroll Platform shows the whole chain, not just the total: commission from revenue and percentage, converted at the rate locked to that payroll period, plus the reviewer’s additional bonus.
Show the detail
The server uses decimal arithmetic. A dedicated BigInt-based helper handles previews in the browser. Floating-point arithmetic is not used for money.
Why it matters Anyone authorised can see exactly how a final amount was reached.
02
One dataset, three levels of visibility
Completed payroll history looks different by role. Employees see their own records and totals. VPs see company-wide summaries. Administrators see the full calculation breakdown. Excel and PDF exports follow the same rules.
Show the detail
Employee record isolation is enforced on the server, not just hidden in the interface.
Why it matters Sensitive information stays within each person’s responsibility, while payroll managers keep the detail they need.
03
Every important change has a record
An audit trail records changes to user accounts, payroll sessions and payroll records: who did it, what they did, which record, when, and the before-and-after values. Password hashes are never included. Authorised staff can filter the log and open any entry.
Show the detail
A Prisma query extension captures database writes and carries the acting user through the request, so no individual route has to remember to log.
Why it matters When a question comes up later, there is a record to investigate instead of memory.
Also built
- Account management without deleting history
- Immediate access revocation
- Employee calculator
- Role-specific dashboards
- Excel and PDF exports
- In-app notifications
- Encrypted backup and tested restore
04 How I built it
Built in small steps, and checked by hand.
I built OM Incentive Payroll Platform in small increments. The business rules, the technical direction and the acceptance of every change were mine, and each change was reviewed and tested before it was merged.
My responsibilities
-
Product ownership and design
I wrote the business requirements and defined the payroll rules, formulas, roles, workflow boundaries and expected behaviour.
-
Technical direction
I set priorities, weighed trade-offs, resolved conflicting requirements and kept the decision record.
-
Review and verification
I reviewed every change, ran migrations and data scripts, read the output and tested in the browser.
-
Manual testing
I walked through each role by hand, investigated surprises and confirmed changes before merging pull requests.
The tests passed. The button didn’t exist.
In one manual walkthrough I found that Undo had been built and tested on the backend, but the interface had no button to reach it. The code passed. The experience was incomplete. From then on: automated tests verify specific behaviour; only the browser confirms the product works. A green test run never closed a task by itself. My own check was the gate.
05 Under the hood
Clear boundaries, enforceable rules, testable logic.
For engineers
OM Incentive Payroll Platform separates the interface, request validation, business logic and data access, so critical rules stay consistent and can be tested on their own.
-
Thin routes, isolated logic
Routes validate input and hand off to server-side services, so business rules stay out of framework code.
-
A state machine defined as data
Allowed transitions live in tables. Submit and Undo availability come from the same rules, so they can’t drift apart.
-
Stateless sessions, instant revocation
Signed session cookies, no server session table. Account status and permissions are rechecked on every API request, so deactivation applies on the next one.
-
Access in layers
Middleware and route checks, server-side isolation of employee data, CSRF protection on mutating requests, Zod validation and database-backed rate limiting.
- Frontend
- Next.js 15 · React 19 · TypeScript · Tailwind CSS v4 · shadcn/ui · Radix UI · Lucide React · Recharts
- Backend
- Next.js Route Handlers · Zod 4 · Pino
- Data
- PostgreSQL 17 · Prisma 7
- Auth and security
- iron-session · Argon2id · role-based permissions · CSRF protection · PostgreSQL-backed rate limiting
- Reporting
- ExcelJS · PDFKit
- Testing and tooling
- Vitest · ESLint · Prettier · pnpm · Node.js 24 · GitHub Actions CI
06 Results
Built, tested and challenged against real use.
OM Incentive Payroll Platform was built in small, independently reviewed increments, with automated tests and manual checks throughout.
- Automated tests
- 758 passed across 61 files at the recorded milestone.
- API routes
- Tested against PostgreSQL, not only mocks.
- Continuous integration
- Every pull request ran lint, type check, tests, production build and a dependency security check.
- Backup restore
- An encrypted backup was restored into a scratch database; counts matched; a deliberately corrupted backup was rejected.
- Client feedback
- Going through the app with the client added payroll period selection, safe deletion of sessions still in the first stage, and the employee calculator. It also exposed an idle-session sign-out bug, fixed with an activity-aware keep-alive.
- Cutover rehearsal
- Cleanup rehearsed locally, dry run first: intended records removed, accounts and history kept.
Measuring the impact
Time saved and errors avoided are best measured over real payroll cycles, together with the client. This page reports what was built and how it was checked.
07 Takeaway
Build the controls your process is missing.
OM Incentive Payroll Platform shows how I work: understand the business process, turn its requirements into clear system rules, design for accuracy and accountability, and check the details before calling it done.
A familiar spreadsheet operation became a structured internal app, with a controlled workflow, reliable calculations, role-specific access and records that stay useful after the day they were made.
I can build
- Internal business apps and management portals
- Commission, incentive and payout systems
- Multi-stage approval workflows
- Role-based dashboards and reporting
- Spreadsheet-to-application replacements
Have a process that needs more control?
Tell me how your business manages it today.
Keep exploring
-
Custom Website · Development
Web Developer Personal Portfolio
A portfolio built to prove its own claims: schema-checked content, two themes, original interactions, automated accessibility tests and a 99 mobile Lighthouse score on the live site.
AstroTypeScriptTailwind CSSViteMarkdownZod -
SEO & Support + WordPress Website · Non-development
Australian Cleaning Service Multi-Location Landing Pages
Rebuilt 100+ localized suburb and service landing pages on WordPress, with unique content, on-page SEO, corrected internal links and a tracked production workflow.
WordPressGoogle Sheets