Mintage Payroll ·

First payroll building blocks: pay and deductions

Payroll code arrives: a remuneration module, a pattern for deductions, employee age and per-year options, all served through a new API.

1 min read52 commits that monthPayrollAPI

From foundation to payroll

April is the first month where the work is clearly about paying people. On the first of the month a new remuneration module was created, and over the following weeks it gained controllers, API resources and a repository for loading employee data.

We also made an early architectural call: payroll would be served through an API rather than through server-rendered pages. The module's web routes were removed and replaced with API routes, with pagination from the start. That decision let us build the screens separately and, much later, connect other tools to the same calculations.

Deductions as building blocks

The most important pattern introduced this month was how deductions are represented. Each deduction became its own class, and a rule was set that every one of those classes must end with the word Deduction. It sounds like a naming detail, but it meant the system could discover deductions automatically and treat them consistently, whether a statutory item like PAYE or NIS or a company-specific one.

Alongside that, the system started calculating employee age, which statutory rules need to know, and storing payroll options per year so that settings for one tax year do not leak into the next. A small helper for formatting money arrived too, which matters more than it sounds when every figure ends up on a payslip.

None of this produced a payroll run yet. It produced the vocabulary that the next month's work was written in.

This article was written from Mintage Payroll’s commit history for April 2021. See Mintage Payroll today