@casomoltd/nhs-pay 0.30.0 → 0.32.0
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/README.md +71 -252
- package/dist/bands.d.ts +9 -1
- package/dist/bands.js +20 -0
- package/dist/bands.js.map +1 -1
- package/dist/document-source.d.ts +32 -7
- package/dist/document-source.js +32 -8
- package/dist/document-source.js.map +1 -1
- package/dist/errors.d.ts +57 -11
- package/dist/errors.js +85 -28
- package/dist/errors.js.map +1 -1
- package/dist/factor-basis.d.ts +23 -3
- package/dist/factor-basis.js +40 -28
- package/dist/factor-basis.js.map +1 -1
- package/dist/index.d.ts +16 -14
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/member/benefits.js +25 -13
- package/dist/member/benefits.js.map +1 -1
- package/dist/member/index.d.ts +1 -1
- package/dist/member/input-period.d.ts +4 -4
- package/dist/member/input-period.js +11 -9
- package/dist/member/input-period.js.map +1 -1
- package/dist/member/service.d.ts +4 -0
- package/dist/member/service.js +9 -3
- package/dist/member/service.js.map +1 -1
- package/dist/member/types.d.ts +81 -49
- package/dist/member/types.js.map +1 -1
- package/dist/member/valuation.d.ts +10 -8
- package/dist/member/valuation.js +14 -21
- package/dist/member/valuation.js.map +1 -1
- package/dist/pay-path.d.ts +21 -25
- package/dist/pay-path.js +85 -67
- package/dist/pay-path.js.map +1 -1
- package/dist/pension/ages.d.ts +6 -4
- package/dist/pension/ages.js +6 -4
- package/dist/pension/ages.js.map +1 -1
- package/dist/pension/curve.d.ts +2 -1
- package/dist/pension/curve.js +15 -7
- package/dist/pension/curve.js.map +1 -1
- package/dist/pension/history.d.ts +18 -3
- package/dist/pension/history.js +12 -5
- package/dist/pension/history.js.map +1 -1
- package/dist/pension/ledger.d.ts +15 -9
- package/dist/pension/ledger.js +95 -59
- package/dist/pension/ledger.js.map +1 -1
- package/dist/pension/money.d.ts +2 -0
- package/dist/pension/money.js +4 -0
- package/dist/pension/money.js.map +1 -1
- package/dist/pension/prices.d.ts +11 -2
- package/dist/pension/prices.js +35 -14
- package/dist/pension/prices.js.map +1 -1
- package/dist/pension/scheme-year.d.ts +59 -0
- package/dist/pension/scheme-year.js +80 -0
- package/dist/pension/scheme-year.js.map +1 -0
- package/dist/pension/seed.d.ts +66 -50
- package/dist/pension/seed.js +111 -65
- package/dist/pension/seed.js.map +1 -1
- package/dist/pension/uplift.d.ts +38 -54
- package/dist/pension/uplift.js +38 -68
- package/dist/pension/uplift.js.map +1 -1
- package/dist/pension-projection.js +30 -22
- package/dist/pension-projection.js.map +1 -1
- package/dist/post.d.ts +1 -10
- package/dist/post.js +1 -12
- package/dist/post.js.map +1 -1
- package/dist/revaluation.d.ts +56 -41
- package/dist/revaluation.js +76 -62
- package/dist/revaluation.js.map +1 -1
- package/dist/scale-point.d.ts +6 -0
- package/dist/sections/final-salary.d.ts +3 -8
- package/dist/sections/final-salary.js +6 -10
- package/dist/sections/final-salary.js.map +1 -1
- package/dist/sections/section-2015.d.ts +3 -4
- package/dist/sections/section-2015.js +1 -1
- package/dist/sections/section-2015.js.map +1 -1
- package/dist/sources.d.ts +14 -0
- package/dist/sources.js +24 -0
- package/dist/sources.js.map +1 -1
- package/dist/take-home.d.ts +4 -20
- package/dist/take-home.js +3 -23
- package/dist/take-home.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
# @casomoltd/nhs-pay
|
|
2
2
|
|
|
3
|
-
NHS pay scales — Agenda for Change plus medical & dental —
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
NHS pension across the 1995, 2008 and 2015 Sections: final salary
|
|
7
|
-
and career average, the McCloud remedy window valued on either
|
|
8
|
-
basis, early and late retirement factors, and tax-free cash across
|
|
9
|
-
the whole drawing.
|
|
10
|
-
|
|
11
|
-
See [`docs/pay-frameworks.md`](docs/pay-frameworks.md) for the domain
|
|
12
|
-
model — the pay frameworks (AfC, medical, dental, VSM), the shared
|
|
13
|
-
scale-resolver core, and where the consumer boundary sits.
|
|
3
|
+
NHS pay scales — Agenda for Change plus medical & dental — with pension tiers, regions, HCAS supplements, and a take-home calculator built on top of `@casomoltd/paye-calc`. And a member's NHS pension across the 1995, 2008 and 2015 Sections: final salary and career average, the McCloud remedy window valued on either basis, early and late retirement factors, and tax-free cash across the whole drawing.
|
|
4
|
+
|
|
5
|
+
See [`docs/pay-frameworks.md`](docs/pay-frameworks.md) for the domain model — the pay frameworks (AfC, medical, dental, VSM), the shared scale-resolver core, and where the consumer boundary sits.
|
|
14
6
|
|
|
15
7
|
## About Casomo
|
|
16
8
|
|
|
17
|
-
Casomo is a [registered UK limited company][companies-house]
|
|
18
|
-
founded and directed by
|
|
19
|
-
[David Mohamad](https://github.com/dkmohamad). It builds focused
|
|
20
|
-
software tools and offers engineering consulting. This library
|
|
21
|
-
powers the NHS pay calculators and explainers on
|
|
22
|
-
[casomo.co.uk](https://casomo.co.uk) — where the differentiator is
|
|
23
|
-
showing **take-home** pay (after tax, NI and pension), not just the
|
|
24
|
-
gross figures most published sources stop at.
|
|
9
|
+
Casomo is a [registered UK limited company][companies-house] founded and directed by [David Mohamad](https://github.com/dkmohamad). It builds focused software tools and offers engineering consulting. This library powers the NHS pay calculators and explainers on [casomo.co.uk](https://casomo.co.uk) — where the differentiator is showing **take-home** pay (after tax, NI and pension), not just the gross figures most published sources stop at.
|
|
25
10
|
|
|
26
11
|
- **Portfolio** — [casomo.co.uk](https://casomo.co.uk)
|
|
27
12
|
- **Consulting** — [casomoltd.com](https://casomoltd.com)
|
|
@@ -36,8 +21,7 @@ npm install @casomoltd/nhs-pay
|
|
|
36
21
|
|
|
37
22
|
Public on the npm registry — no auth or `.npmrc` config needed.
|
|
38
23
|
|
|
39
|
-
Requires `@casomoltd/paye-calc` as a peer dependency; the range it
|
|
40
|
-
accepts is `peerDependencies` in [`package.json`](package.json).
|
|
24
|
+
Requires `@casomoltd/paye-calc` as a peer dependency; the range it accepts is `peerDependencies` in [`package.json`](package.json).
|
|
41
25
|
|
|
42
26
|
## Usage
|
|
43
27
|
|
|
@@ -114,10 +98,7 @@ fmtPct(8.3); // '8.3%'
|
|
|
114
98
|
|
|
115
99
|
### Take-home for a doctor or dentist
|
|
116
100
|
|
|
117
|
-
Medical and dental grades resolve the same way as AfC, via a
|
|
118
|
-
per-family resolver. `getMedicalScales(year, nation)` lists the
|
|
119
|
-
grades published for a nation and year; `fromPoint` builds a
|
|
120
|
-
`Post` (gross, pension tier, tax, NI, take-home) from one point.
|
|
101
|
+
Medical and dental grades resolve the same way as AfC, via a per-family resolver. `getMedicalScales(year, nation)` lists the grades published for a nation and year; `fromPoint` builds a `Post` (gross, pension tier, tax, NI, take-home) from one point.
|
|
121
102
|
|
|
122
103
|
```ts
|
|
123
104
|
import {getMedicalScales, medicalResolver} from '@casomoltd/nhs-pay';
|
|
@@ -135,16 +116,9 @@ console.log(post.takeHome.net); // annual net after tax + NI + pension
|
|
|
135
116
|
console.log(consultant.source.reference); // the circular it came from
|
|
136
117
|
```
|
|
137
118
|
|
|
138
|
-
`fromPoint` takes the point itself. There is also
|
|
139
|
-
`fromScalePoint(grade, label, …)` for a caller holding only a label,
|
|
140
|
-
but a label does not identify a point on every scale — England's
|
|
141
|
-
consultant scale is 20 payroll steps over 5 threshold labels, so
|
|
142
|
-
`'Threshold 4'` names six of them and that call throws
|
|
143
|
-
`AmbiguousScalePoint` rather than picking one.
|
|
119
|
+
`fromPoint` takes the point itself. There is also `fromScalePoint(grade, label, …)` for a caller holding only a label, but a label does not identify a point on every scale — England's consultant scale is 20 payroll steps over 5 threshold labels, so `'Threshold 4'` names six of them and that call throws `AmbiguousScalePoint` rather than picking one.
|
|
144
120
|
|
|
145
|
-
`getDentalScales` / `dentalResolver` mirror this for salaried
|
|
146
|
-
dental grades. Both fail loud (`ScaleUnavailable`) for an
|
|
147
|
-
unpublished nation/year or grade rather than defaulting.
|
|
121
|
+
`getDentalScales` / `dentalResolver` mirror this for salaried dental grades. Both fail loud (`ScaleUnavailable`) for an unpublished nation/year or grade rather than defaulting.
|
|
148
122
|
|
|
149
123
|
### Value a member's pension across sections
|
|
150
124
|
|
|
@@ -169,6 +143,7 @@ const benefits = memberBenefits(
|
|
|
169
143
|
declared: [],
|
|
170
144
|
current: {todaysMoney: 51932, asAt: isoDate('2026-09-01')},
|
|
171
145
|
ladder: null, // or the member's AfC band points and current point
|
|
146
|
+
partTime: false, // true: pay above is for fewer than full-time hours
|
|
172
147
|
},
|
|
173
148
|
statement: null, // or a 2015 Section balance off a statement
|
|
174
149
|
},
|
|
@@ -181,8 +156,9 @@ const benefits = memberBenefits(
|
|
|
181
156
|
benefits.remedy; // true: in service by 31 March 2012 and after 2015
|
|
182
157
|
benefits.now(); // held today, the remedy window on the legacy basis
|
|
183
158
|
|
|
184
|
-
// Asked once per
|
|
185
|
-
|
|
159
|
+
// Asked once per election the member is compared on: both bases here,
|
|
160
|
+
// because they have a remedy window. Every section is drawn on one date.
|
|
161
|
+
for (const kind of benefits.elections) {
|
|
186
162
|
const position = benefits.at({
|
|
187
163
|
leaving: isoDate('2039-09-30'),
|
|
188
164
|
drawing: isoDate('2039-09-30'),
|
|
@@ -190,6 +166,7 @@ for (const kind of ['legacy-basis', 'section-2015-basis'] as const) {
|
|
|
190
166
|
cash: {kind: 'maximum'},
|
|
191
167
|
});
|
|
192
168
|
position.awards; // one per section and basis, each factored
|
|
169
|
+
position.section2015; // the 2015 Section's ledgers, estimated history, curve
|
|
193
170
|
position.crystallised; // the pension and automatic lump sum, summed
|
|
194
171
|
position.cash; // the cash taken across the whole
|
|
195
172
|
}
|
|
@@ -203,22 +180,11 @@ const period = benefits.pensionInputPeriod(taxYearEnd(2027), {
|
|
|
203
180
|
const input = definedBenefitInput(period); // the year's input amount
|
|
204
181
|
```
|
|
205
182
|
|
|
206
|
-
Each section keeps its own rules — denominator, pay measure,
|
|
207
|
-
pension age, lump sum, factors — so no caller can combine them
|
|
208
|
-
into one the scheme lacks. Pay comes from the member's pay path
|
|
209
|
-
(`promotionalIndex` is GAD's curve behind it). Service the library
|
|
210
|
-
does not model, such as a break, is refused with
|
|
211
|
-
`BenefitNotModelled` and a `code` to branch on; `NOT_MODELLED`
|
|
212
|
-
links each code to the issue tracking it. See
|
|
213
|
-
[*A member's benefits across sections*](docs/how-it-works.md#a-members-benefits-across-sections)
|
|
214
|
-
for the model. How each arrangement's pension input is valued is
|
|
215
|
-
[*A year's pension input*](docs/how-it-works.md#a-years-pension-input).
|
|
183
|
+
Each section keeps its own rules — denominator, pay measure, pension age, lump sum, factors — so no caller can combine them into one the scheme lacks. Pay comes from the member's pay path (`promotionalIndex` is GAD's curve behind it). Service the library does not model, such as a break, is refused with `BenefitNotModelled` and a `code` to branch on; `NOT_MODELLED` links each code to the issue tracking it. See [*A member's benefits across sections*](docs/how-it-works.md#a-members-benefits-across-sections) for the model. How each arrangement's pension input is valued is [*A year's pension input*](docs/how-it-works.md#a-years-pension-input).
|
|
216
184
|
|
|
217
185
|
### Project a 2015 Section pension on flat pay
|
|
218
186
|
|
|
219
|
-
**Deprecated.** `projectPension` is kept for this flat-pay question
|
|
220
|
-
until [#21](https://github.com/casomoltd/nhs-pay/issues/21); for a
|
|
221
|
-
member across sections, use `memberBenefits` above.
|
|
187
|
+
**Deprecated.** `projectPension` is kept for this flat-pay question until [#21](https://github.com/casomoltd/nhs-pay/issues/21); for a member across sections, use `memberBenefits` above.
|
|
222
188
|
|
|
223
189
|
```ts
|
|
224
190
|
import {
|
|
@@ -268,47 +234,21 @@ console.log(limit.real.amount, limit.real.binding);
|
|
|
268
234
|
console.log(limit.nominal.amount, limit.nominal.binding);
|
|
269
235
|
```
|
|
270
236
|
|
|
271
|
-
The maximum is the **lower** of two caps, and **both are
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
the
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
restate the rule.
|
|
279
|
-
|
|
280
|
-
Why that name is left as it is, and what moves where when it
|
|
281
|
-
changes: [*The two caps on tax-free
|
|
282
|
-
cash*](docs/how-it-works.md#the-two-caps-on-tax-free-cash).
|
|
283
|
-
|
|
284
|
-
There is **one limit per ruler, and no single flag**, because the
|
|
285
|
-
two can genuinely disagree: `real` is the model run at zero CPI
|
|
286
|
-
while the allowance is carried forward at CPI, so around the
|
|
287
|
-
crossover the allowance binds in today's money while the scheme
|
|
288
|
-
limb still binds in cash. Show the limit belonging to the ruler
|
|
289
|
-
on screen. See
|
|
290
|
-
[*The two caps on tax-free cash*](docs/how-it-works.md#the-two-caps-on-tax-free-cash).
|
|
291
|
-
|
|
292
|
-
Without a statement figure, `kind: 'estimation'` accrues from a
|
|
293
|
-
`joinDate` instead. ERF/LRF factors are transcribed verbatim from
|
|
294
|
-
the GAD consolidated factor workbook (30 June 2023 issue) with
|
|
295
|
-
GAD's own rounding rules; a retirement date beyond the printed
|
|
296
|
-
tables throws `RetirementFactorOutOfRange`.
|
|
237
|
+
The maximum is the **lower** of two caps, and **both are statutory**: 25% of the capital value of the benefits, and the Lump Sum Allowance. The scheme's own contribution to the swap is the 12:1 rate and nothing else, so a consumer must not attribute the 25% to the scheme — `LUMP_SUM_CAPS.Scheme` names the discriminant, not the rule's author. `binding` says which cap stopped it, so a consumer can explain the figure rather than restate the rule.
|
|
238
|
+
|
|
239
|
+
Why that name is left as it is, and what moves where when it changes: [*The two caps on tax-free cash*](docs/how-it-works.md#the-two-caps-on-tax-free-cash).
|
|
240
|
+
|
|
241
|
+
There is **one limit per ruler, and no single flag**, because the two can genuinely disagree: `real` is the model run at zero CPI while the allowance is carried forward at CPI, so around the crossover the allowance binds in today's money while the scheme limb still binds in cash. Show the limit belonging to the ruler on screen. See [*The two caps on tax-free cash*](docs/how-it-works.md#the-two-caps-on-tax-free-cash).
|
|
242
|
+
|
|
243
|
+
Without a statement figure, `kind: 'estimation'` accrues from a `joinDate` instead. ERF/LRF factors are transcribed verbatim from the GAD consolidated factor workbook (30 June 2023 issue) with GAD's own rounding rules; a retirement date beyond the printed tables throws `RetirementFactorOutOfRange`.
|
|
297
244
|
|
|
298
245
|
## How it works
|
|
299
246
|
|
|
300
|
-
[`docs/how-it-works.md`](docs/how-it-works.md) — the model this
|
|
301
|
-
library implements: the recurrence it walks, what a scheme year
|
|
302
|
-
and an exit date mean to it, why cash and today's money are two
|
|
303
|
-
runs rather than one and a deflator, and every assumption it
|
|
304
|
-
makes, declared. Read it before trusting a figure.
|
|
247
|
+
[`docs/how-it-works.md`](docs/how-it-works.md) — the model this library implements: the recurrence it walks, what a scheme year and an exit date mean to it, why cash and today's money are two runs rather than one and a deflator, and every assumption it makes, declared. Read it before trusting a figure.
|
|
305
248
|
|
|
306
249
|
## API reference
|
|
307
250
|
|
|
308
|
-
[`docs/api.md`](docs/api.md) — every export, organised by
|
|
309
|
-
domain, with typed signatures and short notes. Kept in sync with
|
|
310
|
-
the code by a check-time drift gate. Agents may prefer the
|
|
311
|
-
shipped `dist/*.d.ts`, which carry the full JSDoc per module.
|
|
251
|
+
[`docs/api.md`](docs/api.md) — every export, organised by domain, with typed signatures and short notes. Kept in sync with the code by a check-time drift gate. Agents may prefer the shipped `dist/*.d.ts`, which carry the full JSDoc per module.
|
|
312
252
|
|
|
313
253
|
## Data sources
|
|
314
254
|
|
|
@@ -319,8 +259,7 @@ shipped `dist/*.d.ts`, which carry the full JSDoc per module.
|
|
|
319
259
|
| 2025-26 | England, NI, Wales | [NHS Employers pay scales 2025/26][scales-2526] |
|
|
320
260
|
| 2026-27 | England, NI | [NHS Employers pay scales 2026/27][scales-2627] |
|
|
321
261
|
|
|
322
|
-
Cross-checked against [NHSPRB 39th Report (2026)][nhsprb-39],
|
|
323
|
-
Table A25 (AfC 2025/26 data for England, NI, Wales).
|
|
262
|
+
Cross-checked against [NHSPRB 39th Report (2026)][nhsprb-39], Table A25 (AfC 2025/26 data for England, NI, Wales).
|
|
324
263
|
|
|
325
264
|
[scales-2526]: https://www.nhsemployers.org/articles/pay-scales-202526
|
|
326
265
|
[scales-2627]: https://www.nhsemployers.org/articles/pay-scales-202627
|
|
@@ -340,7 +279,7 @@ Table A25 (AfC 2025/26 data for England, NI, Wales).
|
|
|
340
279
|
| Permitted maximum (lowest of three limbs) | [Sch 29 Finance Act 2004 para 2][sch29] |
|
|
341
280
|
| Applicable amount, defined benefits, `(A + (B × C)) / 4` | [Sch 29 Finance Act 2004 para 2C][sch29p2c] |
|
|
342
281
|
| Relevant valuation factor (20) | [Finance Act 2004 s.276][s276] |
|
|
343
|
-
| Lump Sum Allowance (
|
|
282
|
+
| Lump Sum Allowance (`LUMP_SUM_ALLOWANCE`, frozen) | [ITEPA 2003 s.637P][s637p] |
|
|
344
283
|
|
|
345
284
|
[sis]: https://www.legislation.gov.uk/secondary/public+service+pensions
|
|
346
285
|
[sch29]: https://www.legislation.gov.uk/ukpga/2004/12/schedule/29
|
|
@@ -348,99 +287,37 @@ Table A25 (AfC 2025/26 data for England, NI, Wales).
|
|
|
348
287
|
[s276]: https://www.legislation.gov.uk/ukpga/2004/12/section/276
|
|
349
288
|
[s637p]: https://www.legislation.gov.uk/ukpga/2003/1/part/9/chapter/15A
|
|
350
289
|
|
|
351
|
-
Reconciled line by line against a real **Annual Benefit
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
[
|
|
358
|
-
links themselves in the header of
|
|
359
|
-
[`tests/golden-abs.test.ts`](tests/golden-abs.test.ts) — beside
|
|
360
|
-
the assertions they justify, which is where a citation belongs
|
|
361
|
-
and where it cannot drift from what it is citing.
|
|
362
|
-
|
|
363
|
-
The statement is the source of truth and the library never
|
|
364
|
-
restates it: enter its figure and ask for its own date, and you
|
|
365
|
-
are handed back exactly what it says. See
|
|
366
|
-
[*Two rulers, one model*](docs/how-it-works.md#two-rulers-one-model)
|
|
367
|
-
for how cash and today's money are produced, and
|
|
368
|
-
[*Which series applies a published Order*](docs/how-it-works.md#which-series-applies-a-published-order)
|
|
369
|
-
for when a legislated rate is applied and why today's money
|
|
370
|
-
never takes one.
|
|
371
|
-
|
|
372
|
-
That promise is exact for a statement handed over **with its
|
|
373
|
-
date**. Passing the figure undated instead asks a different
|
|
374
|
-
question — "this is my balance today" — and the library must
|
|
375
|
-
then work backwards to the year end, at its own revaluation rule
|
|
376
|
-
rather than the scheme's. For a member who left at a year end
|
|
377
|
-
the two differ; see
|
|
378
|
-
[*Reading a statement back applies the SAME rule*](docs/how-it-works.md#reading-a-statement-back-applies-the-same-rule)
|
|
379
|
-
for the size of it and why passing the date avoids it.
|
|
290
|
+
Reconciled line by line against a real **Annual Benefit Statement** (2015 Section, updated to 31/03/2025, name and membership number redacted), and against a ten-year projection built by hand from it.
|
|
291
|
+
|
|
292
|
+
Both are archived and inventoried in [`docs/source-archive.md`](docs/source-archive.md), with the links themselves in the header of [`tests/golden-abs.test.ts`](tests/golden-abs.test.ts) — beside the assertions they justify, which is where a citation belongs and where it cannot drift from what it is citing.
|
|
293
|
+
|
|
294
|
+
The statement is the source of truth and the library never restates it: enter its figure and ask for its own date, and you are handed back exactly what it says. See [*Two rulers, one model*](docs/how-it-works.md#two-rulers-one-model) for how cash and today's money are produced, and [*Which series applies a published Order*](docs/how-it-works.md#which-series-applies-a-published-order) for when a legislated rate is applied and why today's money never takes one.
|
|
295
|
+
|
|
296
|
+
That promise is exact for a statement handed over **with its date**. Passing the figure undated instead asks a different question — "this is my balance today" — and the library must then work backwards to the year end, at its own revaluation rule rather than the scheme's. For a member who left at a year end the two differ; see [*Reading a statement back applies the SAME rule*](docs/how-it-works.md#reading-a-statement-back-applies-the-same-rule) for the size of it and why passing the date avoids it.
|
|
380
297
|
|
|
381
298
|
### Scotland
|
|
382
299
|
|
|
383
|
-
Scotland negotiates its own AfC award independently and
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
has 2 points (vs 1 in England) and Bands 8a–9 have 2
|
|
389
|
-
points each (vs 3).
|
|
390
|
-
|
|
391
|
-
Source: [PCS(AFC)2026/1][scot-circular] — Scottish Health
|
|
392
|
-
Workforce Directorate circular (23 Jan 2026). Annex B holds
|
|
393
|
-
both years' rate tables; Annex C sets them out increment by
|
|
394
|
-
increment and corroborates Annex B point for point.
|
|
395
|
-
|
|
396
|
-
Scotland's 2025-26 settlement was 4.25%, but carried an
|
|
397
|
-
inflation guarantee — at least one percentage point above
|
|
398
|
-
average CPI for the calendar year of the uplift. 2025 CPI
|
|
399
|
-
confirmed at 3.4%, so the guarantee triggered and the rate
|
|
400
|
-
was revised to 4.4%, backdated to 1 April 2025 with arrears.
|
|
401
|
-
2026-27's 3.75% then applies to the revised base, so both
|
|
402
|
-
years moved. Take both from Annex B rather than the MSG
|
|
403
|
-
consolidated table, which still prints the original 4.25%
|
|
404
|
-
rates.
|
|
300
|
+
Scotland negotiates its own AfC award independently and has completely different base salaries from England. Separate scale tables are stored for each tax year — `getAfcScales(year, 'scotland')` returns Scotland figures directly. Scotland also has structural differences: Band 2 has 2 points (vs 1 in England) and Bands 8a–9 have 2 points each (vs 3).
|
|
301
|
+
|
|
302
|
+
Source: [PCS(AFC)2026/1][scot-circular] — Scottish Health Workforce Directorate circular (23 Jan 2026). Annex B holds both years' rate tables; Annex C sets them out increment by increment and corroborates Annex B point for point.
|
|
303
|
+
|
|
304
|
+
Scotland's 2025-26 settlement was 4.25%, but carried an inflation guarantee — at least one percentage point above average CPI for the calendar year of the uplift. 2025 CPI confirmed at 3.4%, so the guarantee triggered and the rate was revised to 4.4%, backdated to 1 April 2025 with arrears. 2026-27's 3.75% then applies to the revised base, so both years moved. Take both from Annex B rather than the MSG consolidated table, which still prints the original 4.25% rates.
|
|
405
305
|
|
|
406
306
|
[scot-circular]: https://www.publications.scot.nhs.uk/files/pcs2026-afc-01.pdf
|
|
407
307
|
|
|
408
308
|
### Wales
|
|
409
309
|
|
|
410
|
-
Wales runs its own pay ladder and both years are transcribed
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
Point labels come from each circular's own "years until
|
|
422
|
-
eligible for pay progression" column, so they are stated by
|
|
423
|
-
the Welsh source rather than borrowed from England's table,
|
|
424
|
-
and they do not always agree with England's for the same band.
|
|
425
|
-
|
|
426
|
-
The living-wage floor is real but separate: it is an advance
|
|
427
|
-
payment that lifts the lowest points, which is why the 2026/27
|
|
428
|
-
uplift explicitly does not apply to them. `WALES_LIVING_WAGE`
|
|
429
|
-
carries both published figures — the annual floor and the hourly
|
|
430
|
-
rate it is set against — for reference; nothing derives a scale
|
|
431
|
-
from it, and neither figure derives from the other.
|
|
432
|
-
Source: [AfC(W) 01/2026][wales-lw] (6 Jan 2026).
|
|
433
|
-
|
|
434
|
-
Band 1 is published in both years (£24,833, then £26,300) and
|
|
435
|
-
closed to new entrants. It is absent from `AFC_BANDS`, the same
|
|
436
|
-
gap Scotland has.
|
|
437
|
-
|
|
438
|
-
Both Welsh years were transcribed during an outage of the NHS Wales
|
|
439
|
-
web estate (2 September 2026), so the circulars were read from NHS
|
|
440
|
-
Wales Employers' copy rather than the publisher's own. Each file was
|
|
441
|
-
checked byte-for-byte against a copy downloaded from `www.nhs.wales`
|
|
442
|
-
the previous day, before the outage, and both matched. The links
|
|
443
|
-
above are the publisher's, which is where these documents live.
|
|
310
|
+
Wales runs its own pay ladder and both years are transcribed from it: [AfC(W) 02/2025][wales-2025] (29 May 2025) and [AfC(W) 02/2026][wales-2026] (12 Feb 2026), Annex 1 of each.
|
|
311
|
+
|
|
312
|
+
Wales is **not** England's table with a floor applied. The two ladders differ at every band from 4 upward, where no floor reaches: Band 9 tops out at £131,732 in Wales against £129,783 in England. A floor lifts the bottom of a ladder and cannot raise its top. Wales also carries two Band 2 points where England has one.
|
|
313
|
+
|
|
314
|
+
Point labels come from each circular's own "years until eligible for pay progression" column, so they are stated by the Welsh source rather than borrowed from England's table, and they do not always agree with England's for the same band.
|
|
315
|
+
|
|
316
|
+
The living-wage floor is real but separate: it is an advance payment that lifts the lowest points, which is why the 2026/27 uplift explicitly does not apply to them. `WALES_LIVING_WAGE` carries both published figures — the annual floor and the hourly rate it is set against — for reference; nothing derives a scale from it, and neither figure derives from the other. Source: [AfC(W) 01/2026][wales-lw] (6 Jan 2026).
|
|
317
|
+
|
|
318
|
+
Band 1 is published in both years (£24,833, then £26,300) and closed to new entrants. It is absent from `AFC_BANDS`, the same gap Scotland has.
|
|
319
|
+
|
|
320
|
+
Both Welsh years were transcribed during an outage of the NHS Wales web estate (2 September 2026), so the circulars were read from NHS Wales Employers' copy rather than the publisher's own. Each file was checked byte-for-byte against a copy downloaded from `www.nhs.wales` the previous day, before the outage, and both matched. The links above are the publisher's, which is where these documents live.
|
|
444
321
|
|
|
445
322
|
[wales-2025]: https://www.nhs.wales/files/pc-resources/afc-w-02-2025-pdf-2-pdf/
|
|
446
323
|
[wales-2026]: https://www.nhs.wales/files/pc-resources/afc-w-02-2026-pdf-pdf/
|
|
@@ -460,10 +337,7 @@ above are the publisher's, which is where these documents live.
|
|
|
460
337
|
|
|
461
338
|
## Medical & dental pay scales
|
|
462
339
|
|
|
463
|
-
Doctors and dentists are paid on a separate set of pay circulars —
|
|
464
|
-
one per nation — from Agenda for Change. This library encodes them
|
|
465
|
-
so it can render **take-home** (not just gross) for medical and
|
|
466
|
-
dental grades, which is what most published sources omit.
|
|
340
|
+
Doctors and dentists are paid on a separate set of pay circulars — one per nation — from Agenda for Change. This library encodes them so it can render **take-home** (not just gross) for medical and dental grades, which is what most published sources omit.
|
|
467
341
|
|
|
468
342
|
| Nation | Circular | Year | Source |
|
|
469
343
|
| ------ | -------- | ---- | ------ |
|
|
@@ -480,78 +354,33 @@ dental grades, which is what most published sources omit.
|
|
|
480
354
|
[md-wal]: https://www.nhs.wales/hpb/nhs-pay-and-conditions/
|
|
481
355
|
[md-ni]: https://www.health-ni.gov.uk/publications/hsc-tc8-052025
|
|
482
356
|
|
|
483
|
-
Wales's 2026/27 round is a 3.5% uplift (3.75% for salaried
|
|
484
|
-
dentists) and removes the closed Associate Specialist (MC01)
|
|
485
|
-
code, so that grade resolves only at 2025/26.
|
|
357
|
+
Wales's 2026/27 round is a 3.5% uplift (3.75% for salaried dentists) and removes the closed Associate Specialist (MC01) code, so that grade resolves only at 2025/26.
|
|
486
358
|
|
|
487
|
-
NI 2025/26 pension member tiers (HSC — distinct thresholds *and*
|
|
488
|
-
rates from NHSBSA) are sourced from [HSC Pensions][hsc-pension].
|
|
359
|
+
NI 2025/26 pension member tiers (HSC — distinct thresholds *and* rates from NHSBSA) are sourced from [HSC Pensions][hsc-pension].
|
|
489
360
|
|
|
490
361
|
[hsc-pension]: https://hscpensions.hscni.net/
|
|
491
362
|
|
|
492
363
|
### How the data is modelled
|
|
493
364
|
|
|
494
|
-
The circulars vary widely in structure (nodal training points,
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
transcribed or **recorded with a reason** for skipping it, so
|
|
504
|
-
nothing is silently dropped and each file diffs against the PDF
|
|
505
|
-
top-to-bottom.
|
|
506
|
-
2. **Translation layer** (`src/medical-scales.ts`,
|
|
507
|
-
`src/dental-scales.ts`) — selects which scales feed the
|
|
508
|
-
calculator and maps each verbatim row to a canonical scale point.
|
|
509
|
-
Inclusive by default: closed-to-new-entrant grades, devolved
|
|
510
|
-
training variants, GP registrars and the Community Dental Service
|
|
511
|
-
are all wired.
|
|
512
|
-
3. **Canonical domain** (`getMedicalScales` / `getDentalScales` +
|
|
513
|
-
`medicalResolver` / `dentalResolver`) — a uniform
|
|
514
|
-
`(grade, nation, year) → scale points` view, identical in shape
|
|
515
|
-
to the AfC resolver.
|
|
516
|
-
|
|
517
|
-
**Scope.** *(a)* every basic-pay salary scale, including
|
|
518
|
-
closed-to-new-entrant grades still paid to incumbents, plus *(b)*
|
|
519
|
-
earnings-affecting supplements expressed as an annual £ (Clinical
|
|
520
|
-
Impact / Excellence awards, DPH and intensity supplements). Pure
|
|
521
|
-
expense tables (mileage, fees) and self-employed GDS/UDA dentist
|
|
522
|
-
contract income are out of scope.
|
|
523
|
-
|
|
524
|
-
**Unpublished data fails loud.** England and Wales publish complete
|
|
525
|
-
2026/27 rounds. Scotland's 2026/27 circular uplifts training grades
|
|
526
|
-
only, so its consultant / SAS / GP / dental scales resolve to the
|
|
527
|
-
complete 2025/26 round (PCS(DD)2025/01) until the Scottish
|
|
528
|
-
Government publishes the non-training uplift; Northern Ireland's
|
|
529
|
-
latest circular is 2025/26 throughout. Each grade resolves at its
|
|
530
|
-
own cited year and `latestYearFor(grade, nation)` reports it —
|
|
531
|
-
figures are never silently carried forward, and a query for an
|
|
532
|
-
unpublished (year, nation) throws rather than defaulting to another
|
|
533
|
-
nation's or year's figures.
|
|
365
|
+
The circulars vary widely in structure (nodal training points, consultant thresholds, SAS experience bands, GP ranges, dental spines), so the data is built in three layers that decouple transcription fidelity from the uniform domain model:
|
|
366
|
+
|
|
367
|
+
1. **Verbatim circular** (`src/circulars/*.ts`) — one file per PDF, each table transcribed 1:1 in source order with a row shape that mirrors that table's own columns, under a comment citing the Annex / section / page. Every table in the circular is either transcribed or **recorded with a reason** for skipping it, so nothing is silently dropped and each file diffs against the PDF top-to-bottom.
|
|
368
|
+
2. **Translation layer** (`src/medical-scales.ts`, `src/dental-scales.ts`) — selects which scales feed the calculator and maps each verbatim row to a canonical scale point. Inclusive by default: closed-to-new-entrant grades, devolved training variants, GP registrars and the Community Dental Service are all wired.
|
|
369
|
+
3. **Canonical domain** (`getMedicalScales` / `getDentalScales` + `medicalResolver` / `dentalResolver`) — a uniform `(grade, nation, year) → scale points` view, identical in shape to the AfC resolver.
|
|
370
|
+
|
|
371
|
+
**Scope.** *(a)* every basic-pay salary scale, including closed-to-new-entrant grades still paid to incumbents, plus *(b)* earnings-affecting supplements expressed as an annual £ (Clinical Impact / Excellence awards, DPH and intensity supplements). Pure expense tables (mileage, fees) and self-employed GDS/UDA dentist contract income are out of scope.
|
|
372
|
+
|
|
373
|
+
**Unpublished data fails loud.** England and Wales publish complete 2026/27 rounds. Scotland's 2026/27 circular uplifts training grades only, so its consultant / SAS / GP / dental scales resolve to the complete 2025/26 round (PCS(DD)2025/01) until the Scottish Government publishes the non-training uplift; Northern Ireland's latest circular is 2025/26 throughout. Each grade resolves at its own cited year and `latestYearFor(grade, nation)` reports it — figures are never silently carried forward, and a query for an unpublished (year, nation) throws rather than defaulting to another nation's or year's figures.
|
|
534
374
|
|
|
535
375
|
## Test fixtures
|
|
536
376
|
|
|
537
|
-
`tests/working-week.test.ts` pins the AfC week and its 365/7 year
|
|
538
|
-
|
|
539
|
-
the
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
part-time (0.6 FTE). Gross figures are derived from
|
|
545
|
-
`getAfcScales(year, nation)` using the sources above.
|
|
546
|
-
Pension, tax, NI and net values are computed by
|
|
547
|
-
`nhsTakeHome` and should be cross-checked against:
|
|
548
|
-
|
|
549
|
-
- [NHS Employers pay scales 2025/26][scales-2526] and
|
|
550
|
-
[2026/27][scales-2627] for England/NI gross
|
|
551
|
-
- [PCS(AFC)2026/1][scot-circular] Annex B for Scotland
|
|
552
|
-
gross
|
|
553
|
-
- [NHSBSA pension contribution rates 2025/26][pension-2526]
|
|
554
|
-
for pension tier rates
|
|
377
|
+
`tests/working-week.test.ts` pins the AfC week and its 365/7 year against every hourly rate Scotland's circular prints beside a salary, and the Welsh living-wage pair.
|
|
378
|
+
|
|
379
|
+
`tests/fixtures/band-take-home.csv` — golden-value rows covering bands 5, 7, 8a across all 4 nations (England, Scotland, Wales, NI), both tax years, 3 HCAS zones, and part-time (0.6 FTE). Gross figures are derived from `getAfcScales(year, nation)` using the sources above. Pension, tax, NI and net values are computed by `nhsTakeHome` and should be cross-checked against:
|
|
380
|
+
|
|
381
|
+
- [NHS Employers pay scales 2025/26][scales-2526] and [2026/27][scales-2627] for England/NI gross
|
|
382
|
+
- [PCS(AFC)2026/1][scot-circular] Annex B for Scotland gross
|
|
383
|
+
- [NHSBSA pension contribution rates 2025/26][pension-2526] for pension tier rates
|
|
555
384
|
|
|
556
385
|
## Tax years
|
|
557
386
|
|
|
@@ -564,10 +393,7 @@ AfC scale + pension coverage (all four nations):
|
|
|
564
393
|
| 2025-26 | Yes | Yes |
|
|
565
394
|
| 2026-27 | Yes | Yes |
|
|
566
395
|
|
|
567
|
-
Medical & dental coverage is per-nation (England/Wales 2026/27;
|
|
568
|
-
Scotland 2026/27 for training grades and 2025/26 for the rest;
|
|
569
|
-
NI 2025/26) — see
|
|
570
|
-
[Medical & dental pay scales](#medical--dental-pay-scales).
|
|
396
|
+
Medical & dental coverage is per-nation (England/Wales 2026/27; Scotland 2026/27 for training grades and 2025/26 for the rest; NI 2025/26) — see [Medical & dental pay scales](#medical--dental-pay-scales).
|
|
571
397
|
|
|
572
398
|
## Development
|
|
573
399
|
|
|
@@ -581,13 +407,6 @@ npm run test:watch # vitest watch mode
|
|
|
581
407
|
|
|
582
408
|
## License
|
|
583
409
|
|
|
584
|
-
AGPL-3.0-only — see [LICENSE](LICENSE).
|
|
585
|
-
Copyright © 2026 Casomo Ltd.
|
|
410
|
+
AGPL-3.0-only — see [LICENSE](LICENSE). Copyright © 2026 Casomo Ltd.
|
|
586
411
|
|
|
587
|
-
There is no linking exception: combine this library with your
|
|
588
|
-
own code and the combined work is AGPL too, and letting people
|
|
589
|
-
use that work over a network obliges you to offer them its
|
|
590
|
-
source. Charging money is not what triggers this, and not
|
|
591
|
-
charging is no exemption. A commercial licence is available for
|
|
592
|
-
use that needs to stay closed — enquire via
|
|
593
|
-
[casomoltd.com](https://casomoltd.com).
|
|
412
|
+
There is no linking exception: combine this library with your own code and the combined work is AGPL too, and letting people use that work over a network obliges you to offer them its source. Charging money is not what triggers this, and not charging is no exemption. A commercial licence is available for use that needs to stay closed — enquire via [casomoltd.com](https://casomoltd.com).
|
package/dist/bands.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { PayYear, Nation } from '@casomoltd/paye-calc';
|
|
11
11
|
import type { AfcBandId, HcasZones } from './scales.js';
|
|
12
|
-
import type { SteppedPoint } from './scale-point.js';
|
|
12
|
+
import type { PayLadder, SteppedPoint } from './scale-point.js';
|
|
13
13
|
import type { DocumentSource } from './document-source.js';
|
|
14
14
|
import type { SalaryRange } from './values.js';
|
|
15
15
|
export interface AfcBandMeta {
|
|
@@ -53,3 +53,11 @@ export declare const AFC_PREVIOUS_YEAR: PayYear;
|
|
|
53
53
|
* silently return England figures for every region (the exact bug
|
|
54
54
|
* this signature prevents). */
|
|
55
55
|
export declare function getAfcScales(year: PayYear, nation: Nation): AfcScaleData;
|
|
56
|
+
/**
|
|
57
|
+
* The point labelled `label` on an AfC band, with the band's points, for
|
|
58
|
+
* a pay year and nation, read from {@link getAfcScales}. Throws
|
|
59
|
+
* `ScaleUnavailable` where the year and nation publish no scale or the
|
|
60
|
+
* band has no such point, and `AmbiguousScalePoint` where the label names
|
|
61
|
+
* more than one, so a caller never prices a point it did not ask for.
|
|
62
|
+
*/
|
|
63
|
+
export declare function afcPointOf(year: PayYear, nation: Nation, band: AfcBandId, label: string): PayLadder;
|
package/dist/bands.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { TAX_YEARS } from '@casomoltd/paye-calc';
|
|
11
11
|
import { AFC_BAND_IDS, afcScaleSource, getScalesForYear, } from './scales.js';
|
|
12
|
+
import { AmbiguousScalePoint, ScaleUnavailable } from './errors.js';
|
|
12
13
|
/**
|
|
13
14
|
* The AfC PAY year England, Scotland and Wales are currently on.
|
|
14
15
|
*
|
|
@@ -55,4 +56,23 @@ export function getAfcScales(year, nation) {
|
|
|
55
56
|
hcas: scaleYear.hcas,
|
|
56
57
|
};
|
|
57
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* The point labelled `label` on an AfC band, with the band's points, for
|
|
61
|
+
* a pay year and nation, read from {@link getAfcScales}. Throws
|
|
62
|
+
* `ScaleUnavailable` where the year and nation publish no scale or the
|
|
63
|
+
* band has no such point, and `AmbiguousScalePoint` where the label names
|
|
64
|
+
* more than one, so a caller never prices a point it did not ask for.
|
|
65
|
+
*/
|
|
66
|
+
export function afcPointOf(year, nation, band, label) {
|
|
67
|
+
const found = getAfcScales(year, nation).bands.find((b) => b.band === band);
|
|
68
|
+
const matches = found?.points.filter((p) => p.label === label) ?? [];
|
|
69
|
+
const current = matches.at(0);
|
|
70
|
+
if (found === undefined || current === undefined) {
|
|
71
|
+
throw new ScaleUnavailable(nation, year, band, label);
|
|
72
|
+
}
|
|
73
|
+
if (matches.length > 1) {
|
|
74
|
+
throw new AmbiguousScalePoint(band, label, matches.length);
|
|
75
|
+
}
|
|
76
|
+
return { points: found.points, current };
|
|
77
|
+
}
|
|
58
78
|
//# sourceMappingURL=bands.js.map
|
package/dist/bands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bands.js","sourceRoot":"","sources":["../src/bands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAM/C,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"bands.js","sourceRoot":"","sources":["../src/bands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAM/C,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAC,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,aAAa,CAAC;AA0BlE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAY,SAAS,CAAC,QAAQ,CAAC;AAE5D,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAY,SAAS,CAAC,QAAQ,CAAC;AAE7D;;;;;;;gCAOgC;AAChC,MAAM,UAAU,YAAY,CAC1B,IAAa,EACb,MAAc;IAEd,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE5C,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtC,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CACzB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAChB,CAAC;QACF,OAAO;YACL,IAAI;YACJ,MAAM;YACN,MAAM,EAAE;gBACN,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;gBAC1B,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;aAC3B;YACD,MAAM;SACP,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,KAAK;QACL,IAAI,EAAE,SAAS,CAAC,IAAI;KACrB,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CACxB,IAAa,EACb,MAAc,EACd,IAAe,EACf,KAAa;IAEb,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAC5E,MAAM,OAAO,GAAG,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;IACrE,MAAM,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACjD,MAAM,IAAI,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,EAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAC,CAAC;AACzC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The published document a figure in this library was read from.
|
|
3
3
|
*
|
|
4
|
-
* One record type for any cited document
|
|
5
|
-
*
|
|
4
|
+
* One record type for any dated cited document. The library cites five
|
|
5
|
+
* KINDS (listed in `sources.ts`), three of which are easily confused: the
|
|
6
6
|
* instrument that ENACTED an award, the circular that PUBLISHES a pay
|
|
7
7
|
* scale, and the letter that sets an allowance. They are different
|
|
8
8
|
* documents in every nation — England's 2026-27 medical award was
|
|
@@ -73,11 +73,27 @@ export interface DocumentSourceFields {
|
|
|
73
73
|
* CPI for the calendar year, so a revision was a scheduled
|
|
74
74
|
* contingency with a knowable date — CPI confirms in January — and
|
|
75
75
|
* it duly arrived on 23 January 2026, moving 4.25% to 4.4%. A
|
|
76
|
-
*
|
|
77
|
-
*
|
|
76
|
+
* scheduled revision with no date recorded lapses unseen, and every
|
|
77
|
+
* figure it moves stays wrong until someone happens to look.
|
|
78
78
|
*/
|
|
79
79
|
readonly nextExpectedReason?: string;
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* A publisher's web page that prints no issue date: what it is, and the
|
|
83
|
+
* day it was read. Its own type rather than a {@link DocumentSource},
|
|
84
|
+
* whose `issued` a consumer prints as the date of publication, so an
|
|
85
|
+
* undated page cannot be shown as published on the day it was read.
|
|
86
|
+
*/
|
|
87
|
+
export interface PageSource {
|
|
88
|
+
/** Who publishes it — 'NHSBSA'. */
|
|
89
|
+
readonly issuer: string;
|
|
90
|
+
/** The page's own title, as printed. */
|
|
91
|
+
readonly reference: string;
|
|
92
|
+
/** The page itself, for a consumer to link. */
|
|
93
|
+
readonly url: string;
|
|
94
|
+
/** ISO date the page was read; it prints no date of its own. */
|
|
95
|
+
readonly retrieved: IsoDate;
|
|
96
|
+
}
|
|
81
97
|
/**
|
|
82
98
|
* A document this library cites — not commentary about it. Held on the
|
|
83
99
|
* record so a consumer cites the document rather than keeping its own
|
|
@@ -117,9 +133,12 @@ export declare class DocumentSource {
|
|
|
117
133
|
* Takes `now` rather than reading the clock, and is a method rather
|
|
118
134
|
* than a stored flag, because currency is a question about a moment
|
|
119
135
|
* and not a property of the record. A boolean computed at module
|
|
120
|
-
* load would freeze the answer for the life of the process
|
|
121
|
-
* same shape as the year defect this round exists to fix — and a
|
|
136
|
+
* load would freeze the answer for the life of the process, and a
|
|
122
137
|
* caller could not ask "was this current when the page was built?".
|
|
138
|
+
*
|
|
139
|
+
* `now` is compared as the calendar day it falls on in the reader's
|
|
140
|
+
* own frame, never its UTC day, which is the day before for a local
|
|
141
|
+
* midnight in summer time.
|
|
123
142
|
*/
|
|
124
143
|
currencyAt(now: Date): SourceCurrency;
|
|
125
144
|
}
|
|
@@ -138,4 +157,10 @@ export declare class DocumentSource {
|
|
|
138
157
|
* position is to state the gap: an unchecked citation should not look
|
|
139
158
|
* identical to a fresh one.
|
|
140
159
|
*/
|
|
141
|
-
export
|
|
160
|
+
export declare const SOURCE_CURRENCIES: {
|
|
161
|
+
readonly current: "current";
|
|
162
|
+
readonly lapsed: "lapsed";
|
|
163
|
+
readonly unknown: "unknown";
|
|
164
|
+
};
|
|
165
|
+
/** One of {@link SOURCE_CURRENCIES}. */
|
|
166
|
+
export type SourceCurrency = (typeof SOURCE_CURRENCIES)[keyof typeof SOURCE_CURRENCIES];
|