@casomoltd/nhs-pay 0.7.4 → 0.9.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.
Files changed (42) hide show
  1. package/README.md +20 -9
  2. package/dist/circulars/england-md-1-2026r.d.ts +3 -2
  3. package/dist/circulars/england-md-1-2026r.js +3 -2
  4. package/dist/circulars/england-md-1-2026r.js.map +1 -1
  5. package/dist/circulars/ni-hsc-tc8-05-2025.d.ts +2 -2
  6. package/dist/circulars/ni-hsc-tc8-05-2025.js +2 -2
  7. package/dist/circulars/scotland-pcs-dd-2025-01.d.ts +88 -0
  8. package/dist/circulars/scotland-pcs-dd-2025-01.js +241 -0
  9. package/dist/circulars/scotland-pcs-dd-2025-01.js.map +1 -0
  10. package/dist/circulars/wales-mdw-01-2025.d.ts +2 -2
  11. package/dist/circulars/wales-mdw-01-2025.js +2 -2
  12. package/dist/circulars/wales-mdw-01-2026.d.ts +146 -0
  13. package/dist/circulars/wales-mdw-01-2026.js +255 -0
  14. package/dist/circulars/wales-mdw-01-2026.js.map +1 -0
  15. package/dist/dates.d.ts +48 -0
  16. package/dist/dates.js +74 -0
  17. package/dist/dates.js.map +1 -0
  18. package/dist/dental-scales.js +18 -0
  19. package/dist/dental-scales.js.map +1 -1
  20. package/dist/errors.d.ts +18 -0
  21. package/dist/errors.js +26 -0
  22. package/dist/errors.js.map +1 -1
  23. package/dist/gad/erf-2023-06-30.d.ts +33 -0
  24. package/dist/gad/erf-2023-06-30.js +67 -0
  25. package/dist/gad/erf-2023-06-30.js.map +1 -0
  26. package/dist/gad/factor-table.d.ts +90 -0
  27. package/dist/gad/factor-table.js +116 -0
  28. package/dist/gad/factor-table.js.map +1 -0
  29. package/dist/gad/lrf-2023-06-30.d.ts +33 -0
  30. package/dist/gad/lrf-2023-06-30.js +61 -0
  31. package/dist/gad/lrf-2023-06-30.js.map +1 -0
  32. package/dist/index.d.ts +5 -4
  33. package/dist/index.js +12 -4
  34. package/dist/index.js.map +1 -1
  35. package/dist/medical-scales.js +56 -0
  36. package/dist/medical-scales.js.map +1 -1
  37. package/dist/pension-projection.d.ts +12 -22
  38. package/dist/pension-projection.js +23 -149
  39. package/dist/pension-projection.js.map +1 -1
  40. package/dist/pension.js +21 -6
  41. package/dist/pension.js.map +1 -1
  42. package/package.json +2 -1
package/dist/errors.js CHANGED
@@ -60,6 +60,32 @@ export class PensionTiersUnavailable extends Error {
60
60
  this.name = 'PensionTiersUnavailable';
61
61
  }
62
62
  }
