@casomoltd/nhs-pay 0.31.0 → 0.33.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 (142) hide show
  1. package/README.md +25 -22
  2. package/dist/afc-scales.d.ts +43 -10
  3. package/dist/afc-scales.js +50 -16
  4. package/dist/afc-scales.js.map +1 -1
  5. package/dist/allowances.js +11 -11
  6. package/dist/allowances.js.map +1 -1
  7. package/dist/award.d.ts +3 -3
  8. package/dist/award.js +21 -21
  9. package/dist/award.js.map +1 -1
  10. package/dist/circulars/england-md-1-2026-r2.d.ts +13 -0
  11. package/dist/circulars/england-md-1-2026-r2.js +13 -0
  12. package/dist/circulars/england-md-1-2026-r2.js.map +1 -1
  13. package/dist/circulars/ni-hsc-tc8-05-2025.d.ts +22 -0
  14. package/dist/circulars/ni-hsc-tc8-05-2025.js +22 -0
  15. package/dist/circulars/ni-hsc-tc8-05-2025.js.map +1 -1
  16. package/dist/circulars/scotland-pcs-dd-2025-01.d.ts +20 -0
  17. package/dist/circulars/scotland-pcs-dd-2025-01.js +20 -0
  18. package/dist/circulars/scotland-pcs-dd-2025-01.js.map +1 -1
  19. package/dist/circulars/scotland-pcs-dd-2026-01.d.ts +19 -0
  20. package/dist/circulars/scotland-pcs-dd-2026-01.js +30 -10
  21. package/dist/circulars/scotland-pcs-dd-2026-01.js.map +1 -1
  22. package/dist/circulars/scotland-pcs-dd-2026-02.d.ts +10 -0
  23. package/dist/circulars/scotland-pcs-dd-2026-02.js +10 -0
  24. package/dist/circulars/scotland-pcs-dd-2026-02.js.map +1 -1
  25. package/dist/circulars/wales-mdw-01-2025.d.ts +17 -0
  26. package/dist/circulars/wales-mdw-01-2025.js +17 -0
  27. package/dist/circulars/wales-mdw-01-2025.js.map +1 -1
  28. package/dist/circulars/wales-mdw-01-2026.d.ts +20 -0
  29. package/dist/circulars/wales-mdw-01-2026.js +20 -0
  30. package/dist/circulars/wales-mdw-01-2026.js.map +1 -1
  31. package/dist/commutation.js +3 -2
  32. package/dist/commutation.js.map +1 -1
  33. package/dist/dental-grades.d.ts +25 -0
  34. package/dist/dental-grades.js +25 -0
  35. package/dist/dental-grades.js.map +1 -0
  36. package/dist/dental-scales.d.ts +5 -21
  37. package/dist/dental-scales.js +73 -72
  38. package/dist/dental-scales.js.map +1 -1
  39. package/dist/document-source.d.ts +32 -23
  40. package/dist/document-source.js +32 -10
  41. package/dist/document-source.js.map +1 -1
  42. package/dist/errors.d.ts +12 -1
  43. package/dist/errors.js +18 -1
  44. package/dist/errors.js.map +1 -1
  45. package/dist/factor-basis.d.ts +9 -3
  46. package/dist/factor-basis.js +40 -28
  47. package/dist/factor-basis.js.map +1 -1
  48. package/dist/format.js +3 -2
  49. package/dist/format.js.map +1 -1
  50. package/dist/hcas-pcts.d.ts +1 -1
  51. package/dist/hcas-zone.d.ts +23 -0
  52. package/dist/hcas-zone.js +17 -0
  53. package/dist/hcas-zone.js.map +1 -0
  54. package/dist/hcas.d.ts +26 -18
  55. package/dist/hcas.js +45 -24
  56. package/dist/hcas.js.map +1 -1
  57. package/dist/index.d.ts +27 -18
  58. package/dist/index.js +17 -13
  59. package/dist/index.js.map +1 -1
  60. package/dist/medical-grades.d.ts +33 -0
  61. package/dist/medical-grades.js +33 -0
  62. package/dist/medical-grades.js.map +1 -0
  63. package/dist/medical-scales.d.ts +10 -33
  64. package/dist/medical-scales.js +104 -158
  65. package/dist/medical-scales.js.map +1 -1
  66. package/dist/member/benefits.js +9 -4
  67. package/dist/member/benefits.js.map +1 -1
  68. package/dist/member/input-period.d.ts +18 -5
  69. package/dist/member/input-period.js +24 -13
  70. package/dist/member/input-period.js.map +1 -1
  71. package/dist/member/valuation.js +3 -6
  72. package/dist/member/valuation.js.map +1 -1
  73. package/dist/pay-round.js +3 -3
  74. package/dist/pay-round.js.map +1 -1
  75. package/dist/pay-year.d.ts +17 -0
  76. package/dist/pay-year.js +20 -0
  77. package/dist/pay-year.js.map +1 -0
  78. package/dist/pension/ledger.d.ts +7 -0
  79. package/dist/pension/ledger.js +26 -18
  80. package/dist/pension/ledger.js.map +1 -1
  81. package/dist/pension/money.d.ts +2 -0
  82. package/dist/pension/money.js +4 -0
  83. package/dist/pension/money.js.map +1 -1
  84. package/dist/pension/uplift.d.ts +25 -21
  85. package/dist/pension/uplift.js +27 -12
  86. package/dist/pension/uplift.js.map +1 -1
  87. package/dist/pension.js +2 -1
  88. package/dist/pension.js.map +1 -1
  89. package/dist/post.d.ts +20 -21
  90. package/dist/post.js +54 -53
  91. package/dist/post.js.map +1 -1
  92. package/dist/published/england-afc.d.ts +29 -0
  93. package/dist/published/england-afc.js +142 -0
  94. package/dist/published/england-afc.js.map +1 -0
  95. package/dist/published/hcas-zones.d.ts +18 -0
  96. package/dist/published/hcas-zones.js +46 -0
  97. package/dist/published/hcas-zones.js.map +1 -0
  98. package/dist/published/wales-living-wage.d.ts +36 -0
  99. package/dist/published/wales-living-wage.js +30 -0
  100. package/dist/published/wales-living-wage.js.map +1 -0
  101. package/dist/regions.d.ts +25 -14
  102. package/dist/regions.js +61 -71
  103. package/dist/regions.js.map +1 -1
  104. package/dist/resolver.d.ts +46 -41
  105. package/dist/resolver.js +70 -142
  106. package/dist/resolver.js.map +1 -1
  107. package/dist/revaluation.d.ts +27 -11
  108. package/dist/revaluation.js +46 -32
  109. package/dist/revaluation.js.map +1 -1
  110. package/dist/role.d.ts +3 -3
  111. package/dist/scale-point.d.ts +11 -7
  112. package/dist/scale-point.js +29 -1
  113. package/dist/scale-point.js.map +1 -1
  114. package/dist/scale-tables.d.ts +42 -60
  115. package/dist/scale-tables.js +65 -105
  116. package/dist/scale-tables.js.map +1 -1
  117. package/dist/scale-translators.d.ts +90 -0
  118. package/dist/scale-translators.js +97 -0
  119. package/dist/scale-translators.js.map +1 -0
  120. package/dist/scales.d.ts +138 -101
  121. package/dist/scales.js +221 -457
  122. package/dist/scales.js.map +1 -1
  123. package/dist/sections/final-salary.js +3 -11
  124. package/dist/sections/final-salary.js.map +1 -1
  125. package/dist/sections/section-2015.d.ts +1 -3
  126. package/dist/sections/section-2015.js +1 -1
  127. package/dist/sections/section-2015.js.map +1 -1
  128. package/dist/sources.d.ts +12 -12
  129. package/dist/sources.js +13 -15
  130. package/dist/sources.js.map +1 -1
  131. package/dist/take-home.js +1 -2
  132. package/dist/take-home.js.map +1 -1
  133. package/dist/values.d.ts +10 -3
  134. package/dist/values.js +11 -4
  135. package/dist/values.js.map +1 -1
  136. package/dist/working-week.d.ts +23 -8
  137. package/dist/working-week.js +55 -25
  138. package/dist/working-week.js.map +1 -1
  139. package/package.json +3 -3
  140. package/dist/bands.d.ts +0 -63
  141. package/dist/bands.js +0 -78
  142. package/dist/bands.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.js","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAC,mBAAmB,EAAE,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAClE,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAsE/B,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;QACtC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED,SAAS,CAAC,IAAI,EAAE,KAAK,EAA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,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAgB;IAEtD,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACzC,kEAAkE;IAClE,6CAA6C;IAC7C,aAAa,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,EACvD,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAClE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAC,EAAE;QACxD,IAAI,EAAE,KAAK;QACX,IAAI;QACJ,KAAK;QACL,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
