@casomoltd/nhs-pay 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +165 -0
- package/README.md +267 -0
- package/dist/bands.d.ts +42 -0
- package/dist/bands.js +161 -0
- package/dist/bands.js.map +1 -0
- package/dist/format.d.ts +20 -0
- package/dist/format.js +56 -0
- package/dist/format.js.map +1 -0
- package/dist/hcas-pcts.d.ts +19 -0
- package/dist/hcas-pcts.js +97 -0
- package/dist/hcas-pcts.js.map +1 -0
- package/dist/hcas.d.ts +28 -0
- package/dist/hcas.js +39 -0
- package/dist/hcas.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/pension-projection.d.ts +149 -0
- package/dist/pension-projection.js +352 -0
- package/dist/pension-projection.js.map +1 -0
- package/dist/pension.d.ts +64 -0
- package/dist/pension.js +96 -0
- package/dist/pension.js.map +1 -0
- package/dist/regions.d.ts +47 -0
- package/dist/regions.js +122 -0
- package/dist/regions.js.map +1 -0
- package/dist/scales.d.ts +79 -0
- package/dist/scales.js +329 -0
- package/dist/scales.js.map +1 -0
- package/dist/take-home.d.ts +12 -0
- package/dist/take-home.js +19 -0
- package/dist/take-home.js.map +1 -0
- package/package.json +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
package/README.md
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# @casomoltd/nhs-pay
|
|
2
|
+
|
|
3
|
+
NHS Agenda for Change pay scales, pension tiers, regions,
|
|
4
|
+
HCAS supplements, and take-home calculator. Built on top of
|
|
5
|
+
`@casomoltd/paye-calc`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @casomoltd/nhs-pay
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Public on the npm registry — no auth or `.npmrc` config needed.
|
|
14
|
+
|
|
15
|
+
Requires `@casomoltd/paye-calc` (>=0.5.0) as a peer
|
|
16
|
+
dependency.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Look up a band's salary range
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import {getAfcScales} from '@casomoltd/nhs-pay';
|
|
24
|
+
|
|
25
|
+
const {bands} = getAfcScales();
|
|
26
|
+
const band5 = bands.find((b) => b.band === '5')!;
|
|
27
|
+
console.log(band5.salaryMin); // entry salary
|
|
28
|
+
console.log(band5.salaryMax); // top of band
|
|
29
|
+
console.log(band5.points); // all pay points
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Calculate take-home for a Band 5 nurse
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import {
|
|
36
|
+
nhsTakeHome,
|
|
37
|
+
getAfcScales,
|
|
38
|
+
pensionTierRate,
|
|
39
|
+
} from '@casomoltd/nhs-pay';
|
|
40
|
+
|
|
41
|
+
const {bands, pensionTiers} = getAfcScales();
|
|
42
|
+
const band5 = bands.find((b) => b.band === '5')!;
|
|
43
|
+
const salary = band5.salaryMin;
|
|
44
|
+
const rate = pensionTierRate(salary, pensionTiers);
|
|
45
|
+
|
|
46
|
+
const thp = nhsTakeHome(salary, rate / 100);
|
|
47
|
+
console.log(thp.net); // annual net
|
|
48
|
+
console.log(thp.incomeTax); // annual tax
|
|
49
|
+
console.log(thp.nationalInsurance); // annual NI
|
|
50
|
+
console.log(thp.pensionDeduction); // annual pension
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Apply HCAS supplement
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import {
|
|
57
|
+
getAfcScales,
|
|
58
|
+
calculateHcasSupplement,
|
|
59
|
+
} from '@casomoltd/nhs-pay';
|
|
60
|
+
|
|
61
|
+
const {bands, hcas} = getAfcScales();
|
|
62
|
+
const base = bands[0].salaryMin;
|
|
63
|
+
const supplement = calculateHcasSupplement(
|
|
64
|
+
base, hcas.innerLondon,
|
|
65
|
+
);
|
|
66
|
+
console.log(base + supplement); // London-adjusted
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Format salary for display
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import {fmtSalary, fmtPct} from '@casomoltd/nhs-pay';
|
|
73
|
+
|
|
74
|
+
fmtSalary(31049); // '£31,049'
|
|
75
|
+
fmtPct(8.3); // '8.3%'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## API reference
|
|
79
|
+
|
|
80
|
+
### Scales (`scales.ts`)
|
|
81
|
+
|
|
82
|
+
| Export | Description |
|
|
83
|
+
| ---------------------- | ------------------------------------ |
|
|
84
|
+
| `AFC_BANDS` | Band key-to-ID mapping |
|
|
85
|
+
| `AFC_BAND_IDS` | Ordered array of all band IDs |
|
|
86
|
+
| `AFC_TAX_YEARS` | Tax years with available scale data |
|
|
87
|
+
| `AFC_HOURS_PER_YEAR` | Standard AfC hours (1950) |
|
|
88
|
+
| `NLW_HOURLY` | National Living Wage by year |
|
|
89
|
+
| `WALES_LW_FLOOR` | Welsh Government living wage floor |
|
|
90
|
+
| `annualiseHourly` | Convert hourly rate to annual salary |
|
|
91
|
+
| `applyWalesFloor` | Apply Wales living wage floor |
|
|
92
|
+
|
|
93
|
+
**Types:** `AfcBandId`, `ScalePoint`, `HcasZone`,
|
|
94
|
+
`HcasZones`
|
|
95
|
+
|
|
96
|
+
### Pension (`pension.ts`)
|
|
97
|
+
|
|
98
|
+
| Export | Description |
|
|
99
|
+
| ------------------- | ---------------------------------- |
|
|
100
|
+
| `getPensionTiers` | Pension tiers for a tax year |
|
|
101
|
+
| `pensionTierRate` | Contribution rate (%) for a salary |
|
|
102
|
+
| `lookupPensionTier` | Full tier info for a salary |
|
|
103
|
+
|
|
104
|
+
**Types:** `PensionTier`
|
|
105
|
+
|
|
106
|
+
### HCAS (`hcas.ts`)
|
|
107
|
+
|
|
108
|
+
| Export | Description |
|
|
109
|
+
| ------------------------ | ------------------------------ |
|
|
110
|
+
| `HCAS_ZONE_IDS` | Zone key-to-ID mapping |
|
|
111
|
+
| `calculateHcasSupplement`| HCAS amount for base + zone |
|
|
112
|
+
| `grossSalary` | Base + Wales floor + HCAS |
|
|
113
|
+
| `isHcasZoneId` | Type guard for zone IDs |
|
|
114
|
+
|
|
115
|
+
**Types:** `HcasZoneId`
|
|
116
|
+
|
|
117
|
+
### HCAS PCTs (`hcas-pcts.ts`)
|
|
118
|
+
|
|
119
|
+
| Export | Description |
|
|
120
|
+
| ------------------- | ------------------------------------ |
|
|
121
|
+
| `getHcasZone` | PCT → HCAS zone lookup |
|
|
122
|
+
| `getHcasPcts` | All PCTs with zone, in order |
|
|
123
|
+
|
|
124
|
+
**Types:** `HcasPct`
|
|
125
|
+
|
|
126
|
+
### Regions (`regions.ts`)
|
|
127
|
+
|
|
128
|
+
| Export | Description |
|
|
129
|
+
| ------------------- | ------------------------------------ |
|
|
130
|
+
| `AFC_REGIONS` | Region key-to-ID mapping |
|
|
131
|
+
| `ZONE_TO_REGION` | HCAS zone → AFC region mapping |
|
|
132
|
+
| `ZONE_LABELS` | HCAS zone → display label |
|
|
133
|
+
| `resolveRegion` | Resolve region to tax/HCAS/label |
|
|
134
|
+
| `afcRegionToNation` | Map region to paye-calc Nation |
|
|
135
|
+
| `isAfcRegionId` | Type guard for region IDs |
|
|
136
|
+
| `isNation` | Type guard for Nation strings |
|
|
137
|
+
|
|
138
|
+
**Types:** `AfcRegionId`, `ResolvedRegion`
|
|
139
|
+
|
|
140
|
+
### Bands (`bands.ts`)
|
|
141
|
+
|
|
142
|
+
| Export | Description |
|
|
143
|
+
| ------------------- | ------------------------------------ |
|
|
144
|
+
| `getAfcScales` | Band + scale + pension, nation-aware |
|
|
145
|
+
| `AFC_BAND_INFO` | Static band metadata (roles, slugs) |
|
|
146
|
+
| `AFC_CURRENT_YEAR` | Current financial year |
|
|
147
|
+
| `AFC_PREVIOUS_YEAR` | Previous financial year |
|
|
148
|
+
|
|
149
|
+
**Types:** `AfcBandInfo`, `AfcBandMeta`, `AfcScaleData`
|
|
150
|
+
|
|
151
|
+
### Take-home (`take-home.ts`)
|
|
152
|
+
|
|
153
|
+
| Export | Description |
|
|
154
|
+
| -------------- | ------------------------------------- |
|
|
155
|
+
| `nhsTakeHome` | Pre-configured TakeHomePay for NHS |
|
|
156
|
+
|
|
157
|
+
### Format (`format.ts`)
|
|
158
|
+
|
|
159
|
+
| Export | Description |
|
|
160
|
+
| ----------------- | ----------------------------------- |
|
|
161
|
+
| `fmtSalary` | Format exact salary (e.g. £31,049) |
|
|
162
|
+
| `formatGBP` | Format GBP, no decimals |
|
|
163
|
+
| `formatGBPPrecise` | Format GBP with pence |
|
|
164
|
+
| `fmtMoney` | Format rounded money |
|
|
165
|
+
| `fmtPct` | Format percentage (e.g. 8.3%) |
|
|
166
|
+
| `formatPct` | Format percentage (Intl) |
|
|
167
|
+
| `yearLabel` | Convert '2025-26' to '2025/26' |
|
|
168
|
+
|
|
169
|
+
### Re-exports from paye-calc
|
|
170
|
+
|
|
171
|
+
`TAX_REGIONS`, `TAX_YEARS`, `NATIONS`, `NATION_KEYS`,
|
|
172
|
+
`TakeHomePay`, `GrossAnnual`, `PensionBasis`,
|
|
173
|
+
`PensionPercent`, `StudentLoanPlan`, `nationToTaxRegion`,
|
|
174
|
+
and types `Nation`, `TaxRegion`, `TaxYear`.
|
|
175
|
+
|
|
176
|
+
## Data sources
|
|
177
|
+
|
|
178
|
+
### AfC pay scales
|
|
179
|
+
|
|
180
|
+
| Year | Nations | Source |
|
|
181
|
+
| ------- | -------------------- | ------ |
|
|
182
|
+
| 2025-26 | England, NI, Wales | [NHS Employers pay scales 2025/26][scales-2526] |
|
|
183
|
+
| 2026-27 | England, NI | [NHS Employers pay scales 2026/27][scales-2627] |
|
|
184
|
+
|
|
185
|
+
Cross-checked against [NHSPRB 39th Report (2026)][nhsprb-39],
|
|
186
|
+
Table A25 (AfC 2025/26 data for England, NI, Wales).
|
|
187
|
+
|
|
188
|
+
[scales-2526]: https://www.nhsemployers.org/articles/pay-scales-202526
|
|
189
|
+
[scales-2627]: https://www.nhsemployers.org/articles/pay-scales-202627
|
|
190
|
+
[nhsprb-39]: https://assets.publishing.service.gov.uk/media/698df41175466636847f6a93/NHSPRB_39th_Report_2026.pdf
|
|
191
|
+
|
|
192
|
+
### Scotland
|
|
193
|
+
|
|
194
|
+
Scotland negotiates its own AfC award independently and
|
|
195
|
+
has completely different base salaries from England.
|
|
196
|
+
Separate scale tables are stored for each tax year —
|
|
197
|
+
`getAfcScales(year, 'scotland')` returns Scotland figures
|
|
198
|
+
directly. Scotland also has structural differences: Band 2
|
|
199
|
+
has 2 points (vs 1 in England) and Bands 8a–9 have 2
|
|
200
|
+
points each (vs 3).
|
|
201
|
+
|
|
202
|
+
Source: [PCS(AFC)2026/1][scot-circular] — Scottish Health
|
|
203
|
+
Workforce Directorate circular (23 Jan 2026). Full pay
|
|
204
|
+
tables: [MSG Scotland AfC pay scales 2025-26 and 2026-27][scot-scales].
|
|
205
|
+
|
|
206
|
+
[scot-circular]: https://www.publications.scot.nhs.uk/files/pcs2026-afc-01.pdf
|
|
207
|
+
[scot-scales]: https://www.msg.scot.nhs.uk/wp-content/uploads/AfC-Pay-Scales-2025-26-and-2026-27.pdf
|
|
208
|
+
|
|
209
|
+
### Wales
|
|
210
|
+
|
|
211
|
+
The Welsh Government applies a Living Wage Foundation floor
|
|
212
|
+
as an advance uplift. Spine points below the floor are
|
|
213
|
+
lifted to it. Source: [AfC(W) 01/2026][wales-circular]
|
|
214
|
+
pay letter (6 Jan 2026).
|
|
215
|
+
|
|
216
|
+
[wales-circular]: https://www.nhs.wales/files/pc-resources/2026-afc-1-2026-living-wage-pdf-pdf/
|
|
217
|
+
|
|
218
|
+
### Other data
|
|
219
|
+
|
|
220
|
+
| Data | Source |
|
|
221
|
+
| ---------------------- | ------ |
|
|
222
|
+
| Pension contribution rates 2025/26 | [NHSBSA contribution rates][pension-2526] |
|
|
223
|
+
| Income tax / NI rates | gov.uk (via paye-calc) |
|
|
224
|
+
| National Living Wage | [gov.uk NLW rates][nlw] |
|
|
225
|
+
| HCAS PCT zones | NHS Employers Annex 8 Table 12 |
|
|
226
|
+
|
|
227
|
+
[pension-2526]: https://www.nhsbsa.nhs.uk/nhs-pensions-contribution-rates-202526
|
|
228
|
+
[nlw]: https://www.gov.uk/national-minimum-wage-rates
|
|
229
|
+
|
|
230
|
+
## Test fixtures
|
|
231
|
+
|
|
232
|
+
`tests/fixtures/band-take-home.csv` — 90 golden-value rows
|
|
233
|
+
covering bands 5, 7, 8a across all 4 nations (England,
|
|
234
|
+
Scotland, Wales, NI), both tax years, 3 HCAS zones, and
|
|
235
|
+
part-time (0.6 FTE). Gross figures are derived from
|
|
236
|
+
`getAfcScales(year, nation)` using the sources above.
|
|
237
|
+
Pension, tax, NI and net values are computed by
|
|
238
|
+
`nhsTakeHome` and should be cross-checked against:
|
|
239
|
+
|
|
240
|
+
- [NHS Employers pay scales 2025/26][scales-2526] and
|
|
241
|
+
[2026/27][scales-2627] for England/NI/Wales gross
|
|
242
|
+
- [MSG Scotland AfC pay scales][scot-scales] for Scotland
|
|
243
|
+
gross
|
|
244
|
+
- [NHSBSA pension contribution rates 2025/26][pension-2526]
|
|
245
|
+
for pension tier rates
|
|
246
|
+
|
|
247
|
+
## Tax years
|
|
248
|
+
|
|
249
|
+
| Year | Scales | Pension |
|
|
250
|
+
| ------- | ------ | ------- |
|
|
251
|
+
| 2023-24 | Yes | Yes |
|
|
252
|
+
| 2024-25 | Yes | Yes |
|
|
253
|
+
| 2025-26 | Yes | Yes |
|
|
254
|
+
| 2026-27 | Yes | Yes |
|
|
255
|
+
|
|
256
|
+
## Development
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
npm run check # lint + typecheck + knip + jscpd + test
|
|
260
|
+
npm run build # compile to dist/
|
|
261
|
+
npm test # vitest
|
|
262
|
+
npm run test:watch # vitest watch mode
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## License
|
|
266
|
+
|
|
267
|
+
LGPL-3.0-only
|
package/dist/bands.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge layer — combines static band metadata with
|
|
3
|
+
* year-specific salary data and pension tiers.
|
|
4
|
+
*
|
|
5
|
+
* Role descriptions sourced from NHS Employers:
|
|
6
|
+
* https://www.nhsemployers.org/articles/pay-scales-202526
|
|
7
|
+
*/
|
|
8
|
+
import type { TaxYear, Nation } from '@casomoltd/paye-calc';
|
|
9
|
+
import type { AfcBandId, ScalePoint, HcasZones } from './scales.js';
|
|
10
|
+
import type { PensionTier } from './pension.js';
|
|
11
|
+
export interface AfcBandInfo {
|
|
12
|
+
slug: string;
|
|
13
|
+
label: string;
|
|
14
|
+
roles: string;
|
|
15
|
+
roleContext: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const AFC_BAND_INFO: Record<AfcBandId, AfcBandInfo>;
|
|
18
|
+
export interface AfcBandMeta {
|
|
19
|
+
band: AfcBandId;
|
|
20
|
+
slug: string;
|
|
21
|
+
label: string;
|
|
22
|
+
roles: string;
|
|
23
|
+
roleContext: string;
|
|
24
|
+
points: ScalePoint[];
|
|
25
|
+
salaryMin: number;
|
|
26
|
+
salaryMax: number;
|
|
27
|
+
}
|
|
28
|
+
export interface AfcScaleData {
|
|
29
|
+
bands: AfcBandMeta[];
|
|
30
|
+
hcas: HcasZones;
|
|
31
|
+
pensionTiers: PensionTier[];
|
|
32
|
+
}
|
|
33
|
+
/** Current financial year for band pages. */
|
|
34
|
+
export declare const AFC_CURRENT_YEAR: "2026-27";
|
|
35
|
+
/** Previous financial year for comparison. */
|
|
36
|
+
export declare const AFC_PREVIOUS_YEAR: "2025-26";
|
|
37
|
+
/** Load AFC scale data — synchronous, no file I/O.
|
|
38
|
+
* Scotland has its own scale tables; Wales applies
|
|
39
|
+
* a living wage floor to the England/NI base.
|
|
40
|
+
* Omit `nation` for backward-compatible England
|
|
41
|
+
* figures. */
|
|
42
|
+
export declare function getAfcScales(year?: TaxYear, nation?: Nation): AfcScaleData;
|
package/dist/bands.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge layer — combines static band metadata with
|
|
3
|
+
* year-specific salary data and pension tiers.
|
|
4
|
+
*
|
|
5
|
+
* Role descriptions sourced from NHS Employers:
|
|
6
|
+
* https://www.nhsemployers.org/articles/pay-scales-202526
|
|
7
|
+
*/
|
|
8
|
+
import { TAX_YEARS } from '@casomoltd/paye-calc';
|
|
9
|
+
import { AFC_BAND_IDS, applyWalesFloor, getScalesForYear, } from './scales.js';
|
|
10
|
+
import { getPensionTiers } from './pension.js';
|
|
11
|
+
export const AFC_BAND_INFO = {
|
|
12
|
+
'2': {
|
|
13
|
+
slug: 'nhs-band-2-pay',
|
|
14
|
+
label: 'Band 2',
|
|
15
|
+
roles: 'Healthcare assistants,'
|
|
16
|
+
+ ' housekeeping, security',
|
|
17
|
+
roleContext: 'Entry-level support roles including'
|
|
18
|
+
+ ' domestic support workers,'
|
|
19
|
+
+ ' housekeeping assistants, drivers,'
|
|
20
|
+
+ ' security officers and healthcare'
|
|
21
|
+
+ ' assistants.',
|
|
22
|
+
},
|
|
23
|
+
'3': {
|
|
24
|
+
slug: 'nhs-band-3-pay',
|
|
25
|
+
label: 'Band 3',
|
|
26
|
+
roles: 'Emergency care assistants,'
|
|
27
|
+
+ ' therapy support workers',
|
|
28
|
+
roleContext: 'Experienced support roles such as'
|
|
29
|
+
+ ' emergency care assistants and'
|
|
30
|
+
+ ' occupational therapy support'
|
|
31
|
+
+ ' workers.',
|
|
32
|
+
},
|
|
33
|
+
'4': {
|
|
34
|
+
slug: 'nhs-band-4-pay',
|
|
35
|
+
label: 'Band 4',
|
|
36
|
+
roles: 'Assistant practitioners,'
|
|
37
|
+
+ ' pharmacy technicians',
|
|
38
|
+
roleContext: 'Roles requiring specialist training'
|
|
39
|
+
+ ' including assistant practitioners,'
|
|
40
|
+
+ ' pharmacy technicians, dental nurses'
|
|
41
|
+
+ ' and trainee psychological wellbeing'
|
|
42
|
+
+ ' practitioners.',
|
|
43
|
+
},
|
|
44
|
+
'5': {
|
|
45
|
+
slug: 'nhs-band-5-pay',
|
|
46
|
+
label: 'Band 5',
|
|
47
|
+
roles: 'Newly qualified nurses,'
|
|
48
|
+
+ ' midwives, therapists',
|
|
49
|
+
roleContext: 'The entry point for newly qualified'
|
|
50
|
+
+ ' clinical professionals including'
|
|
51
|
+
+ ' nurses, operating department'
|
|
52
|
+
+ ' practitioners, podiatrists and'
|
|
53
|
+
+ ' therapeutic radiographers.',
|
|
54
|
+
},
|
|
55
|
+
'6': {
|
|
56
|
+
slug: 'nhs-band-6-pay',
|
|
57
|
+
label: 'Band 6',
|
|
58
|
+
roles: 'Senior nurses,'
|
|
59
|
+
+ ' specialist practitioners',
|
|
60
|
+
roleContext: 'Experienced clinical and specialist'
|
|
61
|
+
+ ' roles such as school nurses,'
|
|
62
|
+
+ ' paramedics, estates officers and'
|
|
63
|
+
+ ' health records managers.',
|
|
64
|
+
},
|
|
65
|
+
'7': {
|
|
66
|
+
slug: 'nhs-band-7-pay',
|
|
67
|
+
label: 'Band 7',
|
|
68
|
+
roles: 'Team leaders,'
|
|
69
|
+
+ ' advanced practitioners',
|
|
70
|
+
roleContext: 'Advanced and management roles'
|
|
71
|
+
+ ' including communications managers,'
|
|
72
|
+
+ ' estates managers and advanced'
|
|
73
|
+
+ ' speech and language therapists.',
|
|
74
|
+
},
|
|
75
|
+
'8a': {
|
|
76
|
+
slug: 'nhs-band-8a-pay',
|
|
77
|
+
label: 'Band 8a',
|
|
78
|
+
roles: 'Modern matrons, nurse consultants',
|
|
79
|
+
roleContext: 'Senior specialist and management'
|
|
80
|
+
+ ' roles such as consultant'
|
|
81
|
+
+ ' prosthetists, dental laboratory'
|
|
82
|
+
+ ' managers, modern matrons and nurse'
|
|
83
|
+
+ ' consultants.',
|
|
84
|
+
},
|
|
85
|
+
'8b': {
|
|
86
|
+
slug: 'nhs-band-8b-pay',
|
|
87
|
+
label: 'Band 8b',
|
|
88
|
+
roles: 'Heads of service, strategic managers',
|
|
89
|
+
roleContext: 'Strategic management and senior'
|
|
90
|
+
+ ' clinical leadership including heads'
|
|
91
|
+
+ ' of education, clinical physiology'
|
|
92
|
+
+ ' service managers and head'
|
|
93
|
+
+ ' orthoptists.',
|
|
94
|
+
},
|
|
95
|
+
'8c': {
|
|
96
|
+
slug: 'nhs-band-8c-pay',
|
|
97
|
+
label: 'Band 8c',
|
|
98
|
+
roles: 'Heads of HR,'
|
|
99
|
+
+ ' consultant clinical scientists',
|
|
100
|
+
roleContext: 'Senior leadership roles such as'
|
|
101
|
+
+ ' heads of human resources,'
|
|
102
|
+
+ ' consultant clinical scientists and'
|
|
103
|
+
+ ' consultant paramedics.',
|
|
104
|
+
},
|
|
105
|
+
'8d': {
|
|
106
|
+
slug: 'nhs-band-8d-pay',
|
|
107
|
+
label: 'Band 8d',
|
|
108
|
+
roles: 'Chief nurses, chief finance managers',
|
|
109
|
+
roleContext: 'Executive-level clinical and'
|
|
110
|
+
+ ' corporate roles including consultant'
|
|
111
|
+
+ ' psychologists, chief nurses and'
|
|
112
|
+
+ ' chief finance managers.',
|
|
113
|
+
},
|
|
114
|
+
'9': {
|
|
115
|
+
slug: 'nhs-band-9-pay',
|
|
116
|
+
label: 'Band 9',
|
|
117
|
+
roles: 'Directors, chief officers',
|
|
118
|
+
roleContext: 'The most senior AfC roles including'
|
|
119
|
+
+ ' podiatric surgery consultants, chief'
|
|
120
|
+
+ ' finance managers and directors of'
|
|
121
|
+
+ ' estates and facilities.',
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
/** Current financial year for band pages. */
|
|
125
|
+
export const AFC_CURRENT_YEAR = TAX_YEARS.Y2026_27;
|
|
126
|
+
/** Previous financial year for comparison. */
|
|
127
|
+
export const AFC_PREVIOUS_YEAR = TAX_YEARS.Y2025_26;
|
|
128
|
+
/** Load AFC scale data — synchronous, no file I/O.
|
|
129
|
+
* Scotland has its own scale tables; Wales applies
|
|
130
|
+
* a living wage floor to the England/NI base.
|
|
131
|
+
* Omit `nation` for backward-compatible England
|
|
132
|
+
* figures. */
|
|
133
|
+
export function getAfcScales(year = AFC_CURRENT_YEAR, nation) {
|
|
134
|
+
const scaleYear = getScalesForYear(year, nation);
|
|
135
|
+
const pensionTiers = getPensionTiers(year);
|
|
136
|
+
const bands = AFC_BAND_IDS.map((band) => {
|
|
137
|
+
const info = AFC_BAND_INFO[band];
|
|
138
|
+
const basePoints = scaleYear.scales[band];
|
|
139
|
+
const points = nation === 'wales'
|
|
140
|
+
? basePoints.map((pt) => {
|
|
141
|
+
const salary = applyWalesFloor(pt.salary, year);
|
|
142
|
+
return salary !== pt.salary
|
|
143
|
+
? { ...pt, salary } : pt;
|
|
144
|
+
})
|
|
145
|
+
: basePoints;
|
|
146
|
+
const salaries = points.map((p) => p.salary);
|
|
147
|
+
return {
|
|
148
|
+
band,
|
|
149
|
+
...info,
|
|
150
|
+
points,
|
|
151
|
+
salaryMin: Math.min(...salaries),
|
|
152
|
+
salaryMax: Math.max(...salaries),
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
return {
|
|
156
|
+
bands,
|
|
157
|
+
hcas: scaleYear.hcas,
|
|
158
|
+
pensionTiers,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=bands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bands.js","sourceRoot":"","sources":["../src/bands.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAM/C,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAW7C,MAAM,CAAC,MAAM,aAAa,GAEtB;IACF,GAAG,EAAE;QACH,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,QAAQ;QACf,KAAK,EACH,wBAAwB;cACtB,yBAAyB;QAC7B,WAAW,EACT,qCAAqC;cACnC,4BAA4B;cAC5B,oCAAoC;cACpC,mCAAmC;cACnC,cAAc;KACnB;IACD,GAAG,EAAE;QACH,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,QAAQ;QAC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AC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACnC,OAAO,MAAM,KAAK,EAAE,CAAC,MAAM;oBACzB,CAAC,CAAC,EAAC,GAAG,EAAE,EAAE,MAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,CAAC,CAAC;YACF,CAAC,CAAC,UAAU,CAAC;QACjB,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CACzB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChB,CAAC;QACF,OAAO;YACL,IAAI;YACJ,GAAG,IAAI;YACP,MAAM;YACN,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;YAChC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;SACjC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,KAAK;QACL,IAAI,EAAE,SAAS,CAAC,IAAI;QACpB,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GBP and percentage formatting helpers for NHS
|
|
3
|
+
* pay data. Consolidates formatters previously split
|
|
4
|
+
* across afc-format.ts and calculator format.ts.
|
|
5
|
+
*/
|
|
6
|
+
import type { TaxYear } from '@casomoltd/paye-calc';
|
|
7
|
+
/** Exact salary with £ sign — £31,049 */
|
|
8
|
+
export declare function fmtSalary(n: number): string;
|
|
9
|
+
/** Format as £35,000 (no decimals, Intl). */
|
|
10
|
+
export declare function formatGBP(n: number): string;
|
|
11
|
+
/** Format as £35,000.00 (with pence). */
|
|
12
|
+
export declare function formatGBPPrecise(n: number): string;
|
|
13
|
+
/** Rounded money — £31,049 */
|
|
14
|
+
export declare function fmtMoney(n: number): string;
|
|
15
|
+
/** Percentage from a number — 5.8% */
|
|
16
|
+
export declare function fmtPct(n: number): string;
|
|
17
|
+
/** Format as 8.3% (Intl, input is whole %). */
|
|
18
|
+
export declare function formatPct(n: number): string;
|
|
19
|
+
/** '2025-26' → '2025/26' */
|
|
20
|
+
export declare function yearLabel(year: TaxYear): string;
|