63
+ /**
64
+ * Thrown when a retirement period falls outside the printed GAD
65
+ * factor table — e.g. more than 13y0m early under the 30 Jun 2023
66
+ * ERF1. Sibling of {@link ScaleUnavailable}: the factor genuinely
67
+ * isn't published for that period, so callers with free date
68
+ * inputs catch it by type rather than matching message text.
69
+ */
70
+ export class RetirementFactorOutOfRange extends Error {
71
+ guidanceRef;
72
+ years;
73
+ months;
74
+ maxYears;
75
+ maxMonths;
76
+ constructor(
77
+ /** Table name in the governing guidance, e.g. 'ERF1' */
78
+ guidanceRef, years, months, maxYears, maxMonths) {
79
+ super(`${guidanceRef} out of range: ${years}yr ${months}mo `
80
+ + `(max ${maxYears}yr ${maxMonths}mo)`);
81
+ this.guidanceRef = guidanceRef;
82
+ this.years = years;
83
+ this.months = months;
84
+ this.maxYears = maxYears;
85
+ this.maxMonths = maxMonths;
86
+ this.name = 'RetirementFactorOutOfRange';
87
+ }
88
+ }
63
89
  /**
64
90
  * Thrown when no AfC pay award (consolidated % uplift) is recorded
65
91
  * for a (nation, year). Sibling of {@link ScaleUnavailable} — the
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,SAAkB,EAClB,OAAe;IAEf,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;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AAmB,EACnB,KAAa,EACb,MAAc,EACd,QAAgB,EAChB,SAAiB;QAE1B,KAAK,CACH,GAAG,WAAW,kBAAkB,KAAK,MAAM,MAAM,KAAK;cAClD,QAAQ,QAAQ,MAAM,SAAS,KAAK,CACzC,CAAC;QATO,gBAAW,GAAX,WAAW,CAAQ;QACnB,UAAK,GAAL,KAAK,CAAQ;QACb,WAAM,GAAN,MAAM,CAAQ;QACd,aAAQ,GAAR,QAAQ,CAAQ;QAChB,cAAS,GAAT,SAAS,CAAQ;QAM1B,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAE9B;IACA;IAFX,YACW,IAAa,EACb,MAAc;QAEvB,KAAK,CAAC,iCAAiC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;QAHhD,SAAI,GAAJ,IAAI,CAAS;QACb,WAAM,GAAN,MAAM,CAAQ;QAGvB,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,SAAS,YAAY,CACnB,MAAc,EACd,IAAa,EACb,OAAgB,EAChB,UAAmB;IAEnB,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,mBAAmB,UAAU,QAAQ;cACxC,GAAG,OAAO,OAAO,MAAM,IAAI,IAAI,EAAE,CAAC;IACxC,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,0BAA0B,OAAO,MAAM;cAC1C,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC;IAC1B,CAAC;IACD,OAAO,8BAA8B,MAAM,IAAI,IAAI,EAAE,CAAC;AACxD,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet" (workbook: NHS EW Consolidated Factors 2023-03),
4
+ * issued 30 June 2023. Sheet x-420 · PDF p.25.
5
+ *
6
+ * https://www.nhsbsa.nhs.uk/sites/default/files/2024-02/Early%20and%20Late%20Retirement%20Factors.pdf
7
+ *
8
+ * Table 0-420 (ERF1): 2015 scheme early retirement factors, normal
9
+ * health — applicable to main scheme pension and additional
10
+ * pension. Unisex; period measured as time to NPA. Methodology
11
+ * (rounding, order of operations) remains the 7 Aug 2019 guidance,
12
+ * which the workbook names as its related factor table guidance.
13
+ *
14
+ * Rows are years early (0–13), columns months (0–11), exactly as
15
+ * printed — the 13yr row prints a single 0-month value, so it is a
16
+ * single-cell row here. Delete this file whole when a later issue
17
+ * supersedes the table (expected with the post-May-2026 SCAPE
18
+ * review; git history is the archive).
19
+ */
20
+ /** 2015 scheme ERF — Table 0-420, issued 30 Jun 2023. */
21
+ export declare const ERF_0_420: {
22
+ readonly kind: "erf";
23
+ readonly provenance: {
24
+ readonly tableRef: "0-420";
25
+ readonly sheet: "x-420";
26
+ readonly page: 25;
27
+ readonly guidanceRef: "ERF1";
28
+ readonly issued: "2023-06-30";
29
+ readonly sourceUrl: string;
30
+ readonly methodGuidance: string;
31
+ };
32
+ readonly rows: readonly [readonly [1, 0.996, 0.991, 0.987, 0.983, 0.978, 0.974, 0.969, 0.965, 0.961, 0.956, 0.952], readonly [0.948, 0.944, 0.939, 0.935, 0.931, 0.927, 0.923, 0.919, 0.915, 0.911, 0.907, 0.903], readonly [0.899, 0.896, 0.892, 0.888, 0.885, 0.881, 0.877, 0.874, 0.87, 0.866, 0.863, 0.859], readonly [0.855, 0.852, 0.849, 0.845, 0.842, 0.839, 0.835, 0.832, 0.828, 0.825, 0.822, 0.818], readonly [0.815, 0.812, 0.809, 0.806, 0.802, 0.799, 0.796, 0.793, 0.79, 0.787, 0.784, 0.781], readonly [0.777, 0.775, 0.772, 0.769, 0.766, 0.763, 0.76, 0.757, 0.754, 0.752, 0.749, 0.746], readonly [0.743, 0.74, 0.738, 0.735, 0.732, 0.73, 0.727, 0.724, 0.721, 0.719, 0.716, 0.713], readonly [0.711, 0.708, 0.706, 0.703, 0.701, 0.698, 0.696, 0.693, 0.691, 0.688, 0.686, 0.683], readonly [0.681, 0.679, 0.676, 0.674, 0.672, 0.669, 0.667, 0.665, 0.662, 0.66, 0.658, 0.655], readonly [0.653, 0.651, 0.649, 0.647, 0.644, 0.642, 0.64, 0.638, 0.636, 0.634, 0.631, 0.629], readonly [0.627, 0.625, 0.623, 0.621, 0.619, 0.617, 0.615, 0.613, 0.611, 0.609, 0.607, 0.605], readonly [0.603, 0.601, 0.599, 0.597, 0.595, 0.593, 0.591, 0.59, 0.588, 0.586, 0.584, 0.582], readonly [0.58, 0.578, 0.577, 0.575, 0.573, 0.571, 0.569, 0.568, 0.566, 0.564, 0.562, 0.561], readonly [0.559]];
33
+ };
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet" (workbook: NHS EW Consolidated Factors 2023-03),
4
+ * issued 30 June 2023. Sheet x-420 · PDF p.25.
5
+ *
6
+ * https://www.nhsbsa.nhs.uk/sites/default/files/2024-02/Early%20and%20Late%20Retirement%20Factors.pdf
7
+ *
8
+ * Table 0-420 (ERF1): 2015 scheme early retirement factors, normal
9
+ * health — applicable to main scheme pension and additional
10
+ * pension. Unisex; period measured as time to NPA. Methodology
11
+ * (rounding, order of operations) remains the 7 Aug 2019 guidance,
12
+ * which the workbook names as its related factor table guidance.
13
+ *
14
+ * Rows are years early (0–13), columns months (0–11), exactly as
15
+ * printed — the 13yr row prints a single 0-month value, so it is a
16
+ * single-cell row here. Delete this file whole when a later issue
17
+ * supersedes the table (expected with the post-May-2026 SCAPE
18
+ * review; git history is the archive).
19
+ */
20
+ /** 2015 scheme ERF — Table 0-420, issued 30 Jun 2023. */
21
+ export const ERF_0_420 = {
22
+ kind: 'erf',
23
+ provenance: {
24
+ tableRef: '0-420',
25
+ sheet: 'x-420',
26
+ page: 25,
27
+ guidanceRef: 'ERF1',
28
+ issued: '2023-06-30',
29
+ sourceUrl: 'https://www.nhsbsa.nhs.uk/sites/default/'
30
+ + 'files/2024-02/Early%20and%20Late%20Retirement'
31
+ + '%20Factors.pdf',
32
+ methodGuidance: 'GAD NHSPS 2015 E&W — Early and late'
33
+ + ' retirement in normal health, 7 Aug 2019',
34
+ },
35
+ rows: [
36
+ // 0mo 1mo 2mo 3mo 4mo 5mo 6mo
37
+ // 7mo 8mo 9mo 10mo 11mo
38
+ [1.000, 0.996, 0.991, 0.987, 0.983, 0.978,
39
+ 0.974, 0.969, 0.965, 0.961, 0.956, 0.952], // 0yr
40
+ [0.948, 0.944, 0.939, 0.935, 0.931, 0.927,
41
+ 0.923, 0.919, 0.915, 0.911, 0.907, 0.903], // 1yr
42
+ [0.899, 0.896, 0.892, 0.888, 0.885, 0.881,
43
+ 0.877, 0.874, 0.870, 0.866, 0.863, 0.859], // 2yr
44
+ [0.855, 0.852, 0.849, 0.845, 0.842, 0.839,
45
+ 0.835, 0.832, 0.828, 0.825, 0.822, 0.818], // 3yr
46
+ [0.815, 0.812, 0.809, 0.806, 0.802, 0.799,
47
+ 0.796, 0.793, 0.790, 0.787, 0.784, 0.781], // 4yr
48
+ [0.777, 0.775, 0.772, 0.769, 0.766, 0.763,
49
+ 0.760, 0.757, 0.754, 0.752, 0.749, 0.746], // 5yr
50
+ [0.743, 0.740, 0.738, 0.735, 0.732, 0.730,
51
+ 0.727, 0.724, 0.721, 0.719, 0.716, 0.713], // 6yr
52
+ [0.711, 0.708, 0.706, 0.703, 0.701, 0.698,
53
+ 0.696, 0.693, 0.691, 0.688, 0.686, 0.683], // 7yr
54
+ [0.681, 0.679, 0.676, 0.674, 0.672, 0.669,
55
+ 0.667, 0.665, 0.662, 0.660, 0.658, 0.655], // 8yr
56
+ [0.653, 0.651, 0.649, 0.647, 0.644, 0.642,
57
+ 0.640, 0.638, 0.636, 0.634, 0.631, 0.629], // 9yr
58
+ [0.627, 0.625, 0.623, 0.621, 0.619, 0.617,
59
+ 0.615, 0.613, 0.611, 0.609, 0.607, 0.605], // 10yr
60
+ [0.603, 0.601, 0.599, 0.597, 0.595, 0.593,
61
+ 0.591, 0.590, 0.588, 0.586, 0.584, 0.582], // 11yr
62
+ [0.580, 0.578, 0.577, 0.575, 0.573, 0.571,
63
+ 0.569, 0.568, 0.566, 0.564, 0.562, 0.561], // 12yr
64
+ [0.559], // 13yr — 0mo only
65
+ ],
66
+ };
67
+ //# sourceMappingURL=erf-2023-06-30.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erf-2023-06-30.js","sourceRoot":"","sources":["../../src/gad/erf-2023-06-30.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,yDAAyD;AACzD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,KAAK;IACX,UAAU,EAAE;QACV,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,0CAA0C;cACjD,+CAA+C;cAC/C,gBAAgB;QACpB,cAAc,EAAE,qCAAqC;cACjD,0CAA0C;KAC/C;IACD,IAAI,EAAE;QACJ,iDAAiD;QACjD,mCAAmC;QACnC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM;QACnD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM;QACnD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,E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KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO;QACpD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO;QACpD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO;QACpD,CAAC,KAAK,CAAC,EAAsC,kBAAkB;KAChE;CACiC,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * GAD factor-table machinery — the translation layer between a
3
+ * verbatim factor-table transcription (the sibling issue files) and
4
+ * the projection domain. Mirrors the medical/dental circulars
5
+ * pattern at reduced weight: an issue file transcribes one printed
6
+ * table 1:1; {@link FactorTable} validates and wraps it; the
7
+ * projection module consumes factors only through it.
8
+ */
9
+ /**
10
+ * Citation carried in the data itself. Every past defect in this
11
+ * area was a stale-source defect, so the "where did these numbers
12
+ * come from" facts travel with the numbers, not in a comment.
13
+ */
14
+ export interface FactorProvenance {
15
+ /** Consolidated-workbook table reference, e.g. '0-420' */
16
+ readonly tableRef: string;
17
+ /** Workbook sheet the table is printed on, e.g. 'x-420' */
18
+ readonly sheet: string;
19
+ /** Page in the published PDF, e.g. 25 */
20
+ readonly page: number;
21
+ /** Name in the governing guidance, e.g. 'ERF1' */
22
+ readonly guidanceRef: string;
23
+ /** Date GAD issued the factors, ISO date, e.g. '2023-06-30' */
24
+ readonly issued: string;
25
+ /** Document the transcription was made from */
26
+ readonly sourceUrl: string;
27
+ /** Methodology document the table defers to */
28
+ readonly methodGuidance: string;
29
+ }
30
+ /**
31
+ * Everything that differs between the two table kinds, in one
32
+ * place. ERF factors fall as the period grows and part-months
33
+ * round UP (guidance §2.3); LRF factors rise and part-months
34
+ * round DOWN (§3.4). Both roundings are member-conservative;
35
+ * rounding, monotonic direction, and value range all follow from
36
+ * the kind.
37
+ */
38
+ declare const KIND_POLICY: {
39
+ readonly erf: {
40
+ readonly roundsUp: true;
41
+ readonly inOrder: (prev: number, next: number) => boolean;
42
+ readonly orderWord: "non-increasing";
43
+ readonly inRange: (factor: number) => boolean;
44
+ readonly rangeWord: "(0, 1]";
45
+ };
46
+ readonly lrf: {
47
+ readonly roundsUp: false;
48
+ readonly inOrder: (prev: number, next: number) => boolean;
49
+ readonly orderWord: "non-decreasing";
50
+ readonly inRange: (factor: number) => boolean;
51
+ readonly rangeWord: "[1, ∞)";
52
+ };
53
+ };
54
+ export type FactorTableKind = keyof typeof KIND_POLICY;
55
+ /** Verbatim table data as exported by an issue file. */
56
+ export interface FactorTableData {
57
+ readonly kind: FactorTableKind;
58
+ readonly provenance: FactorProvenance;
59
+ /**
60
+ * Ragged, exactly as printed: full rows have 12 month columns;
61
+ * the final row may hold fewer (the 2023 issue prints one). A
62
+ * cell the source doesn't publish is unrepresentable here.
63
+ */
64
+ readonly rows: readonly (readonly number[])[];
65
+ }
66
+ /**
67
+ * Lookup value object over one GAD factor table (pattern:
68
+ * PensionTiers). Bounds derive from the rows — never restated —
69
+ * and the rounding policy lives with the data it governs, so no
70
+ * caller can reach a raw cell and skip the rounding rule.
71
+ */
72
+ export declare class FactorTable {
73
+ readonly kind: FactorTableKind;
74
+ readonly provenance: FactorProvenance;
75
+ private readonly rows;
76
+ constructor(data: FactorTableData);
77
+ /**
78
+ * Factor for a calendar period, applying this table's rounding
79
+ * policy (§2.3 up for ERF, §3.4 down for LRF). Throws
80
+ * {@link RetirementFactorOutOfRange} when the rounded period
81
+ * falls outside the printed table — the factor genuinely isn't
82
+ * published, so callers catch it by type.
83
+ */
84
+ factorFor(period: {
85
+ years: number;
86
+ months: number;
87
+ days: number;
88
+ }): number;
89
+ }
90
+ export {};
@@ -0,0 +1,116 @@
1
+ /**
2
+ * GAD factor-table machinery — the translation layer between a
3
+ * verbatim factor-table transcription (the sibling issue files) and
4
+ * the projection domain. Mirrors the medical/dental circulars
5
+ * pattern at reduced weight: an issue file transcribes one printed
6
+ * table 1:1; {@link FactorTable} validates and wraps it; the
7
+ * projection module consumes factors only through it.
8
+ */
9
+ import { invariant, RetirementFactorOutOfRange, } from '../errors.js';
10
+ /**
11
+ * Everything that differs between the two table kinds, in one
12
+ * place. ERF factors fall as the period grows and part-months
13
+ * round UP (guidance §2.3); LRF factors rise and part-months
14
+ * round DOWN (§3.4). Both roundings are member-conservative;
15
+ * rounding, monotonic direction, and value range all follow from
16
+ * the kind.
17
+ */
18
+ const KIND_POLICY = {
19
+ erf: {
20
+ roundsUp: true,
21
+ // Non-strict: GAD prints 3dp and adjacent cells differ by as
22
+ // little as 0.001, so a legitimate issue may print two equal
23
+ // neighbours. The defect this guards (a mis-pasted row, as
24
+ // the 2019 transcription shipped) is a wrong-DIRECTION jump,
25
+ // which non-strict ordering still rejects.
26
+ inOrder: (prev, next) => next <= prev,
27
+ orderWord: 'non-increasing',
28
+ inRange: (factor) => factor > 0 && factor <= 1,
29
+ rangeWord: '(0, 1]',
30
+ },
31
+ lrf: {
32
+ roundsUp: false,
33
+ inOrder: (prev, next) => next >= prev,
34
+ orderWord: 'non-decreasing',
35
+ inRange: (factor) => factor >= 1,
36
+ rangeWord: '[1, ∞)',
37
+ },
38
+ };
39
+ const MONTHS_PER_ROW = 12;
40
+ /**
41
+ * Lookup value object over one GAD factor table (pattern:
42
+ * PensionTiers). Bounds derive from the rows — never restated —
43
+ * and the rounding policy lives with the data it governs, so no
44
+ * caller can reach a raw cell and skip the rounding rule.
45
+ */
46
+ export class FactorTable {
47
+ kind;
48
+ provenance;
49
+ rows;
50
+ constructor(data) {
51
+ const { kind, provenance, rows } = data;
52
+ const policy = KIND_POLICY[kind];
53
+ const ref = provenance.guidanceRef;
54
+ invariant(rows.length > 0, `${ref}: no rows`);
55
+ rows.forEach((row, y) => {
56
+ const isLast = y === rows.length - 1;
57
+ invariant(row.length === MONTHS_PER_ROW
58
+ || (isLast && row.length >= 1
59
+ && row.length < MONTHS_PER_ROW), `${ref}: row ${y} has ${row.length} cells — only the`
60
+ + ' final row may be shorter than 12, and no row'
61
+ + ' longer');
62
+ });
63
+ // Monotonicity across the flattened period order is the
64
+ // transcription tripwire: the superseded 2019 transcription
65
+ // carried final rows that jumped the wrong direction (a
66
+ // mis-pasted row), and this check rejects that class of
67
+ // defect at construction.
68
+ const flat = rows.flat();
69
+ for (let i = 1; i < flat.length; i++) {
70
+ invariant(policy.inOrder(flat[i - 1], flat[i]), `${ref}: factor order violation at flat index ${i}`
71
+ + ` — expected ${policy.orderWord}`);
72
+ }
73
+ for (const factor of flat) {
74
+ invariant(policy.inRange(factor), `${ref}: factor ${factor} outside the `
75
+ + `${policy.rangeWord} range`);
76
+ }
77
+ this.kind = kind;
78
+ this.provenance = provenance;
79
+ this.rows = rows;
80
+ }
81
+ /**
82
+ * Factor for a calendar period, applying this table's rounding
83
+ * policy (§2.3 up for ERF, §3.4 down for LRF). Throws
84
+ * {@link RetirementFactorOutOfRange} when the rounded period
85
+ * falls outside the printed table — the factor genuinely isn't
86
+ * published, so callers catch it by type.
87
+ */
88
+ factorFor(period) {
89
+ // Precondition, not table bounds: a malformed period (a
90
+ // date-arithmetic bug upstream) must fail loud here, never
91
+ // masquerade as the typed "factor not published" error.
92
+ invariant(Number.isInteger(period.years) && period.years >= 0
93
+ && Number.isInteger(period.months)
94
+ && period.months >= 0
95
+ && period.months < MONTHS_PER_ROW
96
+ && period.days >= 0, `${this.provenance.guidanceRef}: malformed period `
97
+ + `${period.years}yr ${period.months}mo `
98
+ + `${period.days}d`);
99
+ let { years, months } = period;
100
+ if (KIND_POLICY[this.kind].roundsUp && period.days > 0) {
101
+ months += 1;
102
+ if (months >= MONTHS_PER_ROW) {
103
+ months = 0;
104
+ years += 1;
105
+ }
106
+ }
107
+ const row = this.rows[years];
108
+ const factor = row?.[months];
109
+ if (factor === undefined) {
110
+ const last = this.rows.length - 1;
111
+ throw new RetirementFactorOutOfRange(this.provenance.guidanceRef, years, months, last, this.rows[last].length - 1);
112
+ }
113
+ return factor;
114
+ }
115
+ }
116
+ //# sourceMappingURL=factor-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factor-table.js","sourceRoot":"","sources":["../../src/gad/factor-table.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,SAAS,EACT,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AAwBtB;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE;QACH,QAAQ,EAAE,IAAI;QACd,6DAA6D;QAC7D,6DAA6D;QAC7D,2DAA2D;QAC3D,6DAA6D;QAC7D,2CAA2C;QAC3C,OAAO,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrD,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,CAAC;QACtD,SAAS,EAAE,QAAQ;KACpB;IACD,GAAG,EAAE;QACH,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrD,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC;QACxC,SAAS,EAAE,QAAQ;KACpB;CACO,CAAC;AAgBX,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IACb,IAAI,CAAkB;IACtB,UAAU,CAAmB;IACrB,IAAI,CAAiC;IAEtD,YAA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,CAAC;YACzB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;YAClC,MAAM,IAAI,0BAA0B,CAClC,IAAI,CAAC,UAAU,CAAC,WAAW,EAC3B,KAAK,EACL,MAAM,EACN,IAAI,EACJ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAC3B,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet" (workbook: NHS EW Consolidated Factors 2023-03),
4
+ * issued 30 June 2023. Sheet x-421 · PDF p.26.
5
+ *
6
+ * https://www.nhsbsa.nhs.uk/sites/default/files/2024-02/Early%20and%20Late%20Retirement%20Factors.pdf
7
+ *
8
+ * Table 0-421 (LRF1): 2015 scheme late retirement factors — main
9
+ * scheme pension, members retiring from active service. Unisex;
10
+ * period measured as time after NPA. Methodology remains the
11
+ * 7 Aug 2019 guidance (see the ERF file header). The workbook's
12
+ * LRF2 (0-422, additional pension / pension debits) is not
13
+ * modelled — the library projects main-scheme pension only.
14
+ *
15
+ * Rows are years late (0–10), columns months (0–11), exactly as
16
+ * printed — the 10yr row prints a single 0-month value. Delete
17
+ * this file whole when a later issue supersedes the table
18
+ * (expected with the post-May-2026 SCAPE review).
19
+ */
20
+ /** 2015 scheme LRF — Table 0-421, issued 30 Jun 2023. */
21
+ export declare const LRF_0_421: {
22
+ readonly kind: "lrf";
23
+ readonly provenance: {
24
+ readonly tableRef: "0-421";
25
+ readonly sheet: "x-421";
26
+ readonly page: 26;
27
+ readonly guidanceRef: "LRF1";
28
+ readonly issued: "2023-06-30";
29
+ readonly sourceUrl: string;
30
+ readonly methodGuidance: string;
31
+ };
32
+ readonly rows: readonly [readonly [1, 1.003, 1.007, 1.01, 1.014, 1.017, 1.02, 1.024, 1.027, 1.031, 1.034, 1.037], readonly [1.041, 1.044, 1.048, 1.052, 1.056, 1.059, 1.063, 1.067, 1.07, 1.074, 1.078, 1.081], readonly [1.085, 1.089, 1.093, 1.097, 1.101, 1.106, 1.11, 1.114, 1.118, 1.122, 1.126, 1.13], readonly [1.134, 1.139, 1.143, 1.148, 1.152, 1.156, 1.161, 1.165, 1.17, 1.174, 1.179, 1.183], readonly [1.188, 1.193, 1.198, 1.203, 1.208, 1.213, 1.217, 1.222, 1.227, 1.232, 1.237, 1.242], readonly [1.247, 1.253, 1.258, 1.263, 1.269, 1.274, 1.28, 1.285, 1.291, 1.296, 1.302, 1.307], readonly [1.313, 1.318, 1.324, 1.33, 1.336, 1.342, 1.348, 1.354, 1.36, 1.366, 1.372, 1.378], readonly [1.384, 1.391, 1.397, 1.404, 1.411, 1.417, 1.424, 1.43, 1.437, 1.444, 1.45, 1.457], readonly [1.463, 1.471, 1.478, 1.485, 1.492, 1.5, 1.507, 1.514, 1.521, 1.529, 1.536, 1.543], readonly [1.55, 1.558, 1.566, 1.574, 1.582, 1.59, 1.598, 1.606, 1.614, 1.622, 1.63, 1.638], readonly [1.646]];
33
+ };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet" (workbook: NHS EW Consolidated Factors 2023-03),
4
+ * issued 30 June 2023. Sheet x-421 · PDF p.26.
5
+ *
6
+ * https://www.nhsbsa.nhs.uk/sites/default/files/2024-02/Early%20and%20Late%20Retirement%20Factors.pdf
7
+ *
8
+ * Table 0-421 (LRF1): 2015 scheme late retirement factors — main
9
+ * scheme pension, members retiring from active service. Unisex;
10
+ * period measured as time after NPA. Methodology remains the
11
+ * 7 Aug 2019 guidance (see the ERF file header). The workbook's
12
+ * LRF2 (0-422, additional pension / pension debits) is not
13
+ * modelled — the library projects main-scheme pension only.
14
+ *
15
+ * Rows are years late (0–10), columns months (0–11), exactly as
16
+ * printed — the 10yr row prints a single 0-month value. Delete
17
+ * this file whole when a later issue supersedes the table
18
+ * (expected with the post-May-2026 SCAPE review).
19
+ */
20
+ /** 2015 scheme LRF — Table 0-421, issued 30 Jun 2023. */
21
+ export const LRF_0_421 = {
22
+ kind: 'lrf',
23
+ provenance: {
24
+ tableRef: '0-421',
25
+ sheet: 'x-421',
26
+ page: 26,
27
+ guidanceRef: 'LRF1',
28
+ issued: '2023-06-30',
29
+ sourceUrl: 'https://www.nhsbsa.nhs.uk/sites/default/'
30
+ + 'files/2024-02/Early%20and%20Late%20Retirement'
31
+ + '%20Factors.pdf',
32
+ methodGuidance: 'GAD NHSPS 2015 E&W — Early and late'
33
+ + ' retirement in normal health, 7 Aug 2019',
34
+ },
35
+ rows: [
36
+ // 0mo 1mo 2mo 3mo 4mo 5mo 6mo
37
+ // 7mo 8mo 9mo 10mo 11mo
38
+ [1.000, 1.003, 1.007, 1.010, 1.014, 1.017,
39
+ 1.020, 1.024, 1.027, 1.031, 1.034, 1.037], // 0yr
40
+ [1.041, 1.044, 1.048, 1.052, 1.056, 1.059,
41
+ 1.063, 1.067, 1.070, 1.074, 1.078, 1.081], // 1yr
42
+ [1.085, 1.089, 1.093, 1.097, 1.101, 1.106,
43
+ 1.110, 1.114, 1.118, 1.122, 1.126, 1.130], // 2yr
44
+ [1.134, 1.139, 1.143, 1.148, 1.152, 1.156,
45
+ 1.161, 1.165, 1.170, 1.174, 1.179, 1.183], // 3yr
46
+ [1.188, 1.193, 1.198, 1.203, 1.208, 1.213,
47
+ 1.217, 1.222, 1.227, 1.232, 1.237, 1.242], // 4yr
48
+ [1.247, 1.253, 1.258, 1.263, 1.269, 1.274,
49
+ 1.280, 1.285, 1.291, 1.296, 1.302, 1.307], // 5yr
50
+ [1.313, 1.318, 1.324, 1.330, 1.336, 1.342,
51
+ 1.348, 1.354, 1.360, 1.366, 1.372, 1.378], // 6yr
52
+ [1.384, 1.391, 1.397, 1.404, 1.411, 1.417,
53
+ 1.424, 1.430, 1.437, 1.444, 1.450, 1.457], // 7yr
54
+ [1.463, 1.471, 1.478, 1.485, 1.492, 1.500,
55
+ 1.507, 1.514, 1.521, 1.529, 1.536, 1.543], // 8yr
56
+ [1.550, 1.558, 1.566, 1.574, 1.582, 1.590,
57
+ 1.598, 1.606, 1.614, 1.622, 1.630, 1.638], // 9yr
58
+ [1.646], // 10yr — 0mo only
59
+ ],
60
+ };
61
+ //# sourceMappingURL=lrf-2023-06-30.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lrf-2023-06-30.js","sourceRoot":"","sources":["../../src/gad/lrf-2023-06-30.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,yDAAyD;AACzD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,KAAK;IACX,UAAU,EAAE;QACV,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,EAAE;QACR,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,0CAA0C;cACjD,+CAA+C;cAC/C,gBAAgB;QACpB,cAAc,EAAE,qCAAqC;cACjD,0CAA0C;KAC/C;IACD,IAAI,EAAE;QACJ,iDAAiD;QACjD,mCAAmC;QACnC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM;QACnD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM;QACnD,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE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sC,kBAAkB;KAChE;CACiC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -9,13 +9,14 @@ export type { PostIdentity, PostAdjustments } from './post.js';
9
9
  export type { AfcRole, DentalRole, MedicalRole, Role, RoleKind, VsmRole, } from './role.js';