@@ -28,14 +28,19 @@
28
28
  * "SPPA NHS Circular 2023/01 — pension indexation and CARE
29
29
  * revaluation" — the clearest annual statement of the exact NHS
30
30
  * in-service rate. Scotland, but the same CPI + 1.5% rule and
31
- * the same rate as England and Wales.
31
+ * the same rate as England and Wales. A rate source only: the
32
+ * date it gives, 10 April 2023, is superseded by SI 2023/252
33
+ * art 1(3), which brings the Order into force on 6 April 2023
34
+ * for all four NHS 2015 schemes (Northern Ireland's by NISR
35
+ * 2023/54 art 1(3)(b)).
32
36
  *
33
37
  * "NHS Pension Scheme Valuation Report 2020", Appendix E
34
38
  * "Inter-valuation events" — the in-service revaluation as
35
- * ACTUALLY APPLIED, year by year from April 2016, independent of
36
- * the orders. No rate is held here: the rule derives it from the
37
- * Order's CPI (`activeRatePct`), and the applied rates are the
38
- * test oracle in `tests/fixtures/revaluation-applied.csv`.
39
+ * ACTUALLY APPLIED, each year commencing April 2016 to April 2023,
40
+ * independent of the orders. No rate is transcribed here: each
41
+ * year's `activeRatePct` is the rule applied to the Order's CPI,
42
+ * and the applied rates are the test oracle in
43
+ * `tests/fixtures/revaluation-applied.csv`.
39
44
  *
