@casomoltd/nhs-pay 0.19.3 → 0.20.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 (93) hide show
  1. package/README.md +69 -5
  2. package/dist/afc-scales.d.ts +14 -7
  3. package/dist/afc-scales.js +28 -23
  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 +25 -31
  69. package/dist/pension-projection.js +40 -197
  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/sources.d.ts +14 -0
  88. package/dist/sources.js +21 -0
  89. package/dist/sources.js.map +1 -1
  90. package/dist/values.d.ts +4 -5
  91. package/dist/values.js +4 -5
  92. package/dist/values.js.map +1 -1
  93. package/package.json +8 -5
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet", table 1-402, factors issued 30 June 2023.
4
+ * Sheet x-402 · PDF p.2.
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-402 (ERF2): early retirement factors relative to a pension
12
+ * age of 65, pension: GAD prints it for "members of 1995 or 2008
13
+ * section (relative to NPA 65)", so it serves any benefit whose
14
+ * pension age is 65, whichever section holds it. Unisex; keyed by
15
+ * AGE "in complete years & months", as the table's own header
16
+ * defines it. Read for the 2008 Section's pension drawn before 65.
17
+ *
18
+ * Rows are ages (50–65), columns months (0–11), exactly as
19
+ * printed; the last row prints a single 0-month value. Delete this
20
+ * file whole when a later issue supersedes the table; git history is
21
+ * the archive.
22
+ *
23
+ * ── Checked against GAD's own workbook, 23 Sep 2026 ─
24
+ *
25
+ * **Unchanged and still current.** The workbook's *Version control*
26
+ * sheet shows x-402 last updated in version 2023-02, dated 30 June
27
+ * 2023, the `issued` date below; no later version names it. Every
28
+ * cell of the x-402 sheet was diffed against the NHSBSA extract —
29
+ * 181 cells — with **zero differences**.
30
+ */
31
+ import { isoDate } from '../iso-date.js';
32
+ /** ERF — Table 1-402, issued 30 Jun 2023. */
33
+ export const ERF_1_402 = {
34
+ kind: 'erf',
35
+ index: { by: 'age', firstAge: 50 },
36
+ provenance: {
37
+ tableRef: '1-402',
38
+ sheet: 'x-402',
39
+ page: 2,
40
+ guidanceRef: 'ERF2',
41
+ issued: isoDate('2023-06-30'),
42
+ sourceUrl: 'https://www.nhsbsa.nhs.uk/sites/default/'
43
+ + 'files/2024-02/Early%20and%20Late%20Retirement'
44
+ + '%20Factors.pdf',
45
+ methodGuidance: 'GAD NHSPS 1995/2008 E&W — Voluntary early and'
46
+ + ' late retirements in normal health, 7 Aug 2019',
47
+ },
48
+ rows: [
49
+ // 0mo 1mo 2mo 3mo 4mo 5mo
50
+ // 6mo 7mo 8mo 9mo 10mo 11mo
51
+ [0.541, 0.543, 0.544, 0.546, 0.547, 0.549,
52
+ 0.550, 0.552, 0.553, 0.555, 0.556, 0.558], // 50
53
+ [0.559, 0.561, 0.562, 0.564, 0.565, 0.567,
54
+ 0.568, 0.570, 0.571, 0.573, 0.574, 0.576], // 51
55
+ [0.577, 0.579, 0.581, 0.582, 0.584, 0.586,
56
+ 0.588, 0.589, 0.591, 0.593, 0.595, 0.596], // 52
57
+ [0.598, 0.600, 0.602, 0.604, 0.605, 0.607,
58
+ 0.609, 0.611, 0.613, 0.615, 0.616, 0.618], // 53
59
+ [0.620, 0.622, 0.624, 0.626, 0.628, 0.630,
60
+ 0.632, 0.633, 0.635, 0.637, 0.639, 0.641], // 54
61
+ [0.643, 0.645, 0.647, 0.650, 0.652, 0.654,
62
+ 0.656, 0.658, 0.660, 0.663, 0.665, 0.667], // 55
63
+ [0.669, 0.671, 0.674, 0.676, 0.678, 0.680,
64
+ 0.683, 0.685, 0.687, 0.689, 0.692, 0.694], // 56
65
+ [0.696, 0.699, 0.701, 0.704, 0.706, 0.709,
66
+ 0.711, 0.714, 0.716, 0.719, 0.721, 0.724], // 57
67
+ [0.726, 0.729, 0.731, 0.734, 0.736, 0.739,
68
+ 0.742, 0.744, 0.747, 0.749, 0.752, 0.754], // 58
69
+ [0.757, 0.760, 0.763, 0.765, 0.768, 0.771,
70
+ 0.774, 0.776, 0.779, 0.782, 0.785, 0.787], // 59
71
+ [0.790, 0.793, 0.796, 0.799, 0.802, 0.805,
72
+ 0.809, 0.812, 0.815, 0.818, 0.821, 0.824], // 60
73
+ [0.827, 0.830, 0.833, 0.837, 0.840, 0.843,
74
+ 0.846, 0.849, 0.852, 0.856, 0.859, 0.862], // 61
75
+ [0.865, 0.869, 0.872, 0.876, 0.879, 0.883,
76
+ 0.887, 0.890, 0.894, 0.897, 0.901, 0.904], // 62
77
+ [0.908, 0.912, 0.916, 0.919, 0.923, 0.927,
78
+ 0.931, 0.934, 0.938, 0.942, 0.946, 0.949], // 63
79
+ [0.953, 0.957, 0.961, 0.965, 0.969, 0.973,
80
+ 0.977, 0.980, 0.984, 0.988, 0.992, 0.996], // 64
81
+ [1.000], // 65 — 0mo only
82
+ ],
83
+ };
84
+ //# sourceMappingURL=erf-1-402-2023-06-30.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erf-1-402-2023-06-30.js","sourceRoot":"","sources":["../../src/gad/erf-1-402-2023-06-30.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAGH,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAEvC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,EAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAC;IAChC,UAAU,EAAE;QACV,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,CAAC;QACP,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;QAC7B,SAAS,EAAE,0CAA0C;cACjD,+CAA+C;cAC/C,gBAAgB;Q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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,KAAK;QAClD,CAAC,KAAK,CAAC,EAAiC,gBAAgB;KACzD;CACiC,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet", table 1-407, factors issued 30 June 2023.
4
+ * Sheet x-407 · PDF p.9.
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-407 (ERF7): 1995 Section early retirement factors, LUMP
12
+ * SUM: the same drawing as table 1-401, applied to the automatic
13
+ * lump sum rather than the pension. Unisex; keyed by AGE "in
14
+ * complete years & months", as the table's own header defines it.
15
+ * Read for the 1995 Section's automatic lump sum 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-407 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-407 sheet was diffed against the NHSBSA extract —
28
+ * 121 cells — with **zero differences**.
29
+ */
30
+ /** ERF — Table 1-407, issued 30 Jun 2023. */
31
+ export declare const ERF_1_407: {
32
+ readonly kind: "erf";
33
+ readonly index: {
34
+ readonly by: "age";
35
+ readonly firstAge: 50;
36
+ };
37
+ readonly provenance: {
38
+ readonly tableRef: "1-407";
39
+ readonly sheet: "x-407";
40
+ readonly page: 9;
41
+ readonly guidanceRef: "ERF7";
42
+ readonly issued: import("../iso-date.js").IsoDate;
43
+ readonly sourceUrl: string;
44
+ readonly methodGuidance: string;
45
+ };
46
+ readonly rows: readonly [readonly [0.845, 0.846, 0.847, 0.849, 0.85, 0.851, 0.852, 0.853, 0.854, 0.856, 0.857, 0.858], readonly [0.859, 0.86, 0.862, 0.863, 0.864, 0.865, 0.867, 0.868, 0.869, 0.87, 0.872, 0.873], readonly [0.874, 0.875, 0.877, 0.878, 0.879, 0.88, 0.882, 0.883, 0.884, 0.885, 0.887, 0.888], readonly [0.889, 0.89, 0.892, 0.893, 0.894, 0.895, 0.897, 0.898, 0.899, 0.9, 0.902, 0.903], readonly [0.904, 0.905, 0.907, 0.908, 0.909, 0.91, 0.912, 0.913, 0.914, 0.915, 0.917, 0.918], readonly [0.919, 0.92, 0.922, 0.923, 0.924, 0.926, 0.927, 0.928, 0.93, 0.931, 0.932, 0.934], readonly [0.935, 0.936, 0.938, 0.939, 0.94, 0.942, 0.943, 0.944, 0.946, 0.947, 0.948, 0.95], readonly [0.951, 0.952, 0.954, 0.955, 0.956, 0.958, 0.959, 0.96, 0.962, 0.963, 0.964, 0.966], readonly [0.967, 0.968, 0.97, 0.971, 0.972, 0.974, 0.975, 0.976, 0.978, 0.979, 0.98, 0.982], readonly [0.983, 0.984, 0.986, 0.987, 0.989, 0.99, 0.992, 0.993, 0.994, 0.996, 0.997, 0.999], readonly [1]];
47
+ };
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Verbatim transcription — GAD "NHSPS_EW — Consolidated Factor
3
+ * Spreadsheet", table 1-407, factors issued 30 June 2023.
4
+ * Sheet x-407 · PDF p.9.
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-407 (ERF7): 1995 Section early retirement factors, LUMP
12
+ * SUM: the same drawing as table 1-401, applied to the automatic
13
+ * lump sum rather than the pension. Unisex; keyed by AGE "in
14
+ * complete years & months", as the table's own header defines it.
15
+ * Read for the 1995 Section's automatic lump sum 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-407 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-407 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-407, issued 30 Jun 2023. */
32
+ export const ERF_1_407 = {
33
+ kind: 'erf',
34
+ index: { by: 'age', firstAge: 50 },
35
+ provenance: {
36
+ tableRef: '1-407',
37
+ sheet: 'x-407',
38
+ page: 9,
39
+ guidanceRef: 'ERF7',
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.845, 0.846, 0.847, 0.849, 0.850, 0.851,
51
+ 0.852, 0.853, 0.854, 0.856, 0.857, 0.858], // 50
52
+ [0.859, 0.860, 0.862, 0.863, 0.864, 0.865,
53
+ 0.867, 0.868, 0.869, 0.870, 0.872, 0.873], // 51
54
+ [0.874, 0.875, 0.877, 0.878, 0.879, 0.880,
55
+ 0.882, 0.883, 0.884, 0.885, 0.887, 0.888], // 52
56
+ [0.889, 0.890, 0.892, 0.893, 0.894, 0.895,
57
+ 0.897, 0.898, 0.899, 0.900, 0.902, 0.903], // 53
58
+ [0.904, 0.905, 0.907, 0.908, 0.909, 0.910,
59
+ 0.912, 0.913, 0.914, 0.915, 0.917, 0.918], // 54
60
+ [0.919, 0.920, 0.922, 0.923, 0.924, 0.926,
61
+ 0.927, 0.928, 0.930, 0.931, 0.932, 0.934], // 55
62
+ [0.935, 0.936, 0.938, 0.939, 0.940, 0.942,
63
+ 0.943, 0.944, 0.946, 0.947, 0.948, 0.950], // 56
64
+ [0.951, 0.952, 0.954, 0.955, 0.956, 0.958,
65
+ 0.959, 0.960, 0.962, 0.963, 0.964, 0.966], // 57
66
+ [0.967, 0.968, 0.970, 0.971, 0.972, 0.974,
67
+ 0.975, 0.976, 0.978, 0.979, 0.980, 0.982], // 58
68
+ [0.983, 0.984, 0.986, 0.987, 0.989, 0.990,
69
+ 0.992, 0.993, 0.994, 0.996, 0.997, 0.999], // 59
70
+ [1.000], // 60 — 0mo only
71
+ ],
72
+ };
73
+ //# sourceMappingURL=erf-1-407-2023-06-30.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erf-1-407-2023-06-30.js","sourceRoot":"","sources":["../../src/gad/erf-1-407-2023-06-30.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAEvC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,EAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAC;IAChC,UAAU,EAAE;QACV,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,CAAC;QACP,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,OAAO,CAAC,YAAY,C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AK,EAAE,KAAK;YACvC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,KAAK;QAClD,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,KAAK;QAClD,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,KAAK;QAClD,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,KAAK;QAClD,CAAC,KAAK,CAAC,EAAiC,gBAAgB;KACzD;CACiC,CAAC"}
@@ -56,6 +56,9 @@
56
56
  /** 2015 scheme ERF — Table 0-420, issued 30 Jun 2023. */
