@casomoltd/nhs-pay 0.19.4 → 0.21.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 (90) hide show
  1. package/README.md +95 -18
  2. package/dist/afc-scales.d.ts +14 -7
  3. package/dist/afc-scales.js +19 -19
  4. package/dist/afc-scales.js.map +1 -1
  5. package/dist/bands.d.ts +2 -2
  6. package/dist/commutation.d.ts +49 -5
  7. package/dist/commutation.js +124 -43
  8. package/dist/commutation.js.map +1 -1
  9. package/dist/dates.d.ts +2 -0
  10. package/dist/dates.js +4 -0
  11. package/dist/dates.js.map +1 -1
  12. package/dist/errors.d.ts +70 -12
  13. package/dist/errors.js +85 -19
  14. package/dist/errors.js.map +1 -1
  15. package/dist/factor-basis.d.ts +87 -0
  16. package/dist/factor-basis.js +99 -0
  17. package/dist/factor-basis.js.map +1 -0
  18. package/dist/gad/erf-1-401-2023-06-30.d.ts +47 -0
  19. package/dist/gad/erf-1-401-2023-06-30.js +73 -0
  20. package/dist/gad/erf-1-401-2023-06-30.js.map +1 -0
  21. package/dist/gad/erf-1-402-2023-06-30.d.ts +48 -0
  22. package/dist/gad/erf-1-402-2023-06-30.js +84 -0
  23. package/dist/gad/erf-1-402-2023-06-30.js.map +1 -0
  24. package/dist/gad/erf-1-407-2023-06-30.d.ts +47 -0
  25. package/dist/gad/erf-1-407-2023-06-30.js +73 -0
  26. package/dist/gad/erf-1-407-2023-06-30.js.map +1 -0
  27. package/dist/gad/erf-2023-06-30.d.ts +3 -0
  28. package/dist/gad/erf-2023-06-30.js +1 -0
  29. package/dist/gad/erf-2023-06-30.js.map +1 -1
  30. package/dist/gad/factor-table.d.ts +62 -31
  31. package/dist/gad/factor-table.js +67 -34
  32. package/dist/gad/factor-table.js.map +1 -1
  33. package/dist/gad/lrf-2-416-2023-06-30.d.ts +46 -0
  34. package/dist/gad/lrf-2-416-2023-06-30.js +72 -0
  35. package/dist/gad/lrf-2-416-2023-06-30.js.map +1 -0
  36. package/dist/gad/lrf-2023-06-30.d.ts +3 -0
  37. package/dist/gad/lrf-2023-06-30.js +1 -0
  38. package/dist/gad/lrf-2023-06-30.js.map +1 -1
  39. package/dist/gad/promotional-scale-2020.d.ts +37 -0
  40. package/dist/gad/promotional-scale-2020.js +38 -0
  41. package/dist/gad/promotional-scale-2020.js.map +1 -0
  42. package/dist/index.d.ts +17 -4
  43. package/dist/index.js +22 -13
  44. package/dist/index.js.map +1 -1
  45. package/dist/iso-date.d.ts +7 -0
  46. package/dist/iso-date.js +11 -0
  47. package/dist/iso-date.js.map +1 -1
  48. package/dist/member-benefits.d.ts +237 -0
  49. package/dist/member-benefits.js +440 -0
  50. package/dist/member-benefits.js.map +1 -0
  51. package/dist/pay-path.d.ts +70 -0
  52. package/dist/pay-path.js +155 -0
  53. package/dist/pay-path.js.map +1 -0
  54. package/dist/pension/curve.d.ts +74 -0
  55. package/dist/pension/curve.js +134 -0
  56. package/dist/pension/curve.js.map +1 -0
  57. package/dist/pension/history.js +3 -3
  58. package/dist/pension/history.js.map +1 -1
  59. package/dist/pension/ledger.d.ts +71 -31
  60. package/dist/pension/ledger.js +41 -6
  61. package/dist/pension/ledger.js.map +1 -1
  62. package/dist/pension/money.d.ts +23 -6
  63. package/dist/pension/money.js +23 -1
  64. package/dist/pension/money.js.map +1 -1
  65. package/dist/pension/uplift.d.ts +23 -0
  66. package/dist/pension/uplift.js +34 -1
  67. package/dist/pension/uplift.js.map +1 -1
  68. package/dist/pension-projection.d.ts +54 -52
  69. package/dist/pension-projection.js +65 -219
  70. package/dist/pension-projection.js.map +1 -1
  71. package/dist/scale-point.d.ts +11 -1
  72. package/dist/scales.d.ts +9 -9
  73. package/dist/scales.js +68 -67
  74. package/dist/scales.js.map +1 -1
  75. package/dist/sections/final-salary.d.ts +97 -0
  76. package/dist/sections/final-salary.js +99 -0
  77. package/dist/sections/final-salary.js.map +1 -0
  78. package/dist/sections/section-1995.d.ts +20 -0
  79. package/dist/sections/section-1995.js +52 -0
  80. package/dist/sections/section-1995.js.map +1 -0
  81. package/dist/sections/section-2008.d.ts +16 -0
  82. package/dist/sections/section-2008.js +44 -0
  83. package/dist/sections/section-2008.js.map +1 -0
  84. package/dist/sections/section-2015.d.ts +43 -0
  85. package/dist/sections/section-2015.js +57 -0
  86. package/dist/sections/section-2015.js.map +1 -0
  87. package/dist/values.d.ts +4 -5
  88. package/dist/values.js +4 -5
  89. package/dist/values.js.map +1 -1
  90. package/package.json +9 -5