40
45
  * "SI 2015/94 Sch 9 para 3 — revaluation": the NHS Pension
41
46
  * Scheme Regulations 2015 add 1.5 to the prices "increase or
@@ -56,10 +61,12 @@
56
61
  *
57
62
  * ── Three facts this data carries ───────────────────
58
63
  *
59
- * **The revaluation date moved.** It was 1 April; from 2023 it
60
- * is 6 April, changed to manage the interaction with the
61
- * annual allowance. `appliedOn` records it per year rather
62
- * than letting a scheme-year boundary be assumed.
64
+ * **The revaluation date is not fixed.** It is 1 April through
65
+ * 2022 and 6 April from 2023, to manage the interaction with the
66
+ * annual allowance; for 2023 the operative instrument is SI
67
+ * 2023/252 art 1(3), which names 6 April for the NHS schemes.
68
+ * `appliedOn` records it per year rather than letting a
69
+ * scheme-year boundary be assumed.
63
70
  *
64
71
  * **CPI is sourced independently of the rate**, never derived
65
72
  * from it. Taking `septemberCpiPct = rate - 1.5` would make
@@ -99,6 +106,7 @@
99
106
  * equivalent uplift is earnings dynamisation, not this.
100
107
  */
101
108
  import type { SchemeYearEnd } from './pension/scheme-year.js';
109
+ import type { IsoDate } from './iso-date.js';
102
110
  /** One scheme year's revaluation, and what set it. */