10
10
  export { afcResolver, dentalResolver, medicalResolver } from './resolver.js';
11
11
  export type { AfcResolver, DentalResolver, MedicalResolver, NationScaleResolver, PayScaleResolver, } from './resolver.js';
12
- export { MEDICAL_GRADES, MEDICAL_GRADE_IDS, getMedicalScales, } from './medical-scales.js';
12
+ export { MEDICAL_GRADES, MEDICAL_GRADE_IDS, MEDICAL_TAX_YEARS, getMedicalScales, } from './medical-scales.js';
13
13
  export type { MedicalGradeId, MedicalGradeMeta, } from './medical-scales.js';
14
- export { DENTAL_GRADES, DENTAL_GRADE_IDS, getDentalScales, } from './dental-scales.js';
14
+ export { DENTAL_GRADES, DENTAL_GRADE_IDS, DENTAL_TAX_YEARS, getDentalScales, } from './dental-scales.js';
15
15
  export type { DentalGradeId, DentalGradeMeta, } from './dental-scales.js';
16
- export { AwardUnavailable, PensionTiersUnavailable, ScaleUnavailable, } from './errors.js';
16
+ export { AwardUnavailable, PensionTiersUnavailable, RetirementFactorOutOfRange, ScaleUnavailable, } from './errors.js';
17
17
  export { afcAward } from './award.js';
