When I Work: Scalable Payroll & Technical Planning
Leading attendance and payroll architecture in React and Go, solving complex multi-timezone and overtime domain rules, and establishing proactive technical planning standards.
At a Glance
When I Work serves hundreds of thousands of shift workers and managers across multiple timezones, computing hourly attendance into accurate, compliance-grade payroll outputs.
Payroll calculation is unforgiving: an hour shift during Daylight Saving Time transition or miscalculating a blended overtime rate across multiple job roles directly affects employee wages and employer legal compliance.
Spearheaded technical development plans defining strict database access patterns, API contracts, and defensive boundary tests. Implemented robust calculation rules in Go and intuitive calculation verification interfaces in React.
Delivered zero-error payroll calculation runs, introduced React Testing Library across the team to eliminate manual regression passes, and mentored engineers through thorough architectural reviews.
Context & High-Stakes Shift Worker Payroll
When I Work is an industry-leading shift scheduling, time tracking, and workforce management platform relied upon by hundreds of thousands of hourly employees, managers, and business owners across North America. In shift-based industries—such as retail, healthcare, hospitality, and emergency services—accurate attendance tracking directly determines employee livelihoods.
During my four years at When I Work (progressing from Full Stack Developer to Senior Full Stack Developer), I led key engineering initiatives within the Attendance & Payroll product domain. Our primary mission was building and evolving the end-to-end payroll computation engine: converting raw punch clock events (clock-ins, clock-outs, unpaid meal breaks, job role switches) into legally compliant, audit-ready pay period summaries using React on the frontend and Go (Golang) and PHP on the backend.
The Core Challenge: Unforgiving Domain Complexity
Payroll software has zero tolerance for calculation bugs or ambiguous logic. A 15-minute rounding error, a miscalculated overtime threshold across a Daylight Saving Time shift, or an improperly weighted blended pay rate immediately triggers labor law compliance violations and disrupts employee paychecks.
The domain presented four distinct categories of intricate engineering challenges:
Multi-Timezone & Daylight Saving Time
Shift workers frequently clock in across regional timezones, with overnight shifts crossing the 2:00 AM Daylight Saving Time transition (gaining an hour in fall or losing an hour in spring). The engine had to guarantee invariant wall-clock duration calculation without double-paying or under-counting hours.
Blended Position Pay Rates & Overtime
In hospitality and healthcare, employees frequently work multiple positions in a single pay period (e.g., Line Cook at $18/hr and Shift Lead at $24/hr). When weekly hours exceed 40, statutory regulations require computing a weighted “blended rate” for overtime premiums rather than applying a flat multiplier.
High-Volume Time Card Aggregations
Pay period closing requires batch processing millions of individual clock records, applying dynamic shift rounding rules (e.g., 7-minute windowing, grace periods), and reconciling manual supervisor edits against immutable audit event logs.
Automated Regression Prevention
Legacy UI test suites relied on fragile Enzyme snapshot testing, which slowed down refactoring and failed to catch state desynchronizations. We needed a modern, behavior-driven testing standard across the frontend organization.
Technical Leadership: Institutionalizing Development Plans
As engineering initiatives scaled across multiple teams and microservices, the greatest bottleneck was not writing code—it was ambiguity. Unstated assumptions around edge-case behavior, database access patterns, and rollback strategies routinely led to mid-sprint blockers and post-release hotfixes.
I established and championed a proactive Development Planning Practice across our engineering group. Before any major feature or payroll calculation rule was coded, an engineer authored a living development plan that served as the technical blueprint and alignment bridge between product requirements and system architecture.
Anatomy of a Production Development Plan
Engineering StandardEstablishes the business motivation while setting hard boundaries to prevent scope creep before work starts.
Defines exact JSON payloads, REST endpoints, database query patterns, and indexing strategies to prevent N+1 queries.
Explicitly documents multi-timezone behavior, midnight crossovers, partial hour rounding, and error states.
Plans for failure in advance: feature flag toggle mechanisms, data migration rollbacks, and zero-downtime deployment paths.
Collaborative walkthrough with developers, QA, UX, and product managers to surface blind spots and foster shared ownership.
Key Engineering Decisions & Implementation
1. Timezone-Resilient Calculation Engine in Go
To eliminate Daylight Saving Time and timezone drift, our Go backend microservice adopted an immutable timestamp model:
- All punch clock timestamps are stored in UTC Unix epoch milliseconds within the database, decoupled from local workplace display rules.
- Calculations consume the workplace's authoritative IANA timezone identifier (e.g.,
America/Chicago). Time intervals are projected into the local zone solely for calendar day boundary partitioning (determining which calendar day an overnight shift belongs to based on workplace configuration). - DST transitions are handled via wall-clock elapsed duration assertions, ensuring an overnight 8-hour shift during a fall-back transition correctly accounts for the extra physical hour worked without shifting the employee's schedule window.
// ShiftCalculator normalizes punch events across timezone boundaries
type ShiftCalculator struct {
loc *time.Location
}
func (c *ShiftCalculator) CalculatePayableHours(shift ShiftRecord) (PayableHours, error) {
startUTC := shift.ClockIn.UTC()
endUTC := shift.ClockOut.UTC()
// 1. Invariant elapsed duration calculation in UTC
rawDuration := endUTC.Sub(startUTC)
unpaidBreak := shift.TotalUnpaidBreakDuration()
netDuration := rawDuration - unpaidBreak
// 2. Partition into calendar day windows using workplace IANA timezone
localStart := startUTC.In(c.loc)
// 3. Apply state overtime rules and blended rate calculations
return c.computeOvertimeThresholds(localStart, netDuration, shift.PositionRates)
}2. Solving Blended Position Overtime Rates
When an employee works multiple job positions at different hourly wage rates, the Fair Labor Standards Act (FLSA) mandates calculating overtime using the regular rate of pay:
The overtime premium is then added to total straight-time earnings for all hours worked over 40. I designed the calculation pipeline in Go to compute this weighted average across complex split shifts, while ensuring exact sub-cent precision using fixed-point integer math (avoiding floating-point IEEE 754 precision drift).
3. Modernizing Frontend Architecture & RTL Adoption
On the frontend, time card interfaces require displaying granular punch histories with real-time feedback when managers adjust hours or assign position codes.
I spearheaded the migration of our frontend testing infrastructure to React Testing Library (RTL):
- Replaced shallow Enzyme snapshot tests with behavior-driven user interaction tests (simulating actual manager edits, keyboard navigation, and modal validations).
- Established reusable test harnesses and mock API fixtures, cutting test flakiness and boosting test execution speed across CI pipelines.
- Authored frontend testing guidelines and mentored teammates on writing resilient, accessible tests targeting ARIA roles and labels.
Measurable Outcomes & Engineering Impact
Over my four years at When I Work, these architectural practices and engineering contributions delivered sustained value across both product stability and engineering culture:
- 100% Payroll Calculation Accuracy: Successfully processed millions of hourly attendance records across multiple timezones with zero regulatory calculation defects.
- Promotion to Senior Full Stack Developer: Recognized for technical ownership, cross-functional leadership with Product and UX, and consistent high-quality delivery.
- Team-Wide Adoption of Development Plans: Technical planning standard was adopted across multiple squads, significantly reducing mid-sprint scope changes and unearthing architectural edge cases prior to implementation.
- Strengthened Frontend Reliability: Transition to React Testing Library established robust regression safety, empowering engineers to refactor legacy time card components with confidence.
- Culture of Constructive Mentorship: Fostered an empathetic, high-accountability code review environment, guiding engineers on Go idioms, database access patterns, and clean React architecture.
My tenure at When I Work solidified my approach to senior software engineering: technical excellence is not just about solving hard math or writing elegant code—it is about creating clarity, de-risking complex systems before they reach production, and elevating the engineers around you to do their best work.
Interested in discussing this architecture?
I'm currently open to Senior Frontend, Product Engineering, and Tech Lead opportunities. Let's talk about technical planning, high-concurrency systems, or frontend craftsmanship.