@casomoltd/nhs-pay 0.15.2 → 0.16.1

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.
Files changed (102) hide show
  1. package/README.md +66 -16
  2. package/dist/afc-band.d.ts +33 -0
  3. package/dist/afc-band.js +33 -0
  4. package/dist/afc-band.js.map +1 -0
  5. package/dist/afc-scales.d.ts +67 -0
  6. package/dist/afc-scales.js +238 -0
  7. package/dist/afc-scales.js.map +1 -0
  8. package/dist/allowances.d.ts +91 -0
  9. package/dist/allowances.js +180 -0
  10. package/dist/allowances.js.map +1 -0
  11. package/dist/award.d.ts +175 -36
  12. package/dist/award.js +370 -47
  13. package/dist/award.js.map +1 -1
  14. package/dist/bands.d.ts +34 -12
  15. package/dist/bands.js +26 -9
  16. package/dist/bands.js.map +1 -1
  17. package/dist/circulars/afc-shapes.d.ts +101 -0
  18. package/dist/circulars/afc-shapes.js +18 -0
  19. package/dist/circulars/afc-shapes.js.map +1 -0
  20. package/dist/circulars/{england-md-1-2026r.d.ts → england-md-1-2026-r2.d.ts} +198 -32
  21. package/dist/circulars/{england-md-1-2026r.js → england-md-1-2026-r2.js} +142 -76
  22. package/dist/circulars/england-md-1-2026-r2.js.map +1 -0
  23. package/dist/circulars/ni-hsc-afc-06-2025.d.ts +63 -0
  24. package/dist/circulars/ni-hsc-afc-06-2025.js +100 -0
  25. package/dist/circulars/ni-hsc-afc-06-2025.js.map +1 -0
  26. package/dist/circulars/ni-hsc-tc8-05-2025.d.ts +1 -1
  27. package/dist/circulars/ni-hsc-tc8-05-2025.js +1 -1
  28. package/dist/circulars/scotland-pcs-afc-2026-01.d.ts +82 -0
  29. package/dist/circulars/scotland-pcs-afc-2026-01.js +208 -0
  30. package/dist/circulars/scotland-pcs-afc-2026-01.js.map +1 -0
  31. package/dist/circulars/scotland-pcs-dd-2025-01.d.ts +1 -1
  32. package/dist/circulars/scotland-pcs-dd-2025-01.js +12 -4
  33. package/dist/circulars/scotland-pcs-dd-2025-01.js.map +1 -1
  34. package/dist/circulars/scotland-pcs-dd-2026-01.d.ts +2 -2
  35. package/dist/circulars/scotland-pcs-dd-2026-01.js +2 -2
  36. package/dist/circulars/scotland-pcs-dd-2026-02.d.ts +79 -0
  37. package/dist/circulars/scotland-pcs-dd-2026-02.js +185 -0
  38. package/dist/circulars/scotland-pcs-dd-2026-02.js.map +1 -0
  39. package/dist/circulars/wales-afc-w-02-2025.d.ts +53 -0
  40. package/dist/circulars/wales-afc-w-02-2025.js +85 -0
  41. package/dist/circulars/wales-afc-w-02-2025.js.map +1 -0
  42. package/dist/circulars/wales-afc-w-02-2026.d.ts +48 -0
  43. package/dist/circulars/wales-afc-w-02-2026.js +91 -0
  44. package/dist/circulars/wales-afc-w-02-2026.js.map +1 -0
  45. package/dist/circulars/wales-mdw-01-2025.d.ts +1 -1
  46. package/dist/circulars/wales-mdw-01-2025.js +1 -1
  47. package/dist/circulars/wales-mdw-01-2026.d.ts +1 -1
  48. package/dist/circulars/wales-mdw-01-2026.js +1 -1
  49. package/dist/dental-scales.d.ts +4 -4
  50. package/dist/dental-scales.js +30 -20
  51. package/dist/dental-scales.js.map +1 -1
  52. package/dist/document-source.d.ts +141 -0
  53. package/dist/document-source.js +80 -0
  54. package/dist/document-source.js.map +1 -0
  55. package/dist/errors.d.ts +31 -5
  56. package/dist/errors.js +32 -2
  57. package/dist/errors.js.map +1 -1
  58. package/dist/format.d.ts +2 -2
  59. package/dist/format.js.map +1 -1
  60. package/dist/gad/erf-2023-06-30.d.ts +1 -1
  61. package/dist/gad/erf-2023-06-30.js +2 -1
  62. package/dist/gad/erf-2023-06-30.js.map +1 -1
  63. package/dist/gad/factor-table.d.ts +2 -1
  64. package/dist/gad/factor-table.js.map +1 -1
  65. package/dist/gad/lrf-2023-06-30.d.ts +1 -1
  66. package/dist/gad/lrf-2023-06-30.js +2 -1
  67. package/dist/gad/lrf-2023-06-30.js.map +1 -1
  68. package/dist/hcas.d.ts +10 -14
  69. package/dist/hcas.js +13 -20
  70. package/dist/hcas.js.map +1 -1
  71. package/dist/index.d.ts +17 -9
  72. package/dist/index.js +17 -8
  73. package/dist/index.js.map +1 -1
  74. package/dist/iso-date.d.ts +87 -0
  75. package/dist/iso-date.js +97 -0
  76. package/dist/iso-date.js.map +1 -0
  77. package/dist/medical-scales.d.ts +19 -4
  78. package/dist/medical-scales.js +77 -20
  79. package/dist/medical-scales.js.map +1 -1
  80. package/dist/pension.d.ts +30 -0
  81. package/dist/pension.js +128 -8
  82. package/dist/pension.js.map +1 -1
  83. package/dist/post.d.ts +87 -2
  84. package/dist/post.js +112 -2
  85. package/dist/post.js.map +1 -1
  86. package/dist/regions.d.ts +1 -1
  87. package/dist/regions.js +1 -1
  88. package/dist/resolver.d.ts +57 -7
  89. package/dist/resolver.js +77 -25
  90. package/dist/resolver.js.map +1 -1
  91. package/dist/scale-point.d.ts +13 -4
  92. package/dist/scale-tables.d.ts +57 -10
  93. package/dist/scale-tables.js +58 -9
  94. package/dist/scale-tables.js.map +1 -1
  95. package/dist/scales.d.ts +169 -44
  96. package/dist/scales.js +462 -226
  97. package/dist/scales.js.map +1 -1
  98. package/dist/sources.d.ts +183 -0
  99. package/dist/sources.js +375 -0
  100. package/dist/sources.js.map +1 -0
  101. package/package.json +6 -4
  102. package/dist/circulars/england-md-1-2026r.js.map +0 -1