18
- export { ACCRUAL_RATE, COMMUTATION_FACTOR, commute, lookupErf1, lookupLrf1, maxLumpSum, npaDate, periodInYearsMonths, projectPension, retirementFactor, revalue, yearlyAccrual, } from './pension-projection.js';
18
+ export { ACCRUAL_RATE, COMMUTATION_FACTOR, commute, maxLumpSum, projectPension, retirementFactor, yearlyAccrual, } from './pension-projection.js';
19
+ export type { FactorTableKind, } from './gad/factor-table.js';
19
20
  export type { CommutationResult, PensionEstimationInput, PensionProjectionInput, PensionProjectionResult, PensionStatementInput, ProjectionPoint, } from './pension-projection.js';
20
21
  export { HCAS_ZONE_IDS, calculateHcasSupplement, grossSalary, isHcasZoneId, } from './hcas.js';
21
22
  export type { HcasZoneId } from './hcas.js';
package/dist/index.js CHANGED
@@ -6,13 +6,21 @@ export { PensionTiers, getEmployerPensionRate, getPensionTiers, getPensionTiersV
6
6
  export { Post, NO_ADJUSTMENTS } from './post.js';
7
7
  export { afcResolver, dentalResolver, medicalResolver } from './resolver.js';
8
8
  // ── Medical & dental scales ──────────────────────
9
- export { MEDICAL_GRADES, MEDICAL_GRADE_IDS, getMedicalScales, } from './medical-scales.js';
10
- export { DENTAL_GRADES, DENTAL_GRADE_IDS, getDentalScales, } from './dental-scales.js';
11
- export { AwardUnavailable, PensionTiersUnavailable, ScaleUnavailable, } from './errors.js';
9
+ export { MEDICAL_GRADES, MEDICAL_GRADE_IDS, MEDICAL_TAX_YEARS, getMedicalScales, } from './medical-scales.js';
10
+ export { DENTAL_GRADES, DENTAL_GRADE_IDS, DENTAL_TAX_YEARS, getDentalScales, } from './dental-scales.js';
11
+ // ── Errors ───────────────────────────────────────
12
+ export { AwardUnavailable, PensionTiersUnavailable, RetirementFactorOutOfRange, ScaleUnavailable, } from './errors.js';
12
13
  // ── AfC pay award ────────────────────────────────
13
14
  export { afcAward } from './award.js';
14
15
  // ── Pension Projection ─────────────────────────────
15
- export { ACCRUAL_RATE, COMMUTATION_FACTOR, commute, lookupErf1, lookupLrf1, maxLumpSum, npaDate, periodInYearsMonths, projectPension, retirementFactor, revalue, yearlyAccrual, } from './pension-projection.js';
16
+ // Deliberate surface: the scenario-level API plus
17
+ // yearlyAccrual (hub-site builds its pension-growth
18
+ // chart from it). Date plumbing (periodInYearsMonths,
19
+ // npaDate), raw maths (revalue), and factor-table
20
+ // internals stay private — factors are reachable solely
21
+ // through retirementFactor/projectPension, which own
22
+ // the GAD rounding rules.
23
+ export { ACCRUAL_RATE, COMMUTATION_FACTOR, commute, maxLumpSum, projectPension, retirementFactor, yearlyAccrual, } from './pension-projection.js';
16
24
  // ── HCAS ─────────────────────────────────────────
17
25
  export { HCAS_ZONE_IDS, calculateHcasSupplement, grossSalary, isHcasZoneId, } from './hcas.js';
18
26
  // ── HCAS PCTs ────────────────────────────────────
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAQrB,oDAAoD;AACpD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,cAAc,CAAC;AAStB,oDAAoD;AACpD,OAAO,EAAC,IAAI,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AAU/C,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAS3E,oDAAoD;AACpD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,oDAAoD;AACpD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,sDAAsD;AACtD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,aAAa,GACd,MAAM,yBAAyB,CAAC;AAUjC,oDAAoD;AACpD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,WAAW,EACX,YAAY,GACb,MAAM,WAAW,CAAC;AAGnB,oDAAoD;AACpD,OAAO,EACL,WAAW,EACX,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAGxB,oDAAoD;AACpD,OAAO,EACL,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,QAAQ,EACR,aAAa,GACd,MAAM,cAAc,CAAC;AAMtB,oDAAoD;AACpD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAC;AAMpB,oDAAoD;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAG3C,oDAAoD;AACpD,OAAO,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,oDAAoD;AACpD,mDAAmD;AACnD,qDAAqD;AACrD,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAQrB,oDAAoD;AACpD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,cAAc,CAAC;AAStB,oDAAoD;AACpD,OAAO,EAAC,IAAI,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AAU/C,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAS3E,oDAAoD;AACpD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,C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,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC"}
@@ -23,7 +23,9 @@ import { NATION_KEYS, TAX_YEARS } from '@casomoltd/paye-calc';
23
23
  import { byCode, byStage, numbered, range, resolveGradeMetas, scaleSalaries, stepped, } from './scale-tables.js';
24
24
  import { ENGLAND_MD_1_2026R as ENG } from './circulars/england-md-1-2026r.js';
25
25
  import { SCOTLAND_PCS_DD_2026_01 as SCO } from './circulars/scotland-pcs-dd-2026-01.js';
26
+ import { SCOTLAND_PCS_DD_2025_01 as SCO25 } from './circulars/scotland-pcs-dd-2025-01.js';
26
27
  import { WALES_MDW_01_2025 as WAL } from './circulars/wales-mdw-01-2025.js';
28
+ import { WALES_MDW_01_2026 as WAL26 } from './circulars/wales-mdw-01-2026.js';
27
29
  import { NI_HSC_TC8_05_2025 as NI } from './circulars/ni-hsc-tc8-05-2025.js';
28
30
  /** Doctor grade identifiers wired into the domain. */
29
31
  export const MEDICAL_GRADES = {
@@ -127,14 +129,68 @@ const northernIreland = {
127
129
  'associate-specialist': stepped(scaleSalaries(NI.closedGrades, (g) => g.code === 'M080', 'NI M080')),
128
130
  'staff-grade': stepped(scaleSalaries(NI.closedGrades, (g) => g.code === 'M211', 'NI M211')),
129
131
  };
132
+ // Wales 2026/27 (M&D(W) 01/2026) — a full 3.5% uplift of the 2025 scales.
133
+ // The Associate Specialist MC01 code is removed in this circular, so unlike
134
+ // `wales` (2025) there is no 'associate-specialist' entry here.
135
+ const wales2026 = {
136
+ consultant: consultantByYear(WAL26.consultant),
137
+ str: stepped(scaleSalaries(WAL26.trainingGrades, (g) => g.code === 'MN37', 'Wal26 MN37')),
138
+ 'specialty-registrar-core': stepped(scaleSalaries(WAL26.trainingGrades, (g) => g.code === 'MN39', 'Wal26 MN39')),
139
+ 'specialty-registrar-fixed': stepped(scaleSalaries(WAL26.trainingGrades, (g) => g.code === 'MN35', 'Wal26 MN35')),
140
+ fho1: stepped(scaleSalaries(WAL26.trainingGrades, (g) => g.code === 'MN13', 'Wal26 MN13')),
141
+ fho2: stepped(scaleSalaries(WAL26.trainingGrades, (g) => g.code === 'MN15', 'Wal26 MN15')),
142
+ 'specialty-doctor': byCode(WAL26.specialtyDoctor),
143
+ specialist: byCode(WAL26.specialist),
144
+ 'salaried-gp': stepped(WAL26.salariedGp.salaries),
145
+ 'staff-grade': stepped(scaleSalaries(WAL26.closedGrades, (g) => g.code === 'MH01', 'Wal26 MH01')),
146
+ 'specialty-doctor-2008': byCode(WAL26.specialtyDoctor2008),
147
+ 'associate-specialist-2008': byCode(WAL26.associateSpecialist2008),
148
+ 'hospital-practitioner': stepped(scaleSalaries(WAL26.closedGrades, (g) => g.code === 'MD01-41', 'Wal26 HP')),
149
+ };
150
+ // Scotland 2025/26 — the COMPLETE pay round (non-training from the main
151
+ // circular, training grades from the addendum), so every doctor grade
152
+ // resolves. The 2026/27 `scotland` above stays training-only, so a
153
+ // consultant/SAS/GP query for 2026/27 throws while these resolve to 2025/26.
154
+ const scotland2025 = {
155
+ consultant: consultantByYear(SCO25.consultant),
156
+ 'specialty-doctor': SCO25.specialtyDoctor2022.map((r) => ({
157
+ label: r.scalePoint === 0 ? 'Minimum' : `Point ${r.scalePoint}`,
158
+ salary: r.salary,
159
+ yearsExperience: r.scalePoint,
160
+ })),
161
+ specialist: SCO25.specialist2022.map((r) => ({
162
+ label: r.scalePoint === 0 ? 'Minimum' : `Point ${r.scalePoint}`,
163
+ salary: r.salary,
164
+ yearsExperience: r.scalePoint,
165
+ })),
166
+ 'specialty-doctor-2008': stepped(SCO25.specialtyDoctor2008),
167
+ 'associate-specialist-2008': stepped(SCO25.associateSpecialist2008),
168
+ 'associate-specialist': stepped(scaleSalaries(SCO25.closedGrades, (g) => g.code === 'pre2008-as', 'Sco25 pre2008 AS')),
169
+ 'staff-grade': stepped(scaleSalaries(SCO25.closedGrades, (g) => g.code === 'pre1997-sg', 'Sco25 pre1997 SG')),
170
+ 'hospital-practitioner': numbered(SCO25.hospitalPractitioner),
171
+ 'salaried-gp': range(SCO25.salariedGpRange),
172
+ 'gp-educator': SCO25.associateAdvisers.map((r) => ({ label: r.grade, salary: r.salary })),
173
+ fho1: stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'FHO1', 'Sco25 FHO1')),
174
+ fho2: stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'FHO2', 'Sco25 FHO2')),
175
+ sho: stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'SHO', 'Sco25 SHO')),
176
+ spr: stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'SpR', 'Sco25 SpR')),
177
+ str: stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'StR-full', 'Sco25 StR')),
178
+ 'specialty-registrar-core': stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'StR-core', 'Sco25 StR core')),
179
+ 'specialty-registrar-fixed': stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'StR-fixed', 'Sco25 StR fixed')),
180
+ 'gp-registrar-sho': stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'GP-SHO', 'Sco25 GP SHO')),
181
+ 'gp-registrar-spr': stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'GP-SpR', 'Sco25 GP SpR')),
182
+ 'gp-registrar-str': stepped(scaleSalaries(SCO25.trainingGrades, (g) => g.code === 'GP-StR', 'Sco25 GP StR')),
183
+ };
130
184
  const MEDICAL_SCALES = {
131
185
  [TAX_YEARS.Y2026_27]: {
132
186
  [NATION_KEYS.england]: england,
133
187
  [NATION_KEYS.scotland]: scotland,
188
+ [NATION_KEYS.wales]: wales2026,
134
189
  },
135
190
  [TAX_YEARS.Y2025_26]: {
136
191
  [NATION_KEYS.wales]: wales,
137
192
  [NATION_KEYS.northernIreland]: northernIreland,
193
+ [NATION_KEYS.scotland]: scotland2025,
138
194
  },
139
195
  };
140
196
  /**