@casomoltd/nhs-pay 0.15.1 → 0.16.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 (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 +24 -6
  102. package/dist/circulars/england-md-1-2026r.js.map +0 -1
@@ -0,0 +1,101 @@
1
+ /**
2
+ * The table shapes AfC pay circulars actually print.
3
+ *
4
+ * Shared by the verbatim transcriptions in this directory because the
5
+ * publishers genuinely share them, not to save typing: Wales and
6
+ * Northern Ireland both print an "Entry step point / Years until
7
+ * eligible for pay progression / Intermediate step point / Top step
8
+ * point" table, with the same columns in the same order, so one type
9
+ * describes both faithfully. Scotland prints something different and
10
+ * has its own shapes below.
11
+ *
12
+ * These describe the SOURCE, not the domain. A band is `'Band 8a'`
13
+ * because that is what the page says; the mapping to an `AfcBandId`,
14
+ * and the derivation of our own point labels, belong to the
15
+ * translation layer in `afc-scales.ts`.
16
+ */
17
+ /**
18
+ * A band whose pay the circular prints as a single figure with NO
19
+ * progression columns.
20
+ *
21
+ * Northern Ireland's Bands 1 and 2 are the case this exists for: its
22
+ * Basic Pay block gives one flat figure each and its entry/interval
23
+ * table starts at Band 3. England's publisher prints Band 2 with an
24
+ * entry point, a two-year interval and a top point — same cash,
25
+ * different published structure. Recording the shape the publisher
26
+ * used is the point: England's two-point shape was once copied across
27
+ * to NI, and only a later reading of the PDF caught it.
28
+ */
29
+ export interface FlatBandRow {
30
+ /** The band as the circular prints it, e.g. 'Band 1'. */
31
+ readonly band: string;
32
+ readonly salary: number;
33
+ /** Set where the circular footnotes the band, e.g. closed to new
34
+ * entrants. Carried because it is a claim about the band, printed
35
+ * beside it. */
36
+ readonly note?: string;
37
+ }
38
+ /**
39
+ * A band printed with an entry point, a progression interval, and a
40
+ * top point — optionally with an intermediate step between them.
41
+ *
42
+ * `yearsToIntermediate` / `yearsToTop` are the publisher's OWN
43
+ * "Years until eligible for pay progression" figures, transcribed as
44
+ * printed. Our "Year N" point labels are DERIVED from them rather
45
+ * than typed alongside the salaries, so a mis-transcribed interval
46
+ * shows up as a wrong label that a fixture catches, instead of a label
47
+ * and an interval quietly disagreeing.
48
+ */
49
+ export interface SteppedBandRow {
50
+ /** The band as the circular prints it, e.g. 'Band 8a'. */
51
+ readonly band: string;
52
+ readonly entry: number;
53
+ /**
54
+ * Years at the entry point before the next step. Where there is an
55
+ * intermediate step this is the wait for it; where there is not, it
56
+ * is the wait for the top.
57
+ */
58
+ readonly yearsToNext: number;
59
+ /** Absent for a two-point band. */
60
+ readonly intermediate?: number;
61
+ /** Present only alongside {@link SteppedBandRow.intermediate}. */
62
+ readonly yearsToTop?: number;
63
+ readonly top: number;
64
+ readonly note?: string;
65
+ }
66
+ /**
67
+ * One row of Scotland's Annex B, which prints a band's points as
68
+ * numbered rows rather than as an entry/top pair.
69
+ */
70
+ export interface AnnexBRow {
71
+ /** The band as the circular prints it, e.g. 'Band 8A'. */
72
+ readonly band: string;
73
+ /** The point number in the circular's own `Pt` column. */
74
+ readonly point: number;
75
+ readonly salary: number;
76
+ /**
77
+ * The hourly rate the circular prints beside the annual figure.
78
+ *
79
+ * Transcribed because it is a published figure we can be checked
80
+ * against, and because it pins the contracted week the publisher
81
+ * computed it on — Scotland's is 37 hours for 2025-26 and 36 from
82
+ * 1 April 2026, which is a change no annual salary reveals.
83
+ */
84
+ readonly hourly: number;
85
+ }
86
+ /**
87
+ * One row of Scotland's Annex C, "Full pay journey", which enumerates
88
+ * the year of service a member is in against the rate they are on.
89
+ *
90
+ * This is the column that settles Scotland's point labels. Consecutive
91
+ * increments at one salary are one point, and the increment the group
92
+ * starts at is that point's year — which is the same reading Wales's
93
+ * "Years until eligible" column gives, from a publisher that states it
94
+ * directly.
95
+ */
96
+ export interface PayJourneyRow {
97
+ readonly band: string;
98
+ /** The circular's own `Yearly Increment` value. */
99
+ readonly increment: number;
100
+ readonly salary: number;
101
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The table shapes AfC pay circulars actually print.
3
+ *
4
+ * Shared by the verbatim transcriptions in this directory because the
5
+ * publishers genuinely share them, not to save typing: Wales and
6
+ * Northern Ireland both print an "Entry step point / Years until
7
+ * eligible for pay progression / Intermediate step point / Top step
8
+ * point" table, with the same columns in the same order, so one type
9
+ * describes both faithfully. Scotland prints something different and
10
+ * has its own shapes below.
11
+ *
12
+ * These describe the SOURCE, not the domain. A band is `'Band 8a'`
13
+ * because that is what the page says; the mapping to an `AfcBandId`,
14
+ * and the derivation of our own point labels, belong to the
15
+ * translation layer in `afc-scales.ts`.
16
+ */
17
+ export {};
18
+ //# sourceMappingURL=afc-shapes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"afc-shapes.js","sourceRoot":"","sources":["../../src/circulars/afc-shapes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
@@ -1,9 +1,15 @@
1
1
  /**
2
2
  * Verbatim transcription of NHS Employers Pay & Conditions Circular
3
- * (M&D) 1/2026R — "Pay award for hospital medical and dental staff,
3
+ * (M&D) 1/2026 R2 — "Pay award for hospital medical and dental staff,
4
4
  * doctors and dentists in public health, the community health service
5
- * and salaried primary dental care (England)". Republished 30 June
6
- * 2026 (first published 11 May 2026); rates effective 1 April 2026.
5
+ * and salaried primary dental care (England)". Issued 24 July 2026
6
+ * (first published 11 May 2026, revised 30 June 2026); rates effective
7
+ * 1 April 2026.
8
+ *
9
+ * Every section here is transcribed from R2. Its Annex A §1 puts the
10
+ * 2016-contract training grades on ten nodal points, agreed between the
11
+ * government and the BMA, with the on-call and weekend allowances
12
+ * calculated on those points.
7
13
  *
8
14
  * This mirrors the circular's Annex A section by section, so it can be
9
15
  * diffed against the PDF top-to-bottom. Scope captured (per the agreed
@@ -18,46 +24,205 @@
18
24
  * transcribed — nothing is silently dropped. The translation layer
19
25
  * (not this file) decides which of these feed the calculator domain.
20
26
  *
21
- * Source: "England, Pay & Conditions Circular (M&D) 1/2026R" —
22
- * see docs/source-archive.md.
27
+ * Source: "England, Pay & Conditions Circular (M&D) 1/2026 R2" —
28
+ * see docs/source-archive.md#sa-03.
29
+ *
30
+ * Annex A §1's tables are EMBEDDED IMAGES: `pdftotext` returns the
31
+ * surrounding prose and silently drops every figure. Read those pages
32
+ * from a render (`pdftoppm -r 200 -png`), not from a text dump, or the
33
+ * scale comes back empty on the one page that matters most.
23
34
  */
24
- export declare const ENGLAND_MD_1_2026R: {
25
- readonly circular: "NHS Employers PC(M&D) 1/2026R";
35
+ /** The ten nodal points R2 prints, as it labels them.
36
+ *
37
+ * Not numbers: the ten subdivide the original five, so '3a' and '3b'
38
+ * are distinct points that happen to pay the same, which no numeric
39
+ * type holds without inventing an order the source does not print.
40
+ * The canonical `ScalePoint` widens this to a plain string, because
41
+ * the label is each publisher's to choose. */
42
+ declare const NODAL_POINTS: {
43
+ readonly one: "1";
44
+ readonly two: "2";
45
+ readonly threeA: "3a";
46
+ readonly threeB: "3b";
47
+ readonly fourA: "4a";
48
+ readonly fourB: "4b";
49
+ readonly fourC: "4c";
50
+ readonly fiveA: "5a";
51
+ readonly fiveB: "5b";
52
+ readonly fiveC: "5c";
53
+ };
54
+ type NodalPoint = (typeof NODAL_POINTS)[keyof typeof NODAL_POINTS];
55
+ /** Every point the circular prints, in its printed order — the list a
56
+ * fixture sweeps to prove the transcription carries all ten. */
57
+ export declare const NODAL_POINT_ORDER: readonly NodalPoint[];
58
+ export declare const ENGLAND_MD_1_2026_R2: {
59
+ readonly circular: "NHS Employers PC(M&D) 1/2026 R2";
26
60
  readonly nation: "england";
27
61
  readonly effectiveFrom: "2026-04-01";
28
- readonly doctorsInTraining: {
62
+ readonly doctorsInTraining: ({
29
63
  stage: string;
30
64
  code: string;
31
- nodalPoint: number;
65
+ nodalPoint: "1";
32
66
  salary: number;
33
- }[];
34
- readonly dentistsInTraining: {
67
+ } | {
35
68
  stage: string;
36
69
  code: string;
37
- nodalPoint: number;
70
+ nodalPoint: "2";
38
71
  salary: number;
39
- }[];
40
- readonly locallyEmployedDoctors: {
72
+ } | {
73
+ stage: string;
41
74
  code: string;
42
- nodalPoint: number;
75
+ nodalPoint: "3a";
43
76
  salary: number;
44
- }[];
45
- readonly onCallAvailabilityAllowance: readonly [{
46
- readonly nodalPoint: 1;
47
- readonly salary: 3216;
48
- }, {
49
- readonly nodalPoint: 2;
50
- readonly salary: 3680;
51
- }, {
52
- readonly nodalPoint: 3;
53
- readonly salary: 4360;
54
- }, {
55
- readonly nodalPoint: 4;
56
- readonly salary: 5386;
57
- }, {
58
- readonly nodalPoint: 5;
59
- readonly salary: 6127;
60
- }];
77
+ } | {
78
+ stage: string;
79
+ code: string;
80
+ nodalPoint: "3b";
81
+ salary: number;
82
+ } | {
83
+ stage: string;
84
+ code: string;
85
+ nodalPoint: "4a";
86
+ salary: number;
87
+ } | {
88
+ stage: string;
89
+ code: string;
90
+ nodalPoint: "4b";
91
+ salary: number;
92
+ } | {
93
+ stage: string;
94
+ code: string;
95
+ nodalPoint: "4c";
96
+ salary: number;
97
+ } | {
98
+ stage: string;
99
+ code: string;
100
+ nodalPoint: "5a";
101
+ salary: number;
102
+ } | {
103
+ stage: string;
104
+ code: string;
105
+ nodalPoint: "5b";
106
+ salary: number;
107
+ } | {
108
+ stage: string;
109
+ code: string;
110
+ nodalPoint: "5c";
111
+ salary: number;
112
+ })[];
113
+ readonly dentistsInTraining: ({
114
+ stage: string;
115
+ code: string;
116
+ nodalPoint: "3a";
117
+ salary: number;
118
+ } | {
119
+ stage: string;
120
+ code: string;
121
+ nodalPoint: "3b";
122
+ salary: number;
123
+ } | {
124
+ stage: string;
125
+ code: string;
126
+ nodalPoint: "4a";
127
+ salary: number;
128
+ } | {
129
+ stage: string;
130
+ code: string;
131
+ nodalPoint: "4b";
132
+ salary: number;
133
+ } | {
134
+ stage: string;
135
+ code: string;
136
+ nodalPoint: "4c";
137
+ salary: number;
138
+ } | {
139
+ stage: string;
140
+ code: string;
141
+ nodalPoint: "5a";
142
+ salary: number;
143
+ } | {
144
+ stage: string;
145
+ code: string;
146
+ nodalPoint: "5b";
147
+ salary: number;
148
+ } | {
149
+ stage: string;
150
+ code: string;
151
+ nodalPoint: "5c";
152
+ salary: number;
153
+ })[];
154
+ readonly locallyEmployedDoctors: ({
155
+ code: string;
156
+ nodalPoint: "1";
157
+ salary: number;
158
+ } | {
159
+ code: string;
160
+ nodalPoint: "2";
161
+ salary: number;
162
+ } | {
163
+ code: string;
164
+ nodalPoint: "3a";
165
+ salary: number;
166
+ } | {
167
+ code: string;
168
+ nodalPoint: "3b";
169
+ salary: number;
170
+ } | {
171
+ code: string;
172
+ nodalPoint: "4a";
173
+ salary: number;
174
+ } | {
175
+ code: string;
176
+ nodalPoint: "4b";
177
+ salary: number;
178
+ } | {
179
+ code: string;
180
+ nodalPoint: "4c";
181
+ salary: number;
182
+ } | {
183
+ code: string;
184
+ nodalPoint: "5a";
185
+ salary: number;
186
+ } | {
187
+ code: string;
188
+ nodalPoint: "5b";
189
+ salary: number;
190
+ } | {
191
+ code: string;
192
+ nodalPoint: "5c";
193
+ salary: number;
194
+ })[];
195
+ readonly onCallAvailabilityAllowance: ({
196
+ nodalPoint: "1";
197
+ salary: number;
198
+ } | {
199
+ nodalPoint: "2";
200
+ salary: number;
201
+ } | {
202
+ nodalPoint: "3a";
203
+ salary: number;
204
+ } | {
205
+ nodalPoint: "3b";
206
+ salary: number;
207
+ } | {
208
+ nodalPoint: "4a";
209
+ salary: number;
210
+ } | {
211
+ nodalPoint: "4b";
212
+ salary: number;
213
+ } | {
214
+ nodalPoint: "4c";
215
+ salary: number;
216
+ } | {
217
+ nodalPoint: "5a";
218
+ salary: number;
219
+ } | {
220
+ nodalPoint: "5b";
221
+ salary: number;
222
+ } | {
223
+ nodalPoint: "5c";
224
+ salary: number;
225
+ })[];
61
226
  readonly consultant: {
62
227
  threshold: string;
63
228
  yearCompleted: number;
@@ -255,3 +420,4 @@ export declare const ENGLAND_MD_1_2026R: {
255
420
  readonly salary: 125251;
256
421
  }];
257
422
  };
423
+ export {};