@@ -1 +1 @@
1
- {"version":3,"file":"commutation.js","sourceRoot":"","sources":["../src/commutation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAItC,uDAAuD;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,uDAAuD;AACvD,gEAAgE;AAChE,8DAA8D;AAC9D,8DAA8D;AAC9D,0DAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,uDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACd,CAAC;AAiEX;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAc;IAEd,OAAO;QACL,iBAAiB,EAAE,kBAAkB;QACrC,SAAS,EAAE,EAAC,MAAM,EAAE,kBAAkB,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AAO;YACL,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;YACvD,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;SACnD,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC;IACjC,IAAI,KAAK,GAAG,SAAS,CAAC,IAAI,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QACzD,MAAM,IAAI,UAAU,CAClB,WAAW,KAAK,0CAA0C;cACxD,aAAa,SAAS,CAAC,IAAI,kBAAkB;cAC7C,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAC1B,CAAC;IACJ,CAAC;IACD,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC;QAC3D,IAAI,EAAE,KAAK;KACZ,CAAC;AACJ,CAAC"}
package/dist/dates.d.ts CHANGED
@@ -47,3 +47,5 @@ export declare function yearsBetween(from: Date, to: Date): number;
47
47
  * would move NPA a day earlier to 28 Feb.
48
48
  */
49
49
  export declare function npaDate(dateOfBirth: Date, npa: number): Date;
50
+ /** The earliest of some dates. */
51
+ export declare function earliest(...dates: readonly Date[]): Date;
package/dist/dates.js CHANGED
@@ -83,4 +83,8 @@ export function yearsBetween(from, to) {
83
83
  export function npaDate(dateOfBirth, npa) {
84
84
  return new Date(dateOfBirth.getFullYear() + npa, dateOfBirth.getMonth(), dateOfBirth.getDate());
85
85
  }
86
+ /** The earliest of some dates. */
87
+ export function earliest(...dates) {
88
+ return new Date(Math.min(...dates.map((d) => d.getTime())));
89
+ }
86
90
  //# sourceMappingURL=dates.js.map
package/dist/dates.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file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,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC"}
package/dist/errors.d.ts CHANGED
@@ -1,13 +1,24 @@
1
1
  /**
2
- * Fail-loud machinery. Two kinds, kept together:
3
- * - Errors for absent pay data — part of the API contract,
4
- * caught by type (see {@link ScaleUnavailable} & siblings).
5
- * Never silently substitute another year's or nation's figures.
2
+ * Fail-loud machinery. Three kinds, kept together:
3
+ * - Errors a caller catches by type, part of the API contract: data
4
+ * the library does not publish ({@link ScaleUnavailable} and
5
+ * siblings — never silently substitute another year's or nation's
6
+ * figures), a member it cannot build pay for
7
+ * ({@link PayPathUnavailable}), and service it does not model
8
+ * ({@link BenefitNotModelled}, keyed by a {@link NOT_MODELLED}
9
+ * code).
10
+ * - RangeError, thrown where a caller's input cannot be true.
6
11
  * - {@link invariant} — an internal consistency guard. Its failure
7
12
  * is a library bug, not an input problem, so no caller catches it;
8
13
  * it throws a bare Error to fail loud in tests and pages.
9
14
  */
10
15
  import type { Nation, PayYear, TaxYear } from '@casomoltd/paye-calc';
16
+ import type { FactorProvenance, FactorTableIndex } from './gad/factor-table.js';
17
+ /** A span, or an age, to the month: how a GAD table is keyed. */
18
+ interface YearsMonths {
19
+ readonly years: number;
20
+ readonly months: number;
21
+ }
11
22
  /**
12
23
  * Assert a domain invariant that must ALWAYS hold. Throws a bare
13
24
  * Error when `condition` is false. Unlike the absent-data errors
@@ -54,22 +65,36 @@ export declare class PensionTiersUnavailable extends Error {
54
65
  constructor(year: TaxYear, nation: Nation);
55
66
  }
56
67
  /**
57
- * Thrown when a retirement period falls outside the printed GAD
58
- * factor table — e.g. more than 13y0m early under the 30 Jun 2023
59
- * ERF1. Sibling of {@link ScaleUnavailable}: the factor genuinely
60
- * isn't published for that period, so callers with free date
61
- * inputs catch it by type rather than matching message text.
68
+ * Thrown when a drawing falls outside the printed GAD factor table —
69
+ * e.g. more than 13y0m early under 0-420, or an age below 50 on 1-401.
70
+ * Sibling of {@link ScaleUnavailable}: the factor genuinely isn't
71
+ * published, so callers with free date inputs catch it by type rather
72
+ * than matching message text.
73
+ *
74
+ * `tableRef` names the table; `guidanceRef` alone does not, because the
75
+ * guidance numbers each scheme's tables from 1 and so `ERF1` is both
76
+ * 0-420 and 1-401. `years`, `months` and the bounds are a PERIOD from
77
+ * the pension age on a period table and the member's AGE on an age
78
+ * table, which `keyedBy` says.
62
79
  */
63
80
  export declare class RetirementFactorOutOfRange extends Error {
64
81
  /** Table name in the governing guidance, e.g. 'ERF1' */
65
82
  readonly guidanceRef: string;
83
+ /** GAD's table reference, e.g. '0-420': unique, where
84
+ * `guidanceRef` is not. */
85
+ readonly tableRef: string;
86
+ readonly keyedBy: FactorTableIndex;
66
87
  readonly years: number;
67
88
  readonly months: number;
68
89
  readonly maxYears: number;
69
90
  readonly maxMonths: number;
70
- constructor(
71
- /** Table name in the governing guidance, e.g. 'ERF1' */
72
- guidanceRef: string, years: number, months: number, maxYears: number, maxMonths: number);
91
+ constructor({ provenance, index, at, max }: {
92
+ readonly provenance: FactorProvenance;
93
+ readonly index: FactorTableIndex;
94
+ /** Where the drawing fell, and the furthest the table prints. */
95
+ readonly at: YearsMonths;
96
+ readonly max: YearsMonths;
97
+ });
73
98
  }
74
99
  /**
75
100
  * Thrown when no AfC pay award (consolidated % uplift) is recorded
@@ -100,3 +125,36 @@ export declare class AmbiguousScalePoint extends Error {
100
125
  readonly matches: number;
101
126
  constructor(grade: string, pointLabel: string, matches: number);
102
127
  }
128
+ /**
129
+ * There is nothing to build a member's pay from: no usable current
130
+ * pay. Every year the pay path reconstructs or projects is scaled from
131
+ * that one figure, so without it there is no figure to scale, and any
132
+ * substitute would be a guess presented as the member's pay.
133
+ */
134
+ export declare class PayPathUnavailable extends Error {
135
+ readonly reason: string;
136
+ constructor(reason: string);
137
+ }
138
+ /** What {@link BenefitNotModelled} refuses, as a closed set a
139
+ * consumer can branch on. Each is deferred, and each names the issue
140
+ * that carries what a build would take. */
141
+ export declare const NOT_MODELLED: {
142
+ readonly breakInService: "break-in-service";
143
+ readonly bothLegacySections: "both-legacy-sections";
144
+ readonly no2015Section: "no-2015-section";
145
+ readonly remedyMemberLeftEarly: "remedy-member-left-before-2022";
146
+ readonly statementBeforeRollback: "statement-before-rollback";
147
+ readonly preservedDrawnEarly: "preserved-benefits-drawn-early";
148
+ };
149
+ export type NotModelled = (typeof NOT_MODELLED)[keyof typeof NOT_MODELLED];
150
+ /**
151
+ * A benefit the library can name but has not modelled, refused rather
152
+ * than priced on an assumption nobody would see. `code` says which, so
153
+ * a consumer can tell a member what cannot yet be answered instead of
154
+ * showing a figure that answers something else.
155
+ */
156
+ export declare class BenefitNotModelled extends Error {
157
+ readonly code: NotModelled;
158
+ constructor(code: NotModelled, detail: string);
159
+ }
160
+ export {};
package/dist/errors.js CHANGED
@@ -1,8 +1,13 @@
1
1
  /**
2
- * Fail-loud machinery. Two kinds, kept together:
3
- * - Errors for absent pay data — part of the API contract,
4
- * caught by type (see {@link ScaleUnavailable} & siblings).
5
- * Never silently substitute another year's or nation's figures.
2
+ * Fail-loud machinery. Three kinds, kept together:
3
+ * - Errors a caller catches by type, part of the API contract: data
4
+ * the library does not publish ({@link ScaleUnavailable} and
5
+ * siblings — never silently substitute another year's or nation's
6
+ * figures), a member it cannot build pay for
7
+ * ({@link PayPathUnavailable}), and service it does not model
8
+ * ({@link BenefitNotModelled}, keyed by a {@link NOT_MODELLED}
9
+ * code).
10
+ * - RangeError, thrown where a caller's input cannot be true.
6
11
  * - {@link invariant} — an internal consistency guard. Its failure
7
12
  * is a library bug, not an input problem, so no caller catches it;
8
13
  * it throws a bare Error to fail loud in tests and pages.
@@ -65,29 +70,45 @@ export class PensionTiersUnavailable extends Error {
65
70
  }
66
71
  }
67
72
  /**
68
- * Thrown when a retirement period falls outside the printed GAD
69
- * factor table — e.g. more than 13y0m early under the 30 Jun 2023
70
- * ERF1. Sibling of {@link ScaleUnavailable}: the factor genuinely
71
- * isn't published for that period, so callers with free date
72
- * inputs catch it by type rather than matching message text.
73
+ * Thrown when a drawing falls outside the printed GAD factor table —
74
+ * e.g. more than 13y0m early under 0-420, or an age below 50 on 1-401.
75
+ * Sibling of {@link ScaleUnavailable}: the factor genuinely isn't
76
+ * published, so callers with free date inputs catch it by type rather
77
+ * than matching message text.
78
+ *
79
+ * `tableRef` names the table; `guidanceRef` alone does not, because the
80
+ * guidance numbers each scheme's tables from 1 and so `ERF1` is both
81
+ * 0-420 and 1-401. `years`, `months` and the bounds are a PERIOD from
82
+ * the pension age on a period table and the member's AGE on an age
83
+ * table, which `keyedBy` says.
73
84
  */
74
85
  export class RetirementFactorOutOfRange extends Error {
86
+ /** Table name in the governing guidance, e.g. 'ERF1' */
75
87
  guidanceRef;
88
+ /** GAD's table reference, e.g. '0-420': unique, where
89
+ * `guidanceRef` is not. */
90
+ tableRef;
91
+ keyedBy;
76
92
  years;
77
93
  months;
78
94
  maxYears;
79
95
  maxMonths;
80
- constructor(
81
- /** Table name in the governing guidance, e.g. 'ERF1' */
82
- guidanceRef, years, months, maxYears, maxMonths) {
83
- super(`${guidanceRef} out of range: ${years}yr ${months}mo `
84
- + `(max ${maxYears}yr ${maxMonths}mo)`);
85
- this.guidanceRef = guidanceRef;
86
- this.years = years;
87
- this.months = months;
88
- this.maxYears = maxYears;
89
- this.maxMonths = maxMonths;
96
+ constructor({ provenance, index, at, max }) {
97
+ const { tableRef, guidanceRef } = provenance;
98
+ super(index.by === 'period'
99
+ ? `${tableRef} (${guidanceRef}) out of range: ${at.years}yr `
100
+ + `${at.months}mo (max ${max.years}yr ${max.months}mo)`
101
+ : `${tableRef} (${guidanceRef}): age ${at.years}yr ${at.months}mo `
102
+ + `is outside ${index.firstAge}yr 0mo to `
103
+ + `${max.years}yr ${max.months}mo`);
90
104
  this.name = 'RetirementFactorOutOfRange';
105
+ this.guidanceRef = guidanceRef;
106
+ this.tableRef = tableRef;
107
+ this.keyedBy = index;
108
+ this.years = at.years;
109
+ this.months = at.months;
110
+ this.maxYears = max.years;
111
+ this.maxMonths = max.months;
91
112
  }
92
113
  }
93
114
  /**
@@ -142,4 +163,49 @@ export class AmbiguousScalePoint extends Error {
142
163
  this.name = 'AmbiguousScalePoint';
143
164
  }
144
165
  }
166
+ /**
167
+ * There is nothing to build a member's pay from: no usable current
168
+ * pay. Every year the pay path reconstructs or projects is scaled from
169
+ * that one figure, so without it there is no figure to scale, and any
170
+ * substitute would be a guess presented as the member's pay.
171
+ */
172
+ export class PayPathUnavailable extends Error {
173
+ reason;
174
+ constructor(reason) {
175
+ super(`No pay path can be built: ${reason}`);
176
+ this.reason = reason;
177
+ this.name = 'PayPathUnavailable';
178
+ }
179
+ }
180
+ /** What {@link BenefitNotModelled} refuses, as a closed set a
181
+ * consumer can branch on. Each is deferred, and each names the issue
182
+ * that carries what a build would take. */
183
+ export const NOT_MODELLED = {
184
+ // https://github.com/casomoltd/nhs-pay/issues/16
185
+ breakInService: 'break-in-service',
186
+ // https://github.com/casomoltd/nhs-pay/issues/16
187
+ bothLegacySections: 'both-legacy-sections',
188
+ // https://github.com/casomoltd/nhs-pay/issues/19
189
+ no2015Section: 'no-2015-section',
190
+ // https://github.com/casomoltd/nhs-pay/issues/19
191
+ remedyMemberLeftEarly: 'remedy-member-left-before-2022',
192
+ // https://github.com/casomoltd/nhs-pay/issues/20
193
+ statementBeforeRollback: 'statement-before-rollback',
194
+ // https://github.com/casomoltd/nhs-pay/issues/18
195
+ preservedDrawnEarly: 'preserved-benefits-drawn-early',
196
+ };
197
+ /**
198
+ * A benefit the library can name but has not modelled, refused rather
199
+ * than priced on an assumption nobody would see. `code` says which, so
200
+ * a consumer can tell a member what cannot yet be answered instead of
201
+ * showing a figure that answers something else.
202
+ */
203
+ export class BenefitNotModelled extends Error {
204
+ code;
205
+ constructor(code, detail) {
206
+ super(`Not modelled: ${detail}`);
207
+ this.code = code;
208
+ this.name = 'BenefitNotModelled';
209
+ }
210
+ }
145
211
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRo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AiD;IACjD,qBAAqB,EAAE,gCAAgC;IACvD,iDAAiD;IACjD,uBAAuB,EAAE,2BAA2B;IACpD,iDAAiD;IACjD,mBAAmB,EAAE,gCAAgC;CAC7C,CAAC;AAIX;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACtB;IAArB,YAAqB,IAAiB,EAAE,MAAc;QACpD,KAAK,CAAC,iBAAiB,MAAM,EAAE,CAAC,CAAC;QADd,SAAI,GAAJ,IAAI,CAAa;QAEpC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF"}
@@ -0,0 +1,87 @@
1
+ import { FactorTable } from './gad/factor-table.js';
2
+ import type { FactorProvenance, FactorTableKind } from './gad/factor-table.js';
3
+ declare const TABLES: {
4
+ readonly '0-420': FactorTable<{
5
+ readonly by: "period";
6
+ }>;
7
+ readonly '0-421': FactorTable<{
8
+ readonly by: "period";
9
+ }>;
10
+ readonly '1-401': FactorTable<{
11
+ readonly by: "age";
12
+ readonly firstAge: 50;
13
+ }>;
14
+ readonly '1-402': FactorTable<{
15
+ readonly by: "age";
16
+ readonly firstAge: 50;
17
+ }>;
18
+ readonly '1-407': FactorTable<{
19
+ readonly by: "age";
20
+ readonly firstAge: 50;
21
+ }>;
22
+ readonly '2-416': FactorTable<{
23
+ readonly by: "age";
24
+ readonly firstAge: 65;
25
+ }>;
26
+ };
27
+ /** Every table the library reads, by its GAD reference. The one set of
28
+ * instances, so two callers cannot read the same table two ways. */
29
+ export declare function factorTable<K extends keyof typeof TABLES>(ref: K): (typeof TABLES)[K];
30
+ /** Which 1995 Section benefit a factor reduces: the pension and the
31
+ * automatic lump sum read different tables. */
32
+ export declare const FACTOR_APPLIES: {
33
+ readonly pension: "pension";
34
+ readonly lumpSum: "lump-sum";
35
+ };
36
+ export type FactorApplies = (typeof FACTOR_APPLIES)[keyof typeof FACTOR_APPLIES];
37
+ /**
38
+ * What a factor is measured against. A 1995 Section drawing before 60
39
+ * reduces its pension and its automatic lump sum by two different
40
+ * tables, so that basis says which of the two it is for.
41
+ */
42
+ export type FactorBasis = {
43
+ against: 60;
44
+ direction: 'early';
45
+ applies: FactorApplies;
46
+ } | {
47
+ against: 65;
48
+ direction: 'early';
49
+ } | {
50
+ against: 65;
51
+ direction: 'late';
52
+ } | {
53
+ against: 'npa';
54
+ npa: number;
55
+ direction: 'early' | 'late';
56
+ };
57
+ /**
58
+ * Where a factor came from: a table, or one of the two reasons a drawing
59
+ * reads none. Every 1.000 says why it is 1.000, because "drawn exactly
60
+ * at the pension age" and "this section pays no late uplift" are
61
+ * different facts that print the same number.
62
+ */
63
+ export declare const FACTOR_SOURCES: {
64
+ readonly table: "table";
65
+ readonly atPensionAge: "at-normal-pension-age";
66
+ readonly noLateUplift: "section-awards-no-late-uplift";
67
+ };
68
+ /** A factor and where it came from, discriminated on `source`. */
69
+ export type FactorOutcome = {
70
+ readonly source: typeof FACTOR_SOURCES.table;
71
+ readonly factor: number;
72
+ readonly tableKind: FactorTableKind;
73
+ readonly provenance: FactorProvenance;
74
+ } | {
75
+ readonly source: typeof FACTOR_SOURCES.atPensionAge;
76
+ readonly factor: 1;
77
+ } | {
78
+ readonly source: typeof FACTOR_SOURCES.noLateUplift;
79
+ readonly factor: 1;
80
+ };
81
+ /**
82
+ * Read the factor for a drawing. The date decides the direction as well
83
+ * as the cell, so a basis whose direction the dates contradict is a bug
84
+ * in the section that derived it and fails loud.
85
+ */
86
+ export declare function readFactor(basis: FactorBasis, dateOfBirth: Date, drawn: Date): FactorOutcome;
87
+ export {};
@@ -0,0 +1,99 @@
1
+ /**
2
+ * The one door every early or late retirement factor is read through.
3
+ *
4
+ * A factor is read against the pension age the reduction is measured
5
+ * from, and the direction. That is how GAD segments the tables: 1-402
6
+ * serves any benefit with a pension age of 65, whichever section holds
7
+ * it. So the key is the pension age, not the section — and each section
8
+ * derives its key privately from its own rules, which is what keeps the
9
+ * 1995 Section from reading 1-402 although the type would allow it.
10
+ */
11
+ import { periodInYearsMonths, npaDate } from './dates.js';
12
+ import { invariant } from './errors.js';
13
+ import { FactorTable } from './gad/factor-table.js';
14
+ import { ERF_0_420 } from './gad/erf-2023-06-30.js';
15
+ import { LRF_0_421 } from './gad/lrf-2023-06-30.js';
16
+ import { ERF_1_401 } from './gad/erf-1-401-2023-06-30.js';
17
+ import { ERF_1_402 } from './gad/erf-1-402-2023-06-30.js';
18
+ import { ERF_1_407 } from './gad/erf-1-407-2023-06-30.js';
19
+ import { LRF_2_416 } from './gad/lrf-2-416-2023-06-30.js';
20
+ const TABLES = {
21
+ '0-420': new FactorTable(ERF_0_420),
22
+ '0-421': new FactorTable(LRF_0_421),
23
+ '1-401': new FactorTable(ERF_1_401),
24
+ '1-402': new FactorTable(ERF_1_402),
25
+ '1-407': new FactorTable(ERF_1_407),
26
+ '2-416': new FactorTable(LRF_2_416),
27
+ };
28
+ /** Every table the library reads, by its GAD reference. The one set of
29
+ * instances, so two callers cannot read the same table two ways. */
30
+ export function factorTable(ref) {
31
+ return TABLES[ref];
32
+ }
33
+ /** Which 1995 Section benefit a factor reduces: the pension and the
34
+ * automatic lump sum read different tables. */
35
+ export const FACTOR_APPLIES = {
36
+ pension: 'pension',
37
+ lumpSum: 'lump-sum',
38
+ };
39
+ /**
40
+ * Where a factor came from: a table, or one of the two reasons a drawing
41
+ * reads none. Every 1.000 says why it is 1.000, because "drawn exactly
42
+ * at the pension age" and "this section pays no late uplift" are
43
+ * different facts that print the same number.
44
+ */
45
+ export const FACTOR_SOURCES = {
46
+ table: 'table',
47
+ atPensionAge: 'at-normal-pension-age',
48
+ noLateUplift: 'section-awards-no-late-uplift',
49
+ };
50
+ /** The table a basis reads, and how it is keyed. */
51
+ function tableFor(basis) {
52
+ if (basis.against === 'npa') {
53
+ return basis.direction === 'early'
54
+ ? TABLES['0-420']
55
+ : TABLES['0-421'];
56
+ }
57
+ if (basis.against === 60) {
58
+ return basis.applies === FACTOR_APPLIES.pension
59
+ ? TABLES['1-401']
60
+ : TABLES['1-407'];
61
+ }
62
+ return basis.direction === 'early'
63
+ ? TABLES['1-402']
64
+ : TABLES['2-416'];
65
+ }
66
+ const keyedByAge = (table) => table.index.by === 'age';
67
+ /**
68
+ * Read the factor for a drawing. The date decides the direction as well
69
+ * as the cell, so a basis whose direction the dates contradict is a bug
70
+ * in the section that derived it and fails loud.
71
+ */
72
+ export function readFactor(basis, dateOfBirth, drawn) {
73
+ const pensionAge = basis.against === 'npa' ? basis.npa : basis.against;
74
+ const at = npaDate(dateOfBirth, pensionAge);
75
+ if (drawn.getTime() === at.getTime()) {
76
+ return { source: FACTOR_SOURCES.atPensionAge, factor: 1 };
77
+ }
78
+ invariant((drawn < at) === (basis.direction === 'early'), `factor basis says ${basis.direction} for a drawing on `
79
+ + `${drawn.toDateString()} against ${at.toDateString()}`);
80
+ const table = tableFor(basis);
81
+ if (keyedByAge(table)) {
82
+ return {
83
+ source: FACTOR_SOURCES.table,
84
+ factor: table.factorAtAge(periodInYearsMonths(dateOfBirth, drawn)),
85
+ tableKind: table.kind,
86
+ provenance: table.provenance,
87
+ };
88
+ }
89
+ const period = drawn < at
90
+ ? periodInYearsMonths(drawn, at)
91
+ : periodInYearsMonths(at, drawn);
92
+ return {
93
+ source: FACTOR_SOURCES.table,
94
+ factor: table.factorFor(period),
95
+ tableKind: table.kind,
96
+ provenance: table.provenance,
97
+ };
98
+ }
99
+ //# sourceMappingURL=factor-basis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factor-basis.js","sourceRoot":"","sources":["../src/factor-basis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAC,mBAAmB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAOlD,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,y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,mBAAmB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAClE,SAAS,EAAE,KAAK,CAAC,IAAI;YACrB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,GAAG,EAAE;QACvB,CAAC,CAAC,mBAAmB,CAAC,KAAK,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC,mBAAmB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACnC,OAAO;QACL,MAAM,EAAE,cAAc,CAAC,KAAK;QAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC;QAC/B,SAAS,EAAE,KAAK,CAAC,IAAI;QACrB,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet", table 1-401, factors issued 30 June 2023.
4
+ * Sheet x-401 · PDF p.1.
5
+ *
6
+ * Sources: "NHSBSA, Early and Late Retirement Factors" (the
7
+ * member-facing extract) and "GAD NHS_EW Consolidated Factors,
8
+ * version 2026-01" (the workbook, and the source of record) —
9
+ * see docs/source-archive.md#sa-01 and #sa-02.
10
+ *
11
+ * Table 1-401 (ERF1): 1995 Section early retirement factors,
12
+ * pension: voluntary early retirement from active service, relative
13
+ * to the Section's pension age of 60. Unisex; keyed by AGE "in
14
+ * complete years & months", as the table's own header defines it.
15
+ * Read for the 1995 Section's pension drawn before 60.
16
+ *
17
+ * Rows are ages (50–60), columns months (0–11), exactly as
18
+ * printed; the last row prints a single 0-month value. Delete this
19
+ * file whole when a later issue supersedes the table; git history is
20
+ * the archive.
21
+ *
22
+ * ── Checked against GAD's own workbook, 23 Sep 2026 ─
23
+ *
24
+ * **Unchanged and still current.** The workbook's *Version control*
25
+ * sheet shows x-401 last updated in version 2023-02, dated 30 June
26
+ * 2023, the `issued` date below; no later version names it. Every
27
+ * cell of the x-401 sheet was diffed against the NHSBSA extract —
28
+ * 121 cells — with **zero differences**.
29
+ */
30
+ /** ERF — Table 1-401, issued 30 Jun 2023. */
31
+ export declare const ERF_1_401: {
32
+ readonly kind: "erf";
33
+ readonly index: {
34
+ readonly by: "age";
35
+ readonly firstAge: 50;
36
+ };
37
+ readonly provenance: {
38
+ readonly tableRef: "1-401";
39
+ readonly sheet: "x-401";
40
+ readonly page: 1;
41
+ readonly guidanceRef: "ERF1";
42
+ readonly issued: import("../iso-date.js").IsoDate;
43
+ readonly sourceUrl: string;
44
+ readonly methodGuidance: string;
45
+ };
46
+ readonly rows: readonly [readonly [0.682, 0.684, 0.686, 0.688, 0.689, 0.691, 0.693, 0.695, 0.697, 0.699, 0.7, 0.702], readonly [0.704, 0.706, 0.708, 0.71, 0.712, 0.714, 0.716, 0.718, 0.72, 0.722, 0.724, 0.726], readonly [0.728, 0.73, 0.732, 0.735, 0.737, 0.739, 0.741, 0.743, 0.745, 0.748, 0.75, 0.752], readonly [0.754, 0.756, 0.759, 0.761, 0.763, 0.766, 0.768, 0.77, 0.773, 0.775, 0.777, 0.78], readonly [0.782, 0.785, 0.787, 0.79, 0.792, 0.795, 0.797, 0.8, 0.802, 0.805, 0.807, 0.81], readonly [0.812, 0.815, 0.818, 0.82, 0.823, 0.826, 0.829, 0.831, 0.834, 0.837, 0.84, 0.842], readonly [0.845, 0.848, 0.851, 0.854, 0.857, 0.86, 0.863, 0.865, 0.868, 0.871, 0.874, 0.877], readonly [0.88, 0.883, 0.886, 0.889, 0.892, 0.895, 0.899, 0.902, 0.905, 0.908, 0.911, 0.914], readonly [0.917, 0.92, 0.924, 0.927, 0.93, 0.934, 0.937, 0.94, 0.944, 0.947, 0.95, 0.954], readonly [0.957, 0.961, 0.964, 0.968, 0.971, 0.975, 0.979, 0.982, 0.986, 0.989, 0.993, 0.996], readonly [1]];
47
+ };
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet", table 1-401, factors issued 30 June 2023.
4
+ * Sheet x-401 · PDF p.1.
5
+ *
6
+ * Sources: "NHSBSA, Early and Late Retirement Factors" (the
7
+ * member-facing extract) and "GAD NHS_EW Consolidated Factors,
8
+ * version 2026-01" (the workbook, and the source of record) —
9
+ * see docs/source-archive.md#sa-01 and #sa-02.
10
+ *
11
+ * Table 1-401 (ERF1): 1995 Section early retirement factors,
12
+ * pension: voluntary early retirement from active service, relative
13
+ * to the Section's pension age of 60. Unisex; keyed by AGE "in
14
+ * complete years & months", as the table's own header defines it.
15
+ * Read for the 1995 Section's pension drawn before 60.
16
+ *
17
+ * Rows are ages (50–60), columns months (0–11), exactly as
18
+ * printed; the last row prints a single 0-month value. Delete this
19
+ * file whole when a later issue supersedes the table; git history is
20
+ * the archive.
21
+ *
22
+ * ── Checked against GAD's own workbook, 23 Sep 2026 ─
23
+ *
24
+ * **Unchanged and still current.** The workbook's *Version control*
25
+ * sheet shows x-401 last updated in version 2023-02, dated 30 June
26
+ * 2023, the `issued` date below; no later version names it. Every
27
+ * cell of the x-401 sheet was diffed against the NHSBSA extract —
28
+ * 121 cells — with **zero differences**.
29
+ */
30
+ import { isoDate } from '../iso-date.js';
31
+ /** ERF — Table 1-401, issued 30 Jun 2023. */
32
+ export const ERF_1_401 = {
33
+ kind: 'erf',
34
+ index: { by: 'age', firstAge: 50 },
35
+ provenance: {
36
+ tableRef: '1-401',
37
+ sheet: 'x-401',
38
+ page: 1,
39
+ guidanceRef: 'ERF1',
40
+ issued: isoDate('2023-06-30'),
41
+ sourceUrl: 'https://www.nhsbsa.nhs.uk/sites/default/'
42
+ + 'files/2024-02/Early%20and%20Late%20Retirement'
43
+ + '%20Factors.pdf',
44
+ methodGuidance: 'GAD NHSPS 1995/2008 E&W — Voluntary early and'
45
+ + ' late retirements in normal health, 7 Aug 2019',
46
+ },
47
+ rows: [
48
+ // 0mo 1mo 2mo 3mo 4mo 5mo
49
+ // 6mo 7mo 8mo 9mo 10mo 11mo
50
+ [0.682, 0.684, 0.686, 0.688, 0.689, 0.691,
51
+ 0.693, 0.695, 0.697, 0.699, 0.700, 0.702], // 50
52
+ [0.704, 0.706, 0.708, 0.710, 0.712, 0.714,
53
+ 0.716, 0.718, 0.720, 0.722, 0.724, 0.726], // 51
54
+ [0.728, 0.730, 0.732, 0.735, 0.737, 0.739,
55
+ 0.741, 0.743, 0.745, 0.748, 0.750, 0.752], // 52
56
+ [0.754, 0.756, 0.759, 0.761, 0.763, 0.766,
57
+ 0.768, 0.770, 0.773, 0.775, 0.777, 0.780], // 53
58
+ [0.782, 0.785, 0.787, 0.790, 0.792, 0.795,
59
+ 0.797, 0.800, 0.802, 0.805, 0.807, 0.810], // 54
60
+ [0.812, 0.815, 0.818, 0.820, 0.823, 0.826,
61
+ 0.829, 0.831, 0.834, 0.837, 0.840, 0.842], // 55
62
+ [0.845, 0.848, 0.851, 0.854, 0.857, 0.860,
63
+ 0.863, 0.865, 0.868, 0.871, 0.874, 0.877], // 56
64
+ [0.880, 0.883, 0.886, 0.889, 0.892, 0.895,
65
+ 0.899, 0.902, 0.905, 0.908, 0.911, 0.914], // 57
66
+ [0.917, 0.920, 0.924, 0.927, 0.930, 0.934,
67
+ 0.937, 0.940, 0.944, 0.947, 0.950, 0.954], // 58
68
+ [0.957, 0.961, 0.964, 0.968, 0.971, 0.975,
69
+ 0.979, 0.982, 0.986, 0.989, 0.993, 0.996], // 59
70
+ [1.000], // 60 — 0mo only
71
+ ],
72
+ };
73
+ //# sourceMappingURL=erf-1-401-2023-06-30.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erf-1-401-2023-06-30.js","sourceRoot":"","sources":["../../src/gad/erf-1-401-2023-06-30.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAEvC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SA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