57
57
  export declare const ERF_0_420: {
58
58
  readonly kind: "erf";
59
+ readonly index: {
60
+ readonly by: "period";
61
+ };
59
62
  readonly provenance: {
60
63
  readonly tableRef: "0-420";
61
64
  readonly sheet: "x-420";
@@ -57,6 +57,7 @@ import { isoDate } from '../iso-date.js';
57
57
  /** 2015 scheme ERF — Table 0-420, issued 30 Jun 2023. */
58
58
  export const ERF_0_420 = {
59
59
  kind: 'erf',
60
+ index: { by: 'period' },
60
61
  provenance: {
61
62
  tableRef: '0-420',
62
63
  sheet: 'x-420',
@@ -1 +1 @@
1
- {"version":3,"file":"erf-2023-06-30.js","sourceRoot":"","sources":["../../src/gad/erf-2023-06-30.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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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,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"}
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * GAD factor-table machinery — the translation layer between a
3
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.
4
+ * the domain. Mirrors the medical/dental circulars pattern at reduced
5
+ * weight: an issue file transcribes one printed table 1:1;
6
+ * {@link FactorTable} validates and wraps it; every factor is read
7
+ * through `factor-basis.ts`, which holds the one set of instances.
8
8
  */
9
9
  import type { IsoDate } from '../iso-date.js';
10
10
  /**
11
- * Citation carried in the data itself. Every past defect in this
12
- * area was a stale-source defect, so the "where did these numbers
13
- * come from" facts travel with the numbers, not in a comment.
11
+ * Citation carried in the data itself, so "where did these numbers
12
+ * come from" travels with the numbers and a stale table can be told
13
+ * from a current one without reading a comment.
14
14
  */
15
15
  export interface FactorProvenance {
16
16
  /** Consolidated-workbook table reference, e.g. '0-420' */
@@ -23,11 +23,9 @@ export interface FactorProvenance {
23
23
  readonly guidanceRef: string;
24
24
  /** Date GAD issued the factors, ISO date, e.g. '2023-06-30' */
25
25
  readonly issued: IsoDate;
26
- /** Document the transcription was made from */
27
- /** The publisher's own URL. A consumer RENDERS this — the
28
- * calculator cites it on its methods panel — which is why it
29
- * is data rather than a comment, and why it is the one URL
30
- * this library still holds.
26
+ /** The publisher's own URL. A consumer renders it as the
27
+ * citation, which is why it is data rather than a comment, and
28
+ * why it is the one URL this library still holds.
31
29
  *
32
30
  * There is no `archiveUrl` beside it on purpose. The archived
33
31
  * copy is inventoried in `docs/source-archive.md`, and a
@@ -39,33 +37,45 @@ export interface FactorProvenance {
39
37
  readonly methodGuidance: string;
40
38
  }
41
39
  /**
42
- * Everything that differs between the two table kinds, in one
43
- * place. ERF factors fall as the period grows and part-months
44
- * round UP (guidance §2.3); LRF factors rise and part-months
45
- * round DOWN (§3.4). Both roundings are member-conservative;
46
- * rounding, monotonic direction, and value range all follow from
47
- * the kind.
40
+ * What each kind's factors may be, and how a part month is read on a
41
+ * table keyed by period: an ERF factor is a reduction and rounds a
42
+ * part month UP (guidance §2.3), an LRF factor an uplift and rounds it
43
+ * DOWN (§3.4), both member-conservative. Direction depends on the key
44
+ * as well as the kind, so it lives with the key: see {@link runsUp}.
48
45
  */
49
46
  declare const KIND_POLICY: {
50
47
  readonly erf: {
51
- readonly roundsUp: true;
52
- readonly inOrder: (prev: number, next: number) => boolean;
53
- readonly orderWord: "non-increasing";
54
48
  readonly inRange: (factor: number) => boolean;
55
49
  readonly rangeWord: "(0, 1]";
50
+ readonly partMonthRoundsUp: true;
56
51
  };
57
52
  readonly lrf: {
58
- readonly roundsUp: false;
59
- readonly inOrder: (prev: number, next: number) => boolean;
60
- readonly orderWord: "non-decreasing";
61
53
  readonly inRange: (factor: number) => boolean;
62
54
  readonly rangeWord: "[1, ∞)";
55
+ readonly partMonthRoundsUp: false;
63
56
  };
64
57
  };
65
58
  export type FactorTableKind = keyof typeof KIND_POLICY;
59
+ /**
60
+ * How a table's rows are keyed. GAD prints two kinds and they are not
61
+ * interchangeable: the 2015 Section's tables by PERIOD to or after the
62
+ * pension age, the 1995 and 2008 Sections' by the member's AGE.
63
+ *
64
+ * - `period`: row 0 is 0 years from the pension age.
65
+ * - `age`: row 0 is `firstAge`, the youngest age printed.
66
+ */
67
+ export type PeriodIndex = {
68
+ readonly by: 'period';
69
+ };
70
+ export type AgeIndex = {
71
+ readonly by: 'age';
72
+ readonly firstAge: number;
73
+ };
74
+ export type FactorTableIndex = PeriodIndex | AgeIndex;
66
75
  /** Verbatim table data as exported by an issue file. */
67
- export interface FactorTableData {
76
+ export interface FactorTableData<I extends FactorTableIndex = FactorTableIndex> {
68
77
  readonly kind: FactorTableKind;
78
+ readonly index: I;
69
79
  readonly provenance: FactorProvenance;
70
80
  /**
71
81
  * Ragged, exactly as printed: full rows have 12 month columns;
@@ -80,22 +90,43 @@ export interface FactorTableData {
80
90
  * and the rounding policy lives with the data it governs, so no
81
91
  * caller can reach a raw cell and skip the rounding rule.
82
92
  */
83
- export declare class FactorTable {
93
+ export declare class FactorTable<I extends FactorTableIndex = FactorTableIndex> {
84
94
  readonly kind: FactorTableKind;
95
+ /** How the rows are keyed. The type carries it, so a period lookup
96
+ * on an age table does not compile. */
97
+ readonly index: I;
85
98
  readonly provenance: FactorProvenance;
86
99
  private readonly rows;
87
- constructor(data: FactorTableData);
100
+ constructor(data: FactorTableData<I>);
88
101
  /**
89
- * Factor for a calendar period, applying this table's rounding
90
- * policy (§2.3 up for ERF, §3.4 down for LRF). Throws
91
- * {@link RetirementFactorOutOfRange} when the rounded period
102
+ * Factor for a calendar period to or after the pension age, on a
103
+ * table keyed by period. Part-months round UP on an ERF (guidance
104
+ * §2.3) and DOWN on an LRF (§3.4), both member-conservative.
105
+ * Throws {@link RetirementFactorOutOfRange} when the rounded period
92
106
  * falls outside the printed table — the factor genuinely isn't
93
107
  * published, so callers catch it by type.
94
108
  */
95
- factorFor(period: {
109
+ factorFor(this: FactorTable<PeriodIndex>, period: {
110
+ years: number;
111
+ months: number;
112
+ days: number;
113
+ }): number;
114
+ /**
115
+ * Factor at the member's age on the drawing date, on a table keyed
116
+ * by age. The age is read in complete years and months, the
117
+ * definition each table prints in its own header ("Age (complete
118
+ * years & months)"), so the days beyond the last whole month are
119
+ * dropped. On either kind that reads the lower factor, which is the
120
+ * member-conservative direction the period tables round in too.
121
+ */
122
+ factorAtAge(this: FactorTable<AgeIndex>, age: {
96
123
  years: number;
97
124
  months: number;
98
125
  days: number;
99
126
  }): number;
127
+ /** One printed cell. `firstLabel` is what row 0 is printed as, so
128
+ * an out-of-range error names the age or period the reader would
129
+ * look for rather than a row number. */
130
+ private cell;
100
131
  }
101
132
  export {};
@@ -1,41 +1,37 @@
1
1
  /**
2
2
  * GAD factor-table machinery — the translation layer between a
3
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.
4
+ * the domain. Mirrors the medical/dental circulars pattern at reduced
5
+ * weight: an issue file transcribes one printed table 1:1;
6
+ * {@link FactorTable} validates and wraps it; every factor is read
7
+ * through `factor-basis.ts`, which holds the one set of instances.
8
8
  */
9
9
  import { invariant, RetirementFactorOutOfRange, } from '../errors.js';
10
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.
11
+ * What each kind's factors may be, and how a part month is read on a
12
+ * table keyed by period: an ERF factor is a reduction and rounds a
13
+ * part month UP (guidance §2.3), an LRF factor an uplift and rounds it
14
+ * DOWN (§3.4), both member-conservative. Direction depends on the key
15
+ * as well as the kind, so it lives with the key: see {@link runsUp}.
17
16
  */
18
17
  const KIND_POLICY = {
19
18
  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
19
  inRange: (factor) => factor > 0 && factor <= 1,
29
20
  rangeWord: '(0, 1]',
21
+ partMonthRoundsUp: true,
30
22
  },
31
23
  lrf: {
32
- roundsUp: false,
33
- inOrder: (prev, next) => next >= prev,
34
- orderWord: 'non-decreasing',
35
24
  inRange: (factor) => factor >= 1,
36
25
  rangeWord: '[1, ∞)',
26
+ partMonthRoundsUp: false,
37
27
  },
38
28
  };
29
+ /** Which way a table's factors run through its printed order. A factor
30
+ * moves towards 1 as the drawing nears the pension age, so an ERF
31
+ * keyed by period falls down the page and one keyed by age rises. */
32
+ function runsUp(kind, index) {
33
+ return kind === 'lrf' || index.by === 'age';
34
+ }
39
35
  const MONTHS_PER_ROW = 12;
40
36
  /**
41
37
  * Lookup value object over one GAD factor table (pattern:
@@ -45,11 +41,15 @@ const MONTHS_PER_ROW = 12;
45
41
  */
46
42
  export class FactorTable {
47
43
  kind;
44
+ /** How the rows are keyed. The type carries it, so a period lookup
45
+ * on an age table does not compile. */
46
+ index;
48
47
  provenance;
49
48
  rows;
50
49
  constructor(data) {
51
- const { kind, provenance, rows } = data;
50
+ const { kind, index, provenance, rows } = data;
52
51
  const policy = KIND_POLICY[kind];
52
+ const up = runsUp(kind, index);
53
53
  const ref = provenance.guidanceRef;
54
54
  invariant(rows.length > 0, `${ref}: no rows`);
55
55
  rows.forEach((row, y) => {
@@ -60,21 +60,26 @@ export class FactorTable {
60
60
  + ' final row may be shorter than 12, and no row'
61
61
  + ' longer');
62
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.
63
+ // Monotonicity across the rows in printed order is the
64
+ // transcription tripwire: a mis-pasted row jumps the wrong
65
+ // direction, and this check rejects that class of defect at
66
+ // construction.
67
+ //
68
+ // Non-strict: GAD prints 3dp and adjacent cells differ by as
69
+ // little as 0.001, so a legitimate issue may print two equal
70
+ // neighbours. The defect this guards is a wrong-DIRECTION jump,
71
+ // which non-strict ordering still rejects.
68
72
  const flat = rows.flat();
69
73
  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}`);
74
+ invariant(up ? flat[i] >= flat[i - 1] : flat[i] <= flat[i - 1], `${ref}: factor order violation at flat index ${i}`
75
+ + ` — expected ${up ? 'non-decreasing' : 'non-increasing'}`);
72
76
  }
73
77
  for (const factor of flat) {
74
78
  invariant(policy.inRange(factor), `${ref}: factor ${factor} outside the `
75
79
  + `${policy.rangeWord} range`);
76
80
  }
77
81
  this.kind = kind;
82
+ this.index = index;
78
83
  /* Frozen because a table is a process-wide singleton: the
79
84
  citation a member's drawing row carries IS this object,
80
85
  not a copy, so one write through a ledger row would
@@ -83,9 +88,10 @@ export class FactorTable {
83
88
  this.rows = rows;
84
89
  }
85
90
  /**
86
- * Factor for a calendar period, applying this table's rounding
87
- * policy (§2.3 up for ERF, §3.4 down for LRF). Throws
88
- * {@link RetirementFactorOutOfRange} when the rounded period
91
+ * Factor for a calendar period to or after the pension age, on a
92
+ * table keyed by period. Part-months round UP on an ERF (guidance
93
+ * §2.3) and DOWN on an LRF (§3.4), both member-conservative.
94
+ * Throws {@link RetirementFactorOutOfRange} when the rounded period
89
95
  * falls outside the printed table — the factor genuinely isn't
90
96
  * published, so callers catch it by type.
91
97
  */
@@ -101,18 +107,45 @@ export class FactorTable {
101
107
  + `${period.years}yr ${period.months}mo `
102
108
  + `${period.days}d`);
103
109
  let { years, months } = period;
104
- if (KIND_POLICY[this.kind].roundsUp && period.days > 0) {
110
+ if (KIND_POLICY[this.kind].partMonthRoundsUp && period.days > 0) {
105
111
  months += 1;
106
112
  if (months >= MONTHS_PER_ROW) {
107
113
  months = 0;
108
114
  years += 1;
109
115
  }
110
116
  }
117
+ return this.cell(years, months, 0);
118
+ }
119
+ /**
120
+ * Factor at the member's age on the drawing date, on a table keyed
121
+ * by age. The age is read in complete years and months, the
122
+ * definition each table prints in its own header ("Age (complete
123
+ * years & months)"), so the days beyond the last whole month are
124
+ * dropped. On either kind that reads the lower factor, which is the
125
+ * member-conservative direction the period tables round in too.
126
+ */
127
+ factorAtAge(age) {
128
+ const { index } = this;
129
+ invariant(Number.isInteger(age.years) && Number.isInteger(age.months)
130
+ && age.months >= 0 && age.months < MONTHS_PER_ROW, `${this.provenance.guidanceRef}: malformed age `
131
+ + `${age.years}yr ${age.months}mo`);
132
+ return this.cell(age.years - index.firstAge, age.months, index.firstAge);
133
+ }
134
+ /** One printed cell. `firstLabel` is what row 0 is printed as, so
135
+ * an out-of-range error names the age or period the reader would
136
+ * look for rather than a row number. */
137
+ cell(years, months, firstLabel) {
111
138
  const row = this.rows[years];
112
139
  const factor = row?.[months];
113
140
  if (factor === undefined) {
114
141
  const last = this.rows.length - 1;
115
- throw new RetirementFactorOutOfRange(this.provenance.guidanceRef, years, months, last, this.rows[last].length - 1);
142
+ const { index } = this;
143
+ throw new RetirementFactorOutOfRange({
144
+ provenance: this.provenance,
145
+ index,
146
+ at: { years: years + firstLabel, months },
147
+ max: { years: last + firstLabel, months: this.rows[last].length - 1 },
148
+ });
116
149
  }
117
150
  return factor;
118
151
  }
@@ -1 +1 @@
1
- {"version":3,"file":"factor-table.js","sourceRoot":"","sources":["../../src/gad/factor-table.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,SAAS,EACT,0BAA0B,GAC3B,MAAM,cA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