103
111
  export interface RevaluationYear {
104
112
  /** Scheme year END, e.g. 2022 for the 2021/22 year. */
@@ -118,15 +126,23 @@ export interface RevaluationYear {
118
126
  * date again (11 April in 2022, 6 April in 2026) belonging
119
127
  * to a different instrument. That is the trap on the 2022
120
128
  * row, where 11 April is the date a search turns up. */
121
- readonly appliedOn: string;
129
+ readonly appliedOn: IsoDate;
122
130
  /** The statutory instrument that made it. */
123
131
  readonly si: string;
132
+ /** The in-service rate the Order gives an active member, in
133
+ * percentage points: {@link activeRatePct} over
134
+ * `septemberCpiPct`, derived here once and never transcribed. */
135
+ readonly activeRatePct: number;
124
136
  }
125
137
  /** The bonus the scheme adds to CPI while a member is paying
126
138
  * in, in PERCENTAGE POINTS. Added, never compounded. */
127
139
  export declare const ACTIVE_REVAL_BONUS_PCT = 1.5;
128
- /** In-service revaluation, oldest first, each year a `SchemeYearEnd`. */
140
+ /** In-service revaluation, oldest first, each year a `SchemeYearEnd`
141
+ * with the active rate its Order gives. */
129
142
  export declare const IN_SERVICE_REVALUATION: readonly RevaluationYear[];
143
+ /** CPI + 1.5 points. A negative CPI is carried through, not
144
+ * floored: September 2015's −0.1 gave a 1.4% uplift, not 1.5%. */
145
+ export declare function activeRatePct(cpi: number): number;
130
146
  /** The published rate for a scheme year, or null where the
131
147
  * year isn't published — never a silent fallback. */
132
148
  export declare function revaluationFor(yearEnd: SchemeYearEnd): RevaluationYear | null;
@@ -28,14 +28,19 @@
28
28
  * "SPPA NHS Circular 2023/01 — pension indexation and CARE
29
29
  * revaluation" — the clearest annual statement of the exact NHS
30
30
  * in-service rate. Scotland, but the same CPI + 1.5% rule and
31
- * the same rate as England and Wales.
31
+ * the same rate as England and Wales. A rate source only: the
32
+ * date it gives, 10 April 2023, is superseded by SI 2023/252
33
+ * art 1(3), which brings the Order into force on 6 April 2023
34
+ * for all four NHS 2015 schemes (Northern Ireland's by NISR
35
+ * 2023/54 art 1(3)(b)).
32
36
  *
33
37
  * "NHS Pension Scheme Valuation Report 2020", Appendix E
34
38
  * "Inter-valuation events" — the in-service revaluation as
35
- * ACTUALLY APPLIED, year by year from April 2016, independent of
36
- * the orders. No rate is held here: the rule derives it from the
37
- * Order's CPI (`activeRatePct`), and the applied rates are the
38
- * test oracle in `tests/fixtures/revaluation-applied.csv`.
39
+ * ACTUALLY APPLIED, each year commencing April 2016 to April 2023,
40
+ * independent of the orders. No rate is transcribed here: each
41
+ * year's `activeRatePct` is the rule applied to the Order's CPI,
42
+ * and the applied rates are the test oracle in
43
+ * `tests/fixtures/revaluation-applied.csv`.
39
44
  *
40
45
  * "SI 2015/94 Sch 9 para 3 — revaluation": the NHS Pension
41
46
  * Scheme Regulations 2015 add 1.5 to the prices "increase or
@@ -56,10 +61,12 @@
56
61
  *
57
62
  * ── Three facts this data carries ───────────────────
58
63
  *
59
- * **The revaluation date moved.** It was 1 April; from 2023 it
60
- * is 6 April, changed to manage the interaction with the
61
- * annual allowance. `appliedOn` records it per year rather
62
- * than letting a scheme-year boundary be assumed.
64
+ * **The revaluation date is not fixed.** It is 1 April through
65
+ * 2022 and 6 April from 2023, to manage the interaction with the
66
+ * annual allowance; for 2023 the operative instrument is SI
67
+ * 2023/252 art 1(3), which names 6 April for the NHS schemes.
68
+ * `appliedOn` records it per year rather than letting a
69
+ * scheme-year boundary be assumed.
63
70
  *
64
71
  * **CPI is sourced independently of the rate**, never derived
65
72
  * from it. Taking `septemberCpiPct = rate - 1.5` would make
@@ -99,11 +106,7 @@
99
106
  * equivalent uplift is earnings dynamisation, not this.
100
107
  */
101
108
  import { schemeYearEnd } from './pension/scheme-year.js';
102
- /** April, as `Date` counts months from nought. */
103
- const APRIL_MONTH_INDEX = 3;
104
- /** The day of April the scheme applies an Order from 2023, and so the day
105
- * a year with no Order yet is read as moving on. */
106
- const UPLIFT_DAY_FROM_2023 = 6;
109
+ import { isoDate, isoToDate } from './iso-date.js';
107
110
  /** The bonus the scheme adds to CPI while a member is paying
108
111
  * in, in PERCENTAGE POINTS. Added, never compounded. */
109
112
  export const ACTIVE_REVAL_BONUS_PCT = 1.5;
@@ -122,72 +125,87 @@ const REVALUATION_ROWS = [
122
125
  // qualifier.
123
126
  yearEnd: 2016,
124
127
  septemberCpiPct: -0.1,
125
- appliedOn: '2016-04-01',
128
+ appliedOn: isoDate('2016-04-01'),
126
129
  si: 'SI 2016/438',
127
130
  },
128
131
  {
129
132
  yearEnd: 2017,
130
133
  septemberCpiPct: 1.0,
131
- appliedOn: '2017-04-01',
134
+ appliedOn: isoDate('2017-04-01'),
132
135
  si: 'SI 2017/242',
133
136
  },
134
137
  {
135
138
  yearEnd: 2018,
136
139
  septemberCpiPct: 3.0,
137
- appliedOn: '2018-04-01',
140
+ appliedOn: isoDate('2018-04-01'),
138
141
  si: 'SI 2018/338',
139
142
  },
140
143
  {
141
144
  yearEnd: 2019,
142
145
  septemberCpiPct: 2.4,
143
- appliedOn: '2019-04-01',
146
+ appliedOn: isoDate('2019-04-01'),
144
147
  si: 'SI 2019/455',
145
148
  },
146
149
  {
147
150
  yearEnd: 2020,
148
151
  septemberCpiPct: 1.7,
149
- appliedOn: '2020-04-01',
152
+ appliedOn: isoDate('2020-04-01'),
150
153
  si: 'SI 2020/230',
151
154
  },
152
155
  {
153
156
  yearEnd: 2021,
154
157
  septemberCpiPct: 0.5,
155
- appliedOn: '2021-04-01',
158
+ appliedOn: isoDate('2021-04-01'),
156
159
  si: 'SI 2021/276',
157
160
  },
158
161
  {
159
162
  yearEnd: 2022,
160
163
  septemberCpiPct: 3.1,
161
- appliedOn: '2022-04-01',
164
+ appliedOn: isoDate('2022-04-01'),
162
165
  si: 'SI 2022/215',
163
166
  },
164
167
  {
165
168
  yearEnd: 2023,
166
169
  septemberCpiPct: 10.1,
167
- appliedOn: '2023-04-06',
170
+ appliedOn: isoDate('2023-04-06'),
168
171
  si: 'SI 2023/252',
169
172
  },
170
173
  {
171
174
  yearEnd: 2024,
172
175
  septemberCpiPct: 6.7,
173
- appliedOn: '2024-04-06',
176
+ appliedOn: isoDate('2024-04-06'),
174
177
  si: 'SI 2024/290',
175
178
  },
176
179
  {
177
180
  yearEnd: 2025,
178
181
  septemberCpiPct: 1.7,
179
- appliedOn: '2025-04-06',
182
+ appliedOn: isoDate('2025-04-06'),
180
183
  si: 'SI 2025/252',
181
184
  },
182
185
  {
183
186
  yearEnd: 2026,
184
187
  septemberCpiPct: 3.8,
185
- appliedOn: '2026-04-06',
188
+ appliedOn: isoDate('2026-04-06'),
186
189
  si: 'SI 2026/254',
187
190
  },
188
191
  ];