package/dist/pension.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * tests/fixtures/pension-tiers.csv; employer rates carry their
10
10
  * own `EmployerPensionRate.source` per nation.
11
11
  */
12
- import { NATION_KEYS, TAX_YEARS } from '@casomoltd/paye-calc';
12
+ import { NATION_KEYS, TAX_YEARS, taxYear, } from '@casomoltd/paye-calc';
13
13
  import { PensionTiersUnavailable } from './errors.js';
14
14
  // England and Wales share the NHSBSA-administered scheme, so they
15
15
  // share one rate; Scotland (SPPA) and NI (HSC) run their own.
@@ -21,7 +21,7 @@ import { PensionTiersUnavailable } from './errors.js';
21
21
  const NHSBSA_EMPLOYER_RATE = {
22
22
  rate: 0.237,
23
23
  adminLevy: 0.0008,
24
- effectiveFrom: TAX_YEARS.Y2024_25,
24
+ effectiveFrom: taxYear(TAX_YEARS.Y2024_25),
25
25
  administrator: 'NHSBSA',
26
26
  source: 'https://www.nhsemployers.org/articles/nhs-pension-scheme-employer-contributions',
27
27
  };
@@ -31,14 +31,14 @@ const EMPLOYER_PENSION_RATES = {
31
31
  scotland: {
32
32
  rate: 0.225,
33
33
  adminLevy: 0,
34
- effectiveFrom: TAX_YEARS.Y2024_25,
34
+ effectiveFrom: taxYear(TAX_YEARS.Y2024_25),
35
35
  administrator: 'SPPA',
36
36
  source: 'https://pensions.gov.scot/nhs/employers/employer-contributions',
37
37
  },
38
38
  'northern-ireland': {
39
39
  rate: 0.232,
40
40
  adminLevy: 0,
41
- effectiveFrom: TAX_YEARS.Y2024_25,
41
+ effectiveFrom: taxYear(TAX_YEARS.Y2024_25),
42
42
  administrator: 'HSC Pension Service',
43
43
  // The page that states the 23.2% figure ("Your employer
44
44
  // contributes an amount equal to 23.2% of your pensionable
@@ -117,8 +117,11 @@ const NATION_TO_SCHEME = {
117
117
  // named as in docs/source-archive.md:
118
118
  // 2025/26 "NHSBSA — contribution rates 2025/26"
119
119
  // 2026/27 "NHSBSA — cost of being in the Scheme"
120
- // Six tiers; rates unchanged year-on-year, thresholds re-based to the
121
- // AfC award. Pinned in tests/fixtures/pension-tiers.csv.
120
+ // Six tiers; rates unchanged year-on-year. Thresholds are re-based
121
+ // to CPI, NOT to the AfC award — NHSBSA states this explicitly for
122
+ // 2026/27, where the England award came in below CPI. (SPPA is the
123
+ // scheme that re-bases on its nation's award; see below.)
124
+ // Pinned in tests/fixtures/pension-tiers.csv.
122
125
  const NHSBSA_2025_26 = [
123
126
  { tier: 1, min: 0, max: 13259, rate: 0.052 },
124
127
  { tier: 2, min: 13260, max: 27797, rate: 0.065 },
@@ -143,6 +146,54 @@ const NHSBSA_2026_27 = [
143
146
  // 2025/26: "SPPA, NHS Circular 2025/07" (3 Jul 2025), Table 2
144
147
  // 2026/27: "SPPA, NHS Circular 2026/03" (9 Mar 2026), Table 2
145
148
  // Both in docs/source-archive.md.
149
+ //
150
+ // "Re-based to the AfC award" is SPPA's own stated mechanism, and it is
151
+ // NOT CPI — the odd one out against NHSBSA and HSC above. Its 2023
152
+ // consultation response committed to uprating the tiers "in line with
153
+ // the average Agenda for Change (AfC) pay award", restated in both
154
+ // circulars. That is why five of the nine floors sit exactly on AfC pay
155
+ // points: the points and the thresholds move by the same percentage, so
156
+ // a threshold anchored to a point stays on it.
157
+ //
158
+ // THREE THINGS A READER OF THIS TABLE SHOULD KNOW.
159
+ //
160
+ // 1. The 2025-26 bands were NOT superseded when the AfC award for that
161
+ // year was revised from 4.25% to 4.4%, and this table is right.
162
+ // Circular 2025/07 was never reissued or withdrawn; its PDF is unchanged
163
+ // since publication and SSI 2015/94 reg 30(3C) — inserted by
164
+ // SSI 2025/259, in force 31 Oct 2025 — still carries this exact
165
+ // 4.25%-based series, with no outstanding effects recorded against
166
+ // it. The revised 2025/26 values exist, but as Table 1 of the
167
+ // FOLLOWING year's circular (2026/03), effective 1 April 2026.
168
+ // The tell is that Table 1 of year N+1 normally equals Table 2 of
169
+ // year N and here it does not; that divergence IS the revision.
170
+ //
171
+ // 2. Both tables here are Table 2. SPPA publishes two per circular —
172
+ // Table 1 assesses on the PREVIOUS year's earnings and covers most
173
+ // members, Table 2 on the current year's and covers new starters
174
+ // and job changers. We model Table 2 only, which is the choice the
175
+ // rest of this file makes for every scheme. For 2025/26 the two
176
+ // genuinely disagree (~£41 at the tier-3 floor) because of the
177
+ // revision above — the only year the identity breaks. No rendered
178
+ // figure is affected: all 25 revised Scottish pay points were
179
+ // checked and none lands in a different tier.
180
+ //
181
+ // 3. WHY two tables exist at all, and what it implies for every figure
182
+ // in this file. An AfC award takes effect on 1 April but reaches
183
+ // payroll months later, so a member's actual earnings in an award
184
+ // year are not the annual scale figure: old-rate months, then a
185
+ // lump of arrears. Backdating makes the annual GROSS whole and
186
+ // still leaves the monthly pattern nothing like scale ÷ 12. That
187
+ // gap is precisely why SPPA needs one table assessed on the
188
+ // PREVIOUS year's earnings beside one assessed on the current
189
+ // year's — the scale and what a member was actually paid are
190
+ // different quantities, and the scheme has to say which it means.
191
+ //
192
+ // This library models the SCALE. A tier here answers "what would
193
+ // this salary contribute", never "what did this member pay in a
194
+ // year when the uplift landed in September". A consumer stating an
195
+ // annual figure is stating the scale, and should not imply it is
196
+ // what reached a bank account.
146
197
  const SPPA_2025_26 = [
147
198
  { tier: 1, min: 0, max: 13330, rate: 0.057 },
148
199
  { tier: 2, min: 13331, max: 27899, rate: 0.064 },
@@ -168,7 +219,8 @@ const SPPA_2026_27 = [
168
219
  // HSC (Northern Ireland). Source: "HSC Pensions NI — member
169
220
  // contributions" — see docs/source-archive.md.
170
221
  // Six tiers; rates higher than NHSBSA in tiers 2-6. HSC sets its own
171
- // thresholds AND rates — the 2025/26 bands differ from NHSBSA 2025/26.
222
+ // thresholds AND rates — the 2025/26 bands differ from NHSBSA
223
+ // 2025/26 — and re-bases them to CPI, as NHSBSA does.
172
224
  const HSC_2025_26 = [
173
225
  { tier: 1, min: 0, max: 13259, rate: 0.052 },
174
226
  { tier: 2, min: 13260, max: 27288, rate: 0.067 },
@@ -199,6 +251,73 @@ const PENSION_TIERS_BY_SCHEME = {
199
251
  [TAX_YEARS.Y2026_27]: HSC_2026_27,
200
252
  },
201
253
  };
254
+ const NHSBSA_MEMBER_RATES = 'https://www.nhsbsa.nhs.uk/member-hub/cost-being-scheme';
255
+ // HSC keeps only the CURRENT year's table on its standing page
256
+ // and moves the prior year to a sub-page, so the two years cite
257
+ // different URLs — a single link would stop stating the figure
258
+ // it is cited for the moment the year rolls.
259
+ const HSC_MEMBER_RATES_2026_27 = 'https://hscpensions.hscni.net/hsc-pension-scheme'
260
+ + '/hsc-pension-members-section/membership-contributions-pay/';
261
+ // Written out, not derived from the line above: repointing the
262
+ // standing page at a later year would otherwise silently drag this
263
+ // one with it. The slug reads "23-24" because HSC files each
264
+ // superseded table under the year the sub-page was first created,
265
+ // not the year the rates apply to.
266
+ const HSC_MEMBER_RATES_2025_26 = 'https://hscpensions.hscni.net/hsc-pension-scheme'
267
+ + '/hsc-pension-members-section/membership-contributions-pay'
268
+ + '/23-24-contribution-rates/';
269
+ // Per-year member-rate citations, matching the tier tables above.
270
+ // NHSBSA and HSC state every year's tiers on one standing page;
271
+ // SPPA issues a circular per year (see docs/source-archive.md
272
+ // SA-17 / SA-18), so Scotland's citation moves with the year.
273
+ const SCHEME_SOURCES = {
274
+ [PENSION_SCHEMES.nhsbsa]: {
275
+ [TAX_YEARS.Y2025_26]: NHSBSA_MEMBER_RATES,
276
+ [TAX_YEARS.Y2026_27]: NHSBSA_MEMBER_RATES,
277
+ },
278
+ [PENSION_SCHEMES.sppa]: {
279
+ [TAX_YEARS.Y2025_26]: 'https://pensions.gov.scot/sites/default/files/2025-07'
280
+ + '/NHS_Circular_2025-07_Employee_contribution_tiers'
281
+ + '_2025-26.pdf',
282
+ [TAX_YEARS.Y2026_27]: 'https://pensions.gov.scot/sites/default/files/2026-03'
283
+ + '/2026_03_-_NHS_Employee_contribution_tier_bandings'
284
+ + '_from_1_April_2026.pdf',
285
+ },
286
+ [PENSION_SCHEMES.hsc]: {
287
+ [TAX_YEARS.Y2025_26]: HSC_MEMBER_RATES_2025_26,
288
+ [TAX_YEARS.Y2026_27]: HSC_MEMBER_RATES_2026_27,
289
+ },
290
+ };
291
+ const SCHEME_NAMES = {
292
+ [PENSION_SCHEMES.nhsbsa]: {
293
+ name: 'NHS Pension Scheme',
294
+ administrator: 'NHSBSA',
295
+ },
296
+ [PENSION_SCHEMES.sppa]: {
297
+ name: 'NHS Superannuation Scheme (Scotland)',
298
+ administrator: 'Scottish Public Pensions Agency',
299
+ },
300
+ [PENSION_SCHEMES.hsc]: {
301
+ name: 'HSC Pension Scheme',
302
+ administrator: 'HSC Pension Service',
303
+ },
304
+ };
305
+ /**
306
+ * The scheme a nation's NHS staff contribute to for a tax year,
307
+ * with the citation for that year's member tiers. Throws
308
+ * {@link PensionTiersUnavailable} for a year the scheme has not
309
+ * published, so a caller can never render a rate beside a
310
+ * citation that does not cover it.
311
+ */
312
+ export function getPensionScheme(year, nation) {
313
+ const scheme = NATION_TO_SCHEME[nation];
314
+ const key = year;
315
+ const source = SCHEME_SOURCES[scheme][key];
316
+ if (!source) {
317
+ throw new PensionTiersUnavailable(year, nation);
318
+ }
319
+ return { ...SCHEME_NAMES[scheme], source };
320
+ }
202
321
  /**
203
322
  * Member pension contribution tiers for a nation and tax year.
204
323
  *
@@ -210,7 +329,8 @@ const PENSION_TIERS_BY_SCHEME = {
210
329
  * or year's figures.
211
330
  */
212
331
  export function getPensionTiers(year, nation) {
213
- const tiers = PENSION_TIERS_BY_SCHEME[NATION_TO_SCHEME[nation]][year];
332
+ const key = year;
333
+ const tiers = PENSION_TIERS_BY_SCHEME[NATION_TO_SCHEME[nation]][key];
214
334
  if (!tiers) {
215
335
  throw new PensionTiersUnavailable(year, nation);
216
336
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pension.js","sourceRoot":"","sources":["../src/pension.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAC,uBAAuB,EAAC,MAAM,aAAa,CAAC;AAiCpD,kEAAkE;AAClE,8DAA8D;AAC9D,4DAA4D;AAC5D,iEAAiE;AACjE,gEAAgE;AAChE,8DAA8D;AAC9D,6DAA6D;AAC7D,MAAM,oBAAoB,GAAwB;IAChD,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,SAAS,CAAC,QAAQ;IACjC,aAAa,EAAE,QAAQ;IACvB,MAAM,EACJ,iFAAiF;CACpF,CAAC;AAEF,MAAM,sBAAsB,GAGxB;IACF,OAAO,EAAE,oBAAoB;IAC7B,KAAK,EAAE,oBAAo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I,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,EAAC,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,EAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAa,EACb,MAAc;IAEd,MAAM,GAAG,GAAc,IAAI,CAAC;IAC5B,MAAM,KAAK,GACT,uBAAuB,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAa,EACb,MAAc;IAEd,OAAO,IAAI,YAAY,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AACzD,CAAC"}
package/dist/post.d.ts CHANGED
@@ -10,12 +10,41 @@
10
10
  * a value by building a new one (see {@link Post.withSalary},
11
11
  * {@link Post.withAdjustments}).
12
12
  */
13
- import type { Nation, TaxYear, TakeHomePay, StudentLoanPlan, TaxCode } from '@casomoltd/paye-calc';
13
+ import type { Nation, PayYear, TaxYear, TakeHomePay, StudentLoanPlan, TaxCode } from '@casomoltd/paye-calc';
14
14
  import type { Role } from './role.js';
15
+ import type { DocumentSource } from './document-source.js';
16
+ import type { PayAward } from './award.js';
15
17
  /** The tax/NI/pension context that fixes a Post. */
16
18
  export interface PostIdentity {
17
19
  readonly nation: Nation;
20
+ /**
21
+ * The year whose tax, NI and pension-tier thresholds apply.
22
+ *
23
+ * The year the money is PAID IN, which is not always the year the
24
+ * salary was published in — see {@link PostIdentity.payYear}.
25
+ */
18
26
  readonly taxYear: TaxYear;
27
+ /**
28
+ * The year the SALARY was published in, where that differs from
29
+ * {@link PostIdentity.taxYear}. Defaults to `taxYear`.
30
+ *
31
+ * The two are the same whenever a nation's pay round lands inside
32
+ * its own year, which is why one field carried both for so long.
33
+ * They separate the moment a round runs late: Northern Ireland's
34
+ * staff are paid 2025-26 salaries during the 2026-27 tax year, and
35
+ * they contribute at the 2026-27 tier because contribution tiers
36
+ * are set by the SCHEME year, not by which round their salary came
37
+ * from. Collapsing the two overstated the deduction on four of
38
+ * Northern Ireland's pay points, the largest by 1.8 points of
39
+ * salary.
40
+ *
41
+ * REQUIRED. It was optional, falling back to `taxYear`, which
42
+ * meant `post.payYear` could quietly answer with the tax year and
43
+ * the two bases met again inside the accessor that exists to keep
44
+ * them apart. Every construction path already knows both, so the
45
+ * option bought nothing but a place for them to recombine.
46
+ */
47
+ readonly payYear: PayYear;
19
48
  }
20
49
  /**
21
50
  * Personal circumstances layered on a scale post that a bare
@@ -88,7 +117,21 @@ export declare class Post {
88
117
  * Personal circumstances are added afterwards with
89
118
  * {@link Post.withAdjustments}.
90
119
  */
91
- static fromSalary(salary: number, nation: Nation, year: TaxYear, role?: Role): Post;
120
+ static fromSalary(salary: number, nation: Nation,
121
+ /** The year whose SCALE this salary was published on. */
122
+ year: PayYear,
123
+ /**
124
+ * The year whose tax, NI and pension tiers apply.
125
+ *
126
+ * REQUIRED, and ahead of `role` for that reason. It defaulted to
127
+ * the pay year once, and that default is the whole defect: a
128
+ * caller who simply did not think about it got the salary's own
129
+ * year, which priced a Northern Irish reader's 2025-26 pay at
130
+ * 2025-26 deductions in the 2026-27 tax year. A default that is
131
+ * right most of the time is worse than no default, because the
132
+ * times it is wrong are exactly the times nobody is looking.
133
+ */
134
+ taxYear: TaxYear, role?: Role): Post;
92
135
  /**
93
136
  * Pensionable pay: the pay the NHS pension contribution rate/tier
94
137
  * are worked out on. Here = the FTE-pro-rated scale salary less any
@@ -104,11 +147,53 @@ export declare class Post {
104
147
  * cost of being in the Scheme" — see docs/source-archive.md.
105
148
  */
106
149
  get pensionablePay(): number;
150
+ /**
151
+ * The award covering this post, or `undefined` where its nation has
152
+ * announced none for the post's year. Takes no argument: a Post
153
+ * already holds the nation and tax year in its identity and the band
154
+ * or grade in its role, which is every coordinate the lookup needs.
155
+ *
156
+ * This is the award for THIS post's year. The full history — every
157
+ * award that ever touched a scale — is `awardsFor`, which a Post
158
+ * cannot answer because it is pinned to one year. A VSM post has no
159
+ * published scale, so it has no award.
160
+ */
161
+ get award(): PayAward | undefined;
162
+ /**
163
+ * The document that PUBLISHES this post's pay scale — the circular a
164
+ * pay table should cite — or `undefined` for an off-scale post.
165
+ *
166
+ * Deliberately not {@link Post.award}'s source. The award instrument
167
+ * and the scale circular are different documents in every nation:
168
+ * England's 2026-27 medical award was enacted by a written
169
+ * ministerial statement while its salaries are printed in PC(M&D)
170
+ * 1/2026 R2, and Northern Ireland has no medical award record at all
171
+ * while still publishing a table that needs a citation.
172
+ *
173
+ * Takes no argument for the same reason `award` does not — the Post
174
+ * already holds every coordinate the lookup needs.
175
+ *
176
+ * `undefined` means ONE thing: an off-scale post, which has no
177
+ * published scale and therefore no publishing circular. An
178
+ * unpublished nation/year, or a grade missing from a table that IS
179
+ * published, throws {@link ScaleUnavailable} like every other
180
+ * accessor here. Two states behind one `undefined` would leave a
181
+ * caller unable to tell "there is no scale" from "we have not
182
+ * transcribed it".
183
+ */
184
+ get scaleSource(): DocumentSource | undefined;
107
185
  /**
108
186
  * Member contribution rate (%). The tier's single rate applies to
109
187
  * the WHOLE of {@link Post.pensionablePay} (a slab/cliff-edge rate,
110
188
  * not a marginal band); 0 when opted out.
111
189
  */
190
+ /**
191
+ * The year this post's SALARY was published in.
192
+ *
193
+ * Falls back to the tax year, which is right for every post whose
194
+ * pay round landed inside its own year.
195
+ */
196
+ get payYear(): PayYear;
112
197
  get pensionRate(): number;
113
198
  /**
114
199
  * Annual member pension contribution (£) — read from the
package/dist/post.js CHANGED
@@ -13,6 +13,33 @@
13
13
  import { nationToTaxRegion } from '@casomoltd/paye-calc';
14
14
  import { getPensionTiersVO } from './pension.js';
15
15
  import { nhsTakeHome } from './take-home.js';
16
+ import { awardsFor } from './award.js';
17
+ import { afcScaleSource } from './scales.js';
18
+ import { ScaleUnavailable } from './errors.js';
19
+ import { getMedicalScales } from './medical-scales.js';
20
+ import { getDentalScales } from './dental-scales.js';
21
+ /** A grade's source from a published family table, failing loud where
22
+ * the table exists but the grade is not in it — the same contract the
23
+ * AfC branch gets from `afcScaleSource`. */
24
+ function gradeSource(metas, grade, identity) {
25
+ const meta = metas.find((m) => m.grade === grade);
26
+ if (!meta) {
27
+ throw new ScaleUnavailable(identity.nation, identity.payYear, grade);
28
+ }
29
+ return meta.source;
30
+ }
31
+ /** The scale id a role names, or `undefined` for an off-scale post. */
32
+ function scaleOf(role) {
33
+ switch (role.kind) {
34
+ case 'afc':
35
+ return role.band;
36
+ case 'medical':
37
+ case 'dental':
38
+ return role.grade;
39
+ case 'vsm':
40
+ return undefined;
41
+ }
42
+ }
16
43
  /** The identity adjustments: full-time, no sacrifice/loans/override, in-scheme. */
17
44
  export const NO_ADJUSTMENTS = {
18
45
  fte: 1,
@@ -43,8 +70,22 @@ export class Post {
43
70
  * Personal circumstances are added afterwards with
44
71
  * {@link Post.withAdjustments}.
45
72
  */
46
- static fromSalary(salary, nation, year, role = { kind: 'vsm' }) {
47
- return new Post({ nation, taxYear: year }, salary, role);
73
+ static fromSalary(salary, nation,
74
+ /** The year whose SCALE this salary was published on. */
75
+ year,
76
+ /**
77
+ * The year whose tax, NI and pension tiers apply.
78
+ *
79
+ * REQUIRED, and ahead of `role` for that reason. It defaulted to
80
+ * the pay year once, and that default is the whole defect: a
81
+ * caller who simply did not think about it got the salary's own
82
+ * year, which priced a Northern Irish reader's 2025-26 pay at
83
+ * 2025-26 deductions in the 2026-27 tax year. A default that is
84
+ * right most of the time is worse than no default, because the
85
+ * times it is wrong are exactly the times nobody is looking.
86
+ */
87
+ taxYear, role = { kind: 'vsm' }) {
88
+ return new Post({ nation, taxYear, payYear: year }, salary, role);
48
89
  }
49
90
  /**
50
91
  * Pensionable pay: the pay the NHS pension contribution rate/tier
@@ -64,11 +105,80 @@ export class Post {
64
105
  const fteSalary = Math.round(this.salary * this.adjustments.fte);
65
106
  return Math.max(0, fteSalary - this.adjustments.salarySacrifice);
66
107
  }
108
+ /**
109
+ * The award covering this post, or `undefined` where its nation has
110
+ * announced none for the post's year. Takes no argument: a Post
111
+ * already holds the nation and tax year in its identity and the band
112
+ * or grade in its role, which is every coordinate the lookup needs.
113
+ *
114
+ * This is the award for THIS post's year. The full history — every
115
+ * award that ever touched a scale — is `awardsFor`, which a Post
116
+ * cannot answer because it is pinned to one year. A VSM post has no
117
+ * published scale, so it has no award.
118
+ */
119
+ get award() {
120
+ const scale = scaleOf(this.role);
121
+ if (scale === undefined) {
122
+ return undefined;
123
+ }
124
+ return awardsFor(this.identity.nation, scale).find(
125
+ // The award that produced THIS salary, so it follows the pay
126
+ // year: a nation paid last year's rates was moved there by last
127
+ // year's award, whatever tax year it is now.
128
+ (a) => a.year === this.payYear);
129
+ }
130
+ /**
131
+ * The document that PUBLISHES this post's pay scale — the circular a
132
+ * pay table should cite — or `undefined` for an off-scale post.
133
+ *
134
+ * Deliberately not {@link Post.award}'s source. The award instrument
135
+ * and the scale circular are different documents in every nation:
136
+ * England's 2026-27 medical award was enacted by a written
137
+ * ministerial statement while its salaries are printed in PC(M&D)
138
+ * 1/2026 R2, and Northern Ireland has no medical award record at all
139
+ * while still publishing a table that needs a citation.
140
+ *
141
+ * Takes no argument for the same reason `award` does not — the Post
142
+ * already holds every coordinate the lookup needs.
143
+ *
144
+ * `undefined` means ONE thing: an off-scale post, which has no
145
+ * published scale and therefore no publishing circular. An
146
+ * unpublished nation/year, or a grade missing from a table that IS
147
+ * published, throws {@link ScaleUnavailable} like every other
148
+ * accessor here. Two states behind one `undefined` would leave a
149
+ * caller unable to tell "there is no scale" from "we have not
150
+ * transcribed it".
151
+ */
152
+ get scaleSource() {
153
+ const role = this.role;
154
+ switch (role.kind) {
155
+ case 'afc':
156
+ return afcScaleSource(this.payYear, this.identity.nation);
157
+ case 'medical':
158
+ return gradeSource(getMedicalScales(this.payYear, this.identity.nation), role.grade, { nation: this.identity.nation, payYear: this.payYear });
159
+ case 'dental':
160
+ return gradeSource(getDentalScales(this.payYear, this.identity.nation), role.grade, { nation: this.identity.nation, payYear: this.payYear });
161
+ // Listed rather than defaulted: an off-scale post genuinely has
162
+ // no publishing circular, and spelling it out means a new role
163
+ // kind fails the build here instead of silently citing nothing.
164
+ case 'vsm':
165
+ return undefined;
166
+ }
167
+ }
67
168
  /**
68
169
  * Member contribution rate (%). The tier's single rate applies to
69
170
  * the WHOLE of {@link Post.pensionablePay} (a slab/cliff-edge rate,
70
171
  * not a marginal band); 0 when opted out.
71
172
  */
173
+ /**
174
+ * The year this post's SALARY was published in.
175
+ *
176
+ * Falls back to the tax year, which is right for every post whose
177
+ * pay round landed inside its own year.
178
+ */
179
+ get payYear() {
180
+ return this.identity.payYear;
181
+ }
72
182
  get pensionRate() {
73
183
  if (this.adjustments.pensionOptedOut) {
74
184
  return 0;
package/dist/post.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"post.js","sourceRoot":"","sources":["../src/post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAQvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AA8D3C,mFAAmF;AACnF,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC7C,GAAG,EAAE,CAAC;IACN,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,IAAI,GAAG,EAAE;IACvB,OAAO,EAAE,IAAI;IACb,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,OAAO,IAAI;IAEJ;IACA;IACA;IACA;IAJX,YACW,QAAsB,EACtB,MAAc,EACd,IAAU,EACV,cAA+B,cAAc;QAH7C,aAAQ,GAAR,Q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C,CACF,CAAC;IACJ,CAAC;IAED,6BAA6B;IAC7B,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;IACjC,CAAC;IAED,qCAAqC;IACrC,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACzC,CAAC;IAED,0DAA0D;IAC1D,UAAU,CAAC,MAAc;QACvB,OAAO,IAAI,IAAI,CACb,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CACnD,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,KAA+B;QAC7C,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE;YACrD,GAAG,IAAI,CAAC,WAAW;YACnB,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;CACF"}
package/dist/regions.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  * non-England nations, so one param covers both.
7
7
  *
8
8
  * UI-specific concerns (cookies, URL params, selector
9
- * options, zone labels) stay in hub-site.
9
+ * options, zone labels) stay in the consumer.
10
10
  */
11
11
  import type { TaxRegion, Nation } from '@casomoltd/paye-calc';
12
12
  import type { HcasZones } from './scales.js';
package/dist/regions.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * non-England nations, so one param covers both.
7
7
  *
8
8
  * UI-specific concerns (cookies, URL params, selector
9
- * options, zone labels) stay in hub-site.
9
+ * options, zone labels) stay in the consumer.
10
10
  */
11
11
  import { TAX_REGIONS, NATIONS, } from '@casomoltd/paye-calc';
12
12
  // ── Region codes ────────────────────────────────
@@ -9,8 +9,9 @@
9
9
  * the inputs it already holds (band / point / region), so the
10
10
  * Post knows which scale position it came from.
11
11
  */
12
- import type { Nation, TaxYear } from '@casomoltd/paye-calc';
12
+ import type { Nation, PayYear, TaxYear } from '@casomoltd/paye-calc';
13
13
  import type { AfcBandId } from './scales.js';
14
+ import type { ScalePoint } from './scale-point.js';
14
15
  import type { AfcRegionId } from './regions.js';
15
16
  import type { MedicalGradeId } from './medical-scales.js';
16
17
  import type { DentalGradeId } from './dental-scales.js';
@@ -23,11 +24,11 @@ import { Post } from './post.js';
23
24
  * resolver's own interface, not this shared one.
24
25
  */
25
26
  export interface PayScaleResolver<G extends string> {
26
- fromSalary(salary: number, nation: Nation, year: TaxYear): Post;
27
+ fromSalary(salary: number, nation: Nation, year: PayYear, taxYear: TaxYear): Post;
27
28
  /** Grades with a published scale for this nation/year. */
28
- availableGrades(nation: Nation, year: TaxYear): readonly G[];
29
- /** Latest year a grade is published for a nation, or null. */
30
- latestYearFor(gradeId: G, nation: Nation): TaxYear | null;
29
+ availableGrades(nation: Nation, year: PayYear): readonly G[];
30
+ /** Latest PAY year a grade is published for a nation, or null. */
31
+ latestYearFor(gradeId: G, nation: Nation): PayYear | null;
31
32
  }
32
33
  /**
33
34
  * AfC resolver — adds a band + point + region entry. AfC
@@ -36,7 +37,35 @@ export interface PayScaleResolver<G extends string> {
36
37
  * path resolves the HCAS / Wales-floor gross itself.
37
38
  */
38
39
  export interface AfcResolver extends PayScaleResolver<AfcBandId> {
39
- fromScalePoint(band: AfcBandId, pointLabel: string, region: AfcRegionId, year: TaxYear): Post;
40
+ /**
41
+ * Build a Post from a point the caller already holds — the precise
42
+ * accessor, as on {@link NationScaleResolver}.
43
+ *
44
+ * AfC labels are all distinct today, so `fromScalePoint` resolves
45
+ * unambiguously across every nation and year. That is a property of
46
+ * the current data, not a guarantee: Band 2 already carries two
47
+ * points at one salary in all four nations, which is the shape one
48
+ * relabelling away from a repeat. A caller holding the point should
49
+ * not depend on the property.
50
+ */
51
+ fromPoint(band: AfcBandId, point: ScalePoint, region: AfcRegionId,
52
+ /** The year whose SCALE the point was read from. */
53
+ year: PayYear,
54
+ /**
55
+ * The year whose tax, NI and pension tiers apply.
56
+ *
57
+ * REQUIRED, and deliberately not defaulted to `year`. A nation
58
+ * whose pay round runs late pays last year's salary under this
59
+ * year's deductions, and the contribution tier is set by the
60
+ * scheme year, not by the round the salary came from. When this
61
+ * defaulted, every caller that simply did not think about it got
62
+ * the salary's own year — which is how a Northern Irish reader's
63
+ * 2025-26 pay came to be priced at 2025-26 deductions in the
64
+ * 2026-27 tax year. Making it explicit costs one argument and
65
+ * removes the whole class.
66
+ */
67
+ taxYear: TaxYear): Post;
68
+ fromScalePoint(band: AfcBandId, pointLabel: string, region: AfcRegionId, year: PayYear, taxYear: TaxYear): Post;
40
69
  }
41
70
  export declare const afcResolver: AfcResolver;
42
71
  /**
@@ -46,7 +75,28 @@ export declare const afcResolver: AfcResolver;
46
75
  * the `toRole` builder its factory is given.
47
76
  */
48
77
  export interface NationScaleResolver<G extends string> extends PayScaleResolver<G> {
49
- fromScalePoint(grade: G, pointLabel: string, nation: Nation, year: TaxYear): Post;
78
+ /**
79
+ * Build a Post from a point the caller already holds.
80
+ *
81
+ * The precise accessor, and the one to prefer. A LABEL does not
82
+ * identify a point on every scale — England's consultant scale
83
+ * carries six points labelled "Threshold 3", differing only in
84
+ * years of service — so a caller holding the point should hand it
85
+ * over rather than round-trip through a string that may match
86
+ * several and throw.
87
+ */
88
+ fromPoint(grade: G, point: ScalePoint, nation: Nation,
89
+ /** The year whose SCALE the point was read from. */
90
+ year: PayYear,
91
+ /**
92
+ * The year whose tax, NI and pension tiers apply.
93
+ *
94
+ * REQUIRED, for the reason given on {@link AfcResolver.fromPoint}:
95
+ * defaulting it to the salary's own year is silent, and silence
96
+ * is what mispriced a nation whose pay round had run late.
97
+ */
98
+ taxYear: TaxYear): Post;
99
+ fromScalePoint(grade: G, pointLabel: string, nation: Nation, year: PayYear, taxYear: TaxYear): Post;
50
100
  }
51
101
  /** Medical (doctors) resolver — a grade + point + nation entry. */
52
102
  export type MedicalResolver = NationScaleResolver<MedicalGradeId>;