189
- /** In-service revaluation, oldest first, each year a `SchemeYearEnd`. */
190
- export const IN_SERVICE_REVALUATION = REVALUATION_ROWS.map((row) => ({ ...row, yearEnd: schemeYearEnd(row.yearEnd) }));
192
+ /** In-service revaluation, oldest first, each year a `SchemeYearEnd`
193
+ * with the active rate its Order gives. */
194
+ export const IN_SERVICE_REVALUATION = REVALUATION_ROWS.map((row) => ({
195
+ ...row,
196
+ yearEnd: schemeYearEnd(row.yearEnd),
197
+ activeRatePct: activeRatePct(row.septemberCpiPct),
198
+ }));
199
+ /** April, as `Date` counts months from nought. */
200
+ const APRIL_MONTH_INDEX = 3;
201
+ /** The day of April the scheme applies an Order from 2023, and so the day
202
+ * a year with no Order yet is read as moving on. */
203
+ const UPLIFT_DAY_FROM_2023 = 6;
204
+ /** CPI + 1.5 points. A negative CPI is carried through, not
205
+ * floored: September 2015's −0.1 gave a 1.4% uplift, not 1.5%. */
206
+ export function activeRatePct(cpi) {
207
+ return cpi + ACTIVE_REVAL_BONUS_PCT;
208
+ }
191
209
  /** The published rate for a scheme year, or null where the
192
210
  * year isn't published — never a silent fallback. */
193
211
  export function revaluationFor(yearEnd) {
@@ -210,10 +228,6 @@ export function appliedOnFor(yearEnd) {
210
228
  if (published === null) {
211
229
  return new Date(yearEnd, APRIL_MONTH_INDEX, UPLIFT_DAY_FROM_2023);
212
230
  }
213
- const [y, m, d] = published.appliedOn.split('-').map(Number);
214
- // Built LOCAL, matching every other date in this library:
215
- // parsing the ISO string gives UTC midnight, and under BST
216
- // the two conventions sit an hour apart.
217
- return new Date(y, m - 1, d);
231
+ return isoToDate(published.appliedOn);
218
232
  }
219
233
  //# sourceMappingURL=revaluation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"revaluation.js","sourceRoot":"","sources":["../src/revaluation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAGvD,kDAAkD;AAClD,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B;qDACqD;AACrD,MAAM,o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;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,OAAsB;IACjD,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;QACvB,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC"}
package/dist/role.d.ts CHANGED
@@ -9,11 +9,11 @@
9
9
  *
10
10
  * `afc`, `vsm`, `medical` and `dental` all ship today.
11
11
  */
12
- import type { AfcBandId } from './scales.js';
12
+ import type { AfcBandId } from './afc-band.js';
13
13
  import type { ScalePoint } from './scale-point.js';
14
14
  import type { AfcRegionId } from './regions.js';
15
- import type { MedicalGradeId } from './medical-scales.js';
16
- import type { DentalGradeId } from './dental-scales.js';
15
+ import type { MedicalGradeId } from './medical-grades.js';
16
+ import type { DentalGradeId } from './dental-grades.js';
17
17
  import type { Nation } from '@casomoltd/paye-calc';
18
18
  /** An Agenda-for-Change post: a band at a point, in a region. */
19
19
  export interface AfcRole {
@@ -1,10 +1,4 @@
1
- /**
2
- * The canonical pay-scale point — the single shape every pay scale
3
- * reduces to (AfC band points, medical grades, dental spines), read by
4
- * the resolvers to build a Post. Domain-neutral: it belongs to no one
5
- * pay family, which is why it lives here rather than in any one scale
6
- * file.
7
- */
1
+ import type { ScaleUnavailable } from './errors.js';
8
2
  export interface ScalePoint {
9
3
  /** The point's own step identity: a band point, pay-scale code,
10
4
  * training stage, consultant threshold, or dental band + point. */
@@ -50,3 +44,13 @@ export interface PayLadder {
50
44
  readonly points: readonly SteppedPoint[];
51
45
  readonly current: SteppedPoint;
52
46
  }
47
+ /**
48
+ * The one point labelled `label` among `points`, or a throw: none is
49
+ * {@link ScaleUnavailable}, several is {@link AmbiguousScalePoint}. `scale`
50
+ * names the band or grade for the error.
51
+ *
52
+ * Loud, not first-match, on every family's path. Where a label names
53
+ * several points the caller has asked a question the data cannot answer,
54
+ * and the salaries happening to agree today is not a reason to guess.
55
+ */
56
+ export declare function onlyPointLabelled<P extends ScalePoint>(points: readonly P[], label: string, scale: string, unavailable: () => ScaleUnavailable): P;
@@ -1,2 +1,30 @@
1
- export {};
1
+ /**
2
+ * The canonical pay-scale point — the single shape every pay scale
3
+ * reduces to (AfC band points, medical grades, dental spines), read by
4
+ * the resolvers to build a Post, with `PayLadder` (a scale's points and
5
+ * the member's own) and `onlyPointLabelled`, the rule every family's
6
+ * label lookup applies. Domain-neutral: it belongs to no one pay family,
7
+ * which is why it lives here rather than in any one scale file.
8
+ */
9
+ import { AmbiguousScalePoint } from './errors.js';
10
+ /**
11
+ * The one point labelled `label` among `points`, or a throw: none is
12
+ * {@link ScaleUnavailable}, several is {@link AmbiguousScalePoint}. `scale`
13
+ * names the band or grade for the error.
14
+ *
15
+ * Loud, not first-match, on every family's path. Where a label names
16
+ * several points the caller has asked a question the data cannot answer,
17
+ * and the salaries happening to agree today is not a reason to guess.
18
+ */
19
+ export function onlyPointLabelled(points, label, scale, unavailable) {
20
+ const matches = points.filter((p) => p.label === label);
21
+ const [first] = matches;
22
+ if (first === undefined) {
23
+ throw unavailable();
24
+ }
25
+ if (matches.length > 1) {
26
+ throw new AmbiguousScalePoint(scale, label, matches.length);
27
+ }
28
+ return first;
29
+ }
2
30
  //# sourceMappingURL=scale-point.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scale-point.js","sourceRoot":"","sources":["../src/scale-point.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"scale-point.js","sourceRoot":"","sources":["../src/scale-point.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAmDhD;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAoB,EACpB,KAAa,EACb,KAAa,EACb,WAAmC;IAEnC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;IACxB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,WAAW,EAAE,CAAC;IACtB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -5,9 +5,10 @@
5
5
  * `(grade, nation, year)` and resolve to `ScalePoint[]`, uniform with
6
6
  * AfC. Verbatim transcription lives in `circulars/*`; the per-family
7
7
  * selection + mapping lives in the translation layers
8
- * (`medical-scales.ts`, `dental-scales.ts`). This module owns only the
9
- * canonical container, the grouping accessor, and the translators
10
- * generic enough to be shared across both families.
8
+ * (`medical-scales.ts`, `dental-scales.ts`), with the row translators
9
+ * they share in `scale-translators.ts`. This module owns the canonical
10
+ * container and the family object every read goes through
11
+ * ({@link gradeFamily}).
11
12
  */
12
13
  import type { Nation, PayYear, YearLabel } from '@casomoltd/paye-calc';
13
14
  import type { DocumentSource } from './document-source.js';
@@ -39,6 +40,39 @@ export interface GradeMeta<G extends string> {
39
40
  }
40
41
  /** Canonical basic-pay tables keyed year → nation → grade → scale. */
41
42
  export type GradeScaleTables<G extends string> = Partial<Record<YearLabel, Partial<Record<Nation, Partial<Record<G, GradeScale>>>>>>;
43
+ /**
44
+ * One nation-based pay family (medical, dental): every read over its
45
+ * tables, so the families share one implementation rather than two
46
+ * copies that can drift.
47
+ */
48
+ export interface GradeFamily<G extends string> {
49
+ /** Pay years with a published table, newest first. */
50
+ readonly years: readonly PayYear[];
51
+ /** The grades published for a nation and year, in the family's grade
52
+ * order. Throws {@link ScaleUnavailable} where none is published,
53
+ * rather than defaulting to another nation's or year's figures. */
54
+ scalesFor(year: PayYear, nation: Nation): GradeMeta<G>[];
55
+ /** True where the nation and year publish `grade`: the non-throwing
56
+ * question a consumer asks before reading a year it is not sure of. */
57
+ publishes(grade: G, year: PayYear, nation: Nation): boolean;
58
+ /** The points of one grade's scale. Throws {@link ScaleUnavailable}
59
+ * where the nation and year do not publish it. */
60
+ pointsFor(grade: G, year: PayYear, nation: Nation): readonly ScalePoint[];
61
+ /** The newest year the family publishes any grade for a nation, or null
62
+ * where it publishes none. */
63
+ latestYear(nation: Nation): PayYear | null;
64
+ /** The newest year the family publishes `grade` for a nation, or null. */
65
+ latestYearOf(grade: G, nation: Nation): PayYear | null;
66
+ /** The newest document of the newest year the family publishes for a
67
+ * nation: by issue date among that year's grades, so a round split
68
+ * over two circulars cites the later one, and a nation behind cites
69
+ * its last year's. */
70
+ latestSource(nation: Nation): DocumentSource;
71
+ /** The document that publishes one grade's scale. Throws
72
+ * {@link ScaleUnavailable} where the nation and year publish a table
73
+ * but not this grade. */
74
+ sourceFor(grade: G, year: PayYear, nation: Nation): DocumentSource;
75
+ }
42
76
  /**
43
77
  * Bind every grade in a mapping to the document it was read from.
44
78
  *
@@ -60,62 +94,10 @@ export declare function fromDocument<G extends string>(source: DocumentSource, p
60
94
  *
61
95
  * A grade can have exactly one publishing circular in a nation and
62
96
  * year. Spreading two partial records instead would let the later one
63
- * win in silence — the same first-match-by-accident this module's
64
- * callers were rewritten to stop doing.
97
+ * win in silence, so the grade's figures would be whichever document was
98
+ * listed last rather than the one that publishes them.
65
99
  */
66
100
  export declare function combineScales<G extends string>(...parts: Partial<Record<G, GradeScale>>[]): Partial<Record<G, GradeScale>>;
67
- /**
68
- * Group a nation/year's grades into metas, in `gradeIds` order. `year`
69
- * and `nation` are both required; an absent combination throws
70
- * {@link ScaleUnavailable} rather than defaulting to another nation's
71
- * or year's figures.
72
- */
73
- export declare function resolveGradeMetas<G extends string>(tables: GradeScaleTables<G>, gradeIds: readonly G[], year: PayYear, nation: Nation): GradeMeta<G>[];
74
- /**
75
- * An incremental scale with no distinct labels beyond position: the
76
- * first point is "Minimum", the rest "Point 1", "Point 2", … (the
77
- * devolved training grades). Input is the salary column, top to bottom.
78
- */
79
- export declare const stepped: (salaries: readonly number[]) => readonly ScalePoint[];
80
- /** A two-point salary range (salaried GP), min then max. */
81
- export declare const range: (r: SalaryRange) => readonly ScalePoint[];
82
- /** Plain "Point 1", "Point 2"… labelling (1-based). */
83
- export declare const numbered: (salaries: readonly number[]) => readonly ScalePoint[];
84
- /**
85
- * One point per row, labelled by the row's `stage` (training grades).
86
- * Carries the row's `nodalPoint` onto the point where the source lists one
87
- * (the 2016-contract resident scales); rows without it stay stage-only.
88
- */
89
- export declare const byStage: (rows: readonly {
90
- stage: string;
91
- salary: number;
92
- nodalPoint?: string;
93
- }[]) => readonly ScalePoint[];
94
- /**
95
- * One point per row, labelled by the row's pay-scale `code`. Carries
96
- * whichever axis the source lists beside the code, because the code
97
- * alone is opaque: `yearsExperience` for the SAS scales, `nodalPoint`
98
- * for locally employed doctors, whose codes England publishes against
99
- * the 2016-contract points and NOT in code order. Rows with neither
100
- * (GP educators, closed grades) stay code-only.
101
- */
102
- export declare const byCode: (rows: readonly {
103
- code: string;
104
- salary: number;
105
- yearsExperience?: number;
106
- nodalPoint?: string;
107
- }[]) => readonly ScalePoint[];
108
- /** One point per row, labelled "Band {band} Point {point}" (dental spine). */
109
- export declare const bySpine: (rows: readonly {
110
- band: string | number;
111
- point: number;
112
- salary: number;
113
- }[]) => readonly ScalePoint[];
114
- /**
115
- * The `salaries` of the named incremental scale in a circular's list.
116
- * Fails loud (at module load) on a mapping key that doesn't match a
117
- * source scale — a translation-layer typo can't ship silently.
118
- */
119
- export declare const scaleSalaries: <T extends {
120
- salaries: readonly number[];
121
- }>(rows: readonly T[], match: (r: T) => boolean, key: string) => readonly number[];
101
+ /** Build a {@link GradeFamily} over a family's tables, reading grades in
102
+ * `gradeIds` order. */
103
+ export declare function gradeFamily<G extends string>(tables: GradeScaleTables<G>, gradeIds: readonly G[]): GradeFamily<G>;