@casomoltd/nhs-pay 0.21.1 → 0.23.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 (83) hide show
  1. package/README.md +9 -4
  2. package/dist/additional-pension.d.ts +104 -0
  3. package/dist/additional-pension.js +163 -0
  4. package/dist/additional-pension.js.map +1 -0
  5. package/dist/dates.d.ts +21 -8
  6. package/dist/dates.js +46 -18
  7. package/dist/dates.js.map +1 -1
  8. package/dist/errors.d.ts +26 -0
  9. package/dist/errors.js +29 -0
  10. package/dist/errors.js.map +1 -1
  11. package/dist/factor-basis.d.ts +75 -22
  12. package/dist/factor-basis.js +95 -24
  13. package/dist/factor-basis.js.map +1 -1
  14. package/dist/gad/additional-pension-0-703-2023-10-03.d.ts +180 -0
  15. package/dist/gad/additional-pension-0-703-2023-10-03.js +87 -0
  16. package/dist/gad/additional-pension-0-703-2023-10-03.js.map +1 -0
  17. package/dist/gad/additional-pension-0-712-2023-10-03.d.ts +35 -0
  18. package/dist/gad/additional-pension-0-712-2023-10-03.js +170 -0
  19. package/dist/gad/additional-pension-0-712-2023-10-03.js.map +1 -0
  20. package/dist/gad/additional-pension-0-713-2023-10-03.d.ts +35 -0
  21. package/dist/gad/additional-pension-0-713-2023-10-03.js +173 -0
  22. package/dist/gad/additional-pension-0-713-2023-10-03.js.map +1 -0
  23. package/dist/gad/additional-pension-0-714-2023-10-03.d.ts +35 -0
  24. package/dist/gad/additional-pension-0-714-2023-10-03.js +176 -0
  25. package/dist/gad/additional-pension-0-714-2023-10-03.js.map +1 -0
  26. package/dist/gad/additional-pension-0-715-2023-10-03.d.ts +35 -0
  27. package/dist/gad/additional-pension-0-715-2023-10-03.js +179 -0
  28. package/dist/gad/additional-pension-0-715-2023-10-03.js.map +1 -0
  29. package/dist/gad/additional-pension-0-716-2023-10-03.d.ts +35 -0
  30. package/dist/gad/additional-pension-0-716-2023-10-03.js +170 -0
  31. package/dist/gad/additional-pension-0-716-2023-10-03.js.map +1 -0
  32. package/dist/gad/additional-pension-0-717-2023-10-03.d.ts +35 -0
  33. package/dist/gad/additional-pension-0-717-2023-10-03.js +173 -0
  34. package/dist/gad/additional-pension-0-717-2023-10-03.js.map +1 -0
  35. package/dist/gad/additional-pension-0-718-2023-10-03.d.ts +35 -0
  36. package/dist/gad/additional-pension-0-718-2023-10-03.js +176 -0
  37. package/dist/gad/additional-pension-0-718-2023-10-03.js.map +1 -0
  38. package/dist/gad/additional-pension-0-719-2023-10-03.d.ts +35 -0
  39. package/dist/gad/additional-pension-0-719-2023-10-03.js +179 -0
  40. package/dist/gad/additional-pension-0-719-2023-10-03.js.map +1 -0
  41. package/dist/gad/additional-pension-table.d.ts +51 -0
  42. package/dist/gad/additional-pension-table.js +23 -0
  43. package/dist/gad/additional-pension-table.js.map +1 -0
  44. package/dist/gad/factor-table.d.ts +7 -3
  45. package/dist/gad/factor-table.js.map +1 -1
  46. package/dist/gad/lrf-0-422-2023-06-30.d.ts +45 -0
  47. package/dist/gad/lrf-0-422-2023-06-30.js +70 -0
  48. package/dist/gad/lrf-0-422-2023-06-30.js.map +1 -0
  49. package/dist/gad/lrf-2023-06-30.d.ts +3 -3
  50. package/dist/gad/lrf-2023-06-30.js +3 -3
  51. package/dist/index.d.ts +16 -11
  52. package/dist/index.js +10 -6
  53. package/dist/index.js.map +1 -1
  54. package/dist/member-benefits.d.ts +16 -1
  55. package/dist/member-benefits.js +19 -3
  56. package/dist/member-benefits.js.map +1 -1
  57. package/dist/pension/history.d.ts +0 -8
  58. package/dist/pension/history.js +10 -4
  59. package/dist/pension/history.js.map +1 -1
  60. package/dist/pension/ledger.d.ts +59 -32
  61. package/dist/pension/ledger.js +129 -100
  62. package/dist/pension/ledger.js.map +1 -1
  63. package/dist/pension/prices.d.ts +75 -58
  64. package/dist/pension/prices.js +111 -42
  65. package/dist/pension/prices.js.map +1 -1
  66. package/dist/pension/uplift.d.ts +32 -24
  67. package/dist/pension/uplift.js +66 -18
  68. package/dist/pension/uplift.js.map +1 -1
  69. package/dist/pension-projection.d.ts +3 -3
  70. package/dist/pension-projection.js +8 -13
  71. package/dist/pension-projection.js.map +1 -1
  72. package/dist/sections/section-1995.d.ts +2 -2
  73. package/dist/sections/section-1995.js +3 -3
  74. package/dist/sections/section-1995.js.map +1 -1
  75. package/dist/sections/section-2008.js +5 -3
  76. package/dist/sections/section-2008.js.map +1 -1
  77. package/dist/sections/section-2015.d.ts +8 -7
  78. package/dist/sections/section-2015.js +14 -10
  79. package/dist/sections/section-2015.js.map +1 -1
  80. package/dist/sources.d.ts +3 -0
  81. package/dist/sources.js +14 -0
  82. package/dist/sources.js.map +1 -1
  83. package/package.json +1 -1
@@ -2,12 +2,13 @@
2
2
  * The member's pension as a balance-forward periodic ledger.
3
3
  *
4
4
  * closing(N) = [closing(N−1) × (1 + uplift(N)) + earned(N)]
5
- * × factor(N)
5
+ * × (1 + leaver(N)) × factor(N)
6
6
  *
7
- * One uniform row per scheme year. `factor` is 1 on every row but
8
- * the retirement one, so there is no branch in the recurrence —
9
- * only a multiplier that is usually the identity, the same trick
10
- * as an uplift of zero.
7
+ * One uniform row per scheme year. `leaver` is 0 on every row but
8
+ * the one the member leaves in, and `factor` 1 on every row but the
9
+ * retirement one, so there is no branch in the recurrence — only
10
+ * multipliers that are usually the identity, the same trick as an
11
+ * uplift of zero.
11
12
  *
12
13
  * **The order is load-bearing.** The pot is revalued FIRST and
13
14
  * the year's slice added after, so a slice earns no revaluation
@@ -19,8 +20,8 @@
19
20
  * construction.
20
21
  */
21
22
  import { invariant } from '../errors.js';
22
- import { periodInYearsMonths } from '../dates.js';
23
- import { openingUpliftFor, phaseAt } from './uplift.js';
23
+ import { dayAfter, monthsCountingPart, MONTHS_PER_YEAR } from '../dates.js';
24
+ import { openingUpliftFor, phaseAt, upliftsFor } from './uplift.js';
24
25
  import { firstWalkedYear, schemeYearEndDate, schemeYearEndFor, schemeYearStartDate, } from './seed.js';
25
26
  /**
26
27
  * 1/54 of pensionable pay, the 2015 CARE accrual rate — NHSBSA
@@ -44,56 +45,92 @@ const LEDGER_BASES = {
44
45
  export function flatPay(pay) {
45
46
  return () => ({ pay, basis: LEDGER_BASES.assumed });
46
47
  }
47
- /** Complete months from `from` to `to`. */
48
- function completeMonths(from, to) {
49
- if (to <= from)
50
- return 0;
51
- const { years, months } = periodInYearsMonths(from, to);
52
- return years * 12 + months;
48
+ export function buildLedger(req) {
49
+ const { seed, exitDate, retirementDate, through } = req;
50
+ const exitYear = schemeYearEndFor(exitDate);
51
+ const retireYear = schemeYearEndFor(retirementDate);
52
+ const first = firstWalkedYear(seed);
53
+ const years = [];
54
+ let opening = seed.opening;
55
+ for (let year = first; year <= through; year++) {
56
+ const row = rowFor({
57
+ year,
58
+ opening,
59
+ /* No uplift opens a walk that opens the MEMBERSHIP: there
60
+ is no banked balance to revalue. Read off the seed's
61
+ own content — `accruingFrom` is a date only when service
62
+ begins inside the first walked year — never off which
63
+ route produced it, which the seed's own doc forbids
64
+ anything downstream from asking. */
65
+ isFirst: years.length === 0 && seed.accruingFrom !== null,
66
+ req, first, exitYear, retireYear,
67
+ });
68
+ years.push(row);
69
+ opening = row.closing;
70
+ }
71
+ return readerOver(Object.freeze(years), seed);
53
72
  }
54
73
  /**
55
- * Nominal pay for a year, scaled where the year is partial.
56
- * The 1/54 divisor is never pro-rated — only the pay is.
74
+ * The pension at the drawing, before and after its factor, read off
75
+ * the row the drawing falls in.
57
76
  *
58
- * **Only the JOINING year can be partial.** A member joining in
59
- * October earns two thirds of that year's pay and their
60
- * statement says so; there is one join and it is handled one
61
- * way, so nothing is inconsistent about counting it.
77
+ * There is no such row when the drawing falls at or before the seed's
78
+ * own year end — a member handing over a balance and drawing it the
79
+ * same day — and there is still an answer: the balance they handed
80
+ * over, with the factor applied here instead of on a row.
81
+ */
82
+ export function atDrawing(ledger, drawing, factor) {
83
+ const row = ledger.years.find((r) => r.schemeYearEnd === schemeYearEndFor(drawing));
84
+ if (row === undefined) {
85
+ const revalued = ledger.accruedAt(drawing);
86
+ return { revalued, drawn: revalued * factor };
87
+ }
88
+ return { revalued: row.accrued, drawn: row.closing };
89
+ }
90
+ /**
91
+ * Months served in a scheme year: all twelve, or from the join to
92
+ * the year's end, or from the year's start (or the join) to the end
93
+ * of the last day of service, a part month of 16 days or more
94
+ * counting as one.
62
95
  *
63
- * Leaving is different: an exit date names a SCHEME YEAR and
64
- * the member is credited the whole of it, unearned months
65
- * included. That is a simplification the library should not be
66
- * making — see `rowFor` and issue #12.
96
+ * One count, read by the year's pay and its leaver adjustment
97
+ * alike. The adjustment's count is the regulation's (Sch 9 para 3).
98
+ * Using it for pay too is the library's reading: the scheme credits
99
+ * 1/54 of the pay actually earned in a part year (para 28(2)(b)),
100
+ * and pay held as a yearly figure is scaled by the months served.
67
101
  */
68
- function payFor({ year, prices, first, accruingFrom, annualPay, }) {
102
+ function monthsServedIn(year, req, first) {
103
+ const joinedThisYear = year === first ? req.seed.accruingFrom : null;
104
+ const leftThisYear = year === schemeYearEndFor(req.exitDate);
105
+ if (leftThisYear) {
106
+ const from = joinedThisYear ?? schemeYearStartDate(year);
107
+ invariant(req.exitDate >= from, `left on ${req.exitDate.toDateString()}, before joining on `
108
+ + from.toDateString());
109
+ return monthsCountingPart(from, dayAfter(req.exitDate));
110
+ }
111
+ if (joinedThisYear !== null) {
112
+ return monthsCountingPart(joinedThisYear, schemeYearStartDate(year + 1));
113
+ }
114
+ return MONTHS_PER_YEAR;
115
+ }
116
+ /**
117
+ * Nominal pay for the months served in a year. The 1/54 divisor is
118
+ * never pro-rated — only the pay is.
119
+ */
120
+ function payFor({ year, prices, annualPay, months, }) {
69
121
  // Today's money in, this year's cash out. One conversion, so
70
122
  // the figure cannot pick up growth on the way. At a zero
71
123
  // assumption it is the identity, which is what makes the
72
124
  // today's-money run credit pay / 54 every year.
73
125
  const whole = prices.payAt(annualPay, schemeYearEndDate(year));
74
- let months = 12;
75
- if (year === first && accruingFrom !== null) {
76
- months = completeMonths(accruingFrom, schemeYearStartDate(year + 1));
77
- }
78
- return (whole * months) / 12;
126
+ return (whole * months) / MONTHS_PER_YEAR;
79
127
  }
80
128
  /** One row: revalue the pot, add the year's slice, then apply
81
129
  * the retirement transform if this is the year it falls in. */
82
130
  function rowFor(ctx) {
83
131
  const { year, opening, req, exitYear, retireYear } = ctx;
84
- const { prices, seed } = req;
132
+ const { prices } = req;
85
133
  const phase = phaseAt(year, exitYear, retireYear);
86
- /* ONE RULE FOR LEAVING: an exit date names a SCHEME YEAR.
87
- The member is active for all of it, earns its whole 1/54
88
- slice, and from its close the in-service rate stops. Both
89
- halves are the same decision.
90
-
91
- It is a simplification the LIBRARY makes on the consumer's
92
- behalf, which is the wrong way round — SI 2015/94 Sch 9
93
- para 3 is finer on both counts and no caller can reach it.
94
- See docs/how-it-works.md, "An exit date names a scheme
95
- year, not a day", for what it costs, and issue #12 for what
96
- a fix takes. */
97
134
  /* The rate is `openingUpliftFor`'s answer, never assembled
98
135
  here: the seed inverts this exact step, and the two must ask
99
136
  one function rather than each name the phase, the year and
@@ -104,19 +141,22 @@ function rowFor(ctx) {
104
141
  const revalued = uplift === null
105
142
  ? opening
106
143
  : opening * (1 + uplift.percent / 100);
144
+ const monthsServed = monthsServedIn(year, req, ctx.first);
107
145
  const given = phase === 'active'
108
146
  ? req.payIn(year)
109
147
  : null;
110
148
  const pensionableEarnings = given === null
111
149
  ? null
112
- : payFor({
113
- year, prices, first: ctx.first,
114
- accruingFrom: seed.accruingFrom,
115
- annualPay: given.pay,
116
- });
150
+ : payFor({ year, prices, annualPay: given.pay, months: monthsServed });
117
151
  const earned = pensionableEarnings === null
118
152
  ? 0
119
153
  : pensionableEarnings * ACCRUAL_RATE;
154
+ const leftThisYear = year === exitYear;
155
+ const leaverAdjustment = leftThisYear
156
+ ? leaverAdjustmentFor(year, prices, req.exitDate, monthsServed)
157
+ : null;
158
+ const accrued = (revalued + earned)
159
+ * (1 + (leaverAdjustment?.percent ?? 0) / 100);
120
160
  const drawing = year === retireYear
121
161
  ? req.drawingFor()
122
162
  : null;
@@ -137,34 +177,43 @@ function rowFor(ctx) {
137
177
  opening,
138
178
  uplift: uplift === null ? null : Object.freeze(uplift),
139
179
  revalued,
180
+ leaverAdjustment: leaverAdjustment === null
181
+ ? null
182
+ : Object.freeze(leaverAdjustment),
183
+ accrued,
140
184
  drawing: drawing === null ? null : Object.freeze(drawing),
141
- closing: (revalued + earned) * factor,
185
+ closing: accrued * factor,
142
186
  });
143
187
  }
144
- export function buildLedger(req) {
145
- const { seed, exitDate, retirementDate, through } = req;
146
- const exitYear = schemeYearEndFor(exitDate);
147
- const retireYear = schemeYearEndFor(retirementDate);
148
- const first = firstWalkedYear(seed);
149
- const years = [];
150
- let opening = seed.opening;
151
- for (let year = first; year <= through; year++) {
152
- const row = rowFor({
153
- year,
154
- opening,
155
- /* No uplift opens a walk that opens the MEMBERSHIP: there
156
- is no banked balance to revalue. Read off the seed's
157
- own content — `accruingFrom` is a date only when service
158
- begins inside the first walked year — never off which
159
- route produced it, which the seed's own doc forbids
160
- anything downstream from asking. */
161
- isFirst: years.length === 0 && seed.accruingFrom !== null,
162
- req, first, exitYear, retireYear,
163
- });
164
- years.push(row);
165
- opening = row.closing;
166
- }
167
- return readerOver(Object.freeze(years), seed);
188
+ /**
189
+ * The leaver index adjustment for the year the member leaves in
190
+ * (Sch 9 para 3): the in-service rate for that year's Order, from the
191
+ * same series every other year's uplift reads, times the months
192
+ * served over 12, and never below zero. It applies to the whole
193
+ * accrued balance, the final part-year's slice included (paras 5
194
+ * and 28(2)).
195
+ */
196
+ function leaverAdjustmentFor(year, prices, exitDate, months) {
197
+ const inService = upliftsFor('active', prices.cpiFor)(year);
198
+ return {
199
+ on: exitDate,
200
+ percent: Math.max(0, inService.percent * months / MONTHS_PER_YEAR),
201
+ months,
202
+ from: inService.from,
203
+ };
204
+ }
205
+ /**
206
+ * When a row's accrual is settled: the scheme year end, or for the
207
+ * row a member leaves in, the last day of service. Never before that
208
+ * row's own April uplift, which the accrued figure already carries:
209
+ * a member leaving on 3 April 2025 is read after the 6 April Order.
210
+ */
211
+ function settlementOf(row) {
212
+ const leftOn = row.leaverAdjustment?.on;
213
+ if (leftOn === undefined)
214
+ return schemeYearEndDate(row.schemeYearEnd);
215
+ const upliftOn = row.uplift?.appliedOn;
216
+ return upliftOn !== undefined && upliftOn > leftOn ? upliftOn : leftOn;
168
217
  }
169
218
  /**
170
219
  * The read side, over rows already walked.
@@ -182,27 +231,24 @@ function readerOver(frozen, seed) {
182
231
  * beginning instead — the balance is the seed's, and the seed
183
232
  * is a figure at a stated date.
184
233
  *
185
- * Returning the seed against the DATE ASKED made leaving
186
- * earlier look worth more: the cash figure was unchanged but
187
- * deflated over a longer window, so a member who left in
188
- * January 2024 read £3,849 in today's money where one who
189
- * left in January 2025 read £3,607, off the same statement.
190
- * Monotonic nonsense, and in the one regime where it shows —
191
- * a statement issued after the member had already left.
234
+ * So a date before the seed reads the seed's own year end, and
235
+ * an earlier leaving date cannot read higher off the same
236
+ * statement than a later one.
192
237
  */
193
238
  const answerableAt = (date) => date < startsAt ? startsAt : date;
194
239
  /** Replay the steps up to `date`. `preDrawing` reads the row
195
- * carrying the retirement event at its pre-factor value. */
240
+ * carrying the retirement event at its pre-factor value. A row
241
+ * the member leaves in settles on the last day of service, not
242
+ * at its scheme year end. */
196
243
  const walkTo = (date, preDrawing) => {
197
244
  let value = seed.opening;
198
245
  for (const row of frozen) {
199
246
  if (row.uplift !== null && row.uplift.appliedOn <= date) {
200
247
  value = row.revalued;
201
248
  }
202
- if (schemeYearEndDate(row.schemeYearEnd) <= date) {
203
- value = preDrawing
204
- ? row.revalued + row.earned
205
- : row.closing;
249
+ const settlesOn = settlementOf(row);
250
+ if (settlesOn <= date) {
251
+ value = preDrawing ? row.accrued : row.closing;
206
252
  }
207
253
  }
208
254
  return value;
@@ -222,21 +268,4 @@ function readerOver(frozen, seed) {
222
268
  earningsRows: () => frozen.filter((row) => row.pensionableEarnings !== null),
223
269
  });
224
270
  }
225
- /**
226
- * The pension at the drawing, before and after its factor, read off
227
- * the row the drawing falls in.
228
- *
229
- * There is no such row when the drawing falls at or before the seed's
230
- * own year end — a member handing over a balance and drawing it the
231
- * same day — and there is still an answer: the balance they handed
232
- * over, with the factor applied here instead of on a row.
233
- */
234
- export function atDrawing(ledger, drawing, factor) {
235
- const row = ledger.years.find((r) => r.schemeYearEnd === schemeYearEndFor(drawing));
236
- if (row === undefined) {
237
- const revalued = ledger.accruedAt(drawing);
238
- return { revalued, drawn: revalued * factor };
239
- }
240
- return { revalued: row.revalued + row.earned, drawn: row.closing };
241
- }
242
271
  //# sourceMappingURL=ledger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ledger.js","sourceRoot":"","sources":["../../src/pension/ledger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAQhD,OAAO,EAAC,gBAAgB,EAAE,OAAO,EAAC,MAAM,aAAa,CAAC;AAEtD,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,CAAC;AAmBnC;6DAC6D;AAC7D,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC;AA+FX;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,OAAO,GAAG,EAAE,CAAC,CAAC,EAAC,GAAG,EAAE,KAAK,EAAE,YAAY,CAAC,OAAO,EAAC,CAAC,CAAC;AACpD,CAAC;AAwCD,2CAA2C;AAC3C,SAAS,cAAc,CAAC,IAAU,EAAE,EAAQ;IAC1C,IAAI,EAAE,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC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AAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;QACzD,SAAS,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;QAC3D,SAAS,CAAC,aAAqB;YAC7B,IAAI,aAAa,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBAC1C,OAAO,IAAI,CAAC,OAAO,CAAC;YACtB,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CACrB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,aAAa,CACzC,CAAC;YACF,SAAS,CACP,GAAG,KAAK,SAAS,EACjB,eAAe,aAAa,qBAAqB,CAClD,CAAC;YACF,OAAO,GAAG,CAAC,OAAO,CAAC;QACrB,CAAC;QACD,YAAY,EAAE,GAAG,EAAE,CACjB,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,mBAAmB,KAAK,IAAI,CAAC;KAC3D,CAAC,CAAC;AACL,CAAC"}
@@ -1,48 +1,40 @@
1
1
  /**
2
- * The caller's CPI assumption, and the one conversion that
3
- * needs it.
2
+ * A run's price series: the CPI each scheme year revalues at, and
3
+ * the conversion of the caller's pay into a given year's money.
4
4
  *
5
- * Two jobs. The assumption itself, read as a `CpiEntry` for any
6
- * scheme year, and expressing the caller's pay in the money of
7
- * a given scheme year, which is that same rate applied.
5
+ * ── Today's money is a run, not a deflation ─────────
8
6
  *
9
- * ── There is no deflator here any more ──────────────
7
+ * Today's money is the SAME projection run with the inflation
8
+ * assumption set to zero, so the pension revalues at 1.5% a year
9
+ * while a member is paying in and not at all once they are
10
+ * deferred. The model runs twice and pairs the two readings;
11
+ * neither one is derived from the other.
10
12
  *
11
- * Today's money is NOT this projection divided by inflation. It
12
- * is the SAME projection run with the inflation assumption set
13
- * to zero, so the pension revalues at 1.5% a year while a
14
- * member is paying in and not at all once they are deferred.
15
- * `pension-projection.ts` runs the model twice and pairs the
16
- * two readings; neither one is derived from the other.
17
- *
18
- * That is a real difference, not a restatement of the same
19
- * arithmetic. Dividing a CPI + 1.5 projection by CPI gives
13
+ * Dividing a CPI + 1.5 projection by CPI would give
20
14
  * 1.5 / (1 + cpi) — 1.47% at a 2% assumption, because the 1.5
21
- * points are added before the growth and then eaten into by
22
- * the same year's inflation. Running at zero gives 1.5% flat.
23
- * The second is what the scheme's own rule reduces to when
24
- * inflation is ignored, and it is what the tool means by
25
- * today's money.
26
- *
27
- * Deleting the deflator deleted a great deal with it: an anchor
28
- * date, a face-value window, and the rule that a stated balance
29
- * must not be restated. At a zero assumption there is nothing
30
- * to restate, so that property now holds by construction rather
31
- * than by a clamp — which is why three separate attempts at
32
- * placing the anchor all failed and this does not.
15
+ * points are added before the growth and then eaten into by the
16
+ * same year's inflation. Running at zero gives 1.5% flat, which
17
+ * is what the scheme's own rule reduces to when inflation is
18
+ * ignored. It also leaves a stated balance exactly as stated, by
19
+ * construction: at zero there is nothing to restate it by.
33
20
  *
34
21
  * An uplift rule reads whatever entry it is handed and carries
35
22
  * it through to its receipt; it never branches on whether the
36
- * figure was measured or assumed. A PROJECTION is always handed
37
- * `assumedFor`: an Order is a nominal rate, and the
38
- * today's-money run is this same model at an assumption of
39
- * zero, so an Order applied inside it puts a whole year of CPI
40
- * into a reading defined to contain none. So there is one rate
41
- * here and it is the assumption.
23
+ * figure was measured or assumed. WHICH entry is this module's
24
+ * choice, made once per series:
42
25
  *
43
- * Reading the published record itself is a different question,
44
- * and `revaluation.ts` answers it: `revaluationFor`, beside the
45
- * table it reads.
26
+ * - `createPrices` hands out the assumption for every year. The
27
+ * today's-money run is always this series at zero: an Order is
28
+ * a nominal rate, and one applied inside that run puts a whole
29
+ * year of CPI into a reading defined to contain none
30
+ * (https://github.com/casomoltd/nhs-pay/issues/13).
31
+ * - `createPublishedPrices` is the CASH run as a member's Annual
32
+ * Benefit Statement prints it. A year a Revaluation Order
33
+ * covers takes that Order, SI and all, and a past year's pay
34
+ * is carried into its own year's cash by the same Orders' CPI.
35
+ * Both halves are nominal, so the Order applies to a balance
36
+ * in the money it was written for. Beyond the published record
37
+ * it is the assumption, as above.
46
38
  */
47
39
  /** One year of the September CPI series, and where it came from. */
48
40
  export interface CpiEntry {
@@ -66,31 +58,28 @@ export interface CpiEntry {
66
58
  * stays the caller's question and never the rule's. A projection
67
59
  * makes that choice exactly once, in `openingUpliftFor`. */
68
60
  export type CpiSource = (schemeYearEnd: number) => CpiEntry;
69
- /** The rate a projection revalues at, and the money readings
70
- * that follow from it. ONE conversion and a pinned convenience
71
- * over it, plus the rate itself — reading the published record
72
- * is `revaluation.ts`'s job, and a reader here would be a second
73
- * answer to a question already answered. */
61
+ /** The CPI a projection revalues at, and the money readings
62
+ * that follow from it. The published record itself is
63
+ * `revaluation.ts`'s: a series here reads it through
64
+ * `revaluationFor` and never holds a copy. */
74
65
  export interface Prices {
75
66
  /**
76
- * A scheme year read as the caller's ASSUMPTION, whatever the
77
- * published table holds for it.
67
+ * The CPI a scheme year revalues at in this series: the
68
+ * caller's assumption, or in a published-history series the
69
+ * Order that set it, its SI carried on the entry.
78
70
  *
79
- * Not a fallback and not a test seam. This is the ONLY rate a
80
- * projection uses, for every uplift after its seed and for
81
- * published years as readily as unpublished ones — see the
82
- * header, and `openingUpliftFor`, which is where a projection
83
- * reaches for it.
71
+ * The ONLY rate a projection uses, for every uplift after its
72
+ * seed — see the header, and `openingUpliftFor`, which is where
73
+ * a projection reaches for it.
84
74
  */
85
- assumedFor(schemeYearEnd: number): CpiEntry;
75
+ cpiFor: CpiSource;
86
76
  /**
87
77
  * The caller's pay, given in today's money, expressed in the
88
78
  * cash of `asAt`.
89
79
  *
90
- * The only conversion left in this module. At a zero
91
- * assumption it is the identity, which is exactly why the
92
- * today's-money run credits `pay / 54` every year without
93
- * anything having to enforce it.
80
+ * At a zero assumption and no published history it is the
81
+ * identity, which is exactly why the today's-money run credits
82
+ * `pay / 54` every year without anything having to enforce it.
94
83
  */
95
84
  payAt(todaysMoney: number, asAt: Date): number;
96
85
  /** The date this run's today's-money readings are anchored
@@ -100,7 +89,10 @@ export interface Prices {
100
89
  readonly asOf: Date;
101
90
  /**
102
91
  * An amount stated on one date, expressed in the money of
103
- * another. `payAt` is this with `from` pinned to the run date.
92
+ * another, always at the caller's assumption. In `createPrices`
93
+ * `payAt` is this with `from` pinned to the run date; in
94
+ * `createPublishedPrices` it is not, because past pay there
95
+ * steps by the Orders and a fixed amount does not.
104
96
  *
105
97
  * NARROW BY INTENT, and read the header above before reaching
106
98
  * for it. It carries an EXTERNALLY FIXED cash amount — a
@@ -115,6 +107,9 @@ export interface Prices {
115
107
  */
116
108
  valueAt(amount: number, from: Date, to: Date): number;
117
109
  }
110
+ /** The CPI a today's-money run assumes, as a decimal: none, so every
111
+ * figure is read in the money of the run date. */
112
+ export declare const TODAYS_MONEY_CPI = 0;
118
113
  /**
119
114
  * How much more a pound of `asAt` money is than a pound of
120
115
  * `from` money, under the caller's assumption.
@@ -123,10 +118,9 @@ export interface Prices {
123
118
  * a scheme year and the pot moves once a year, so a ruler that
124
119
  * compounded smoothly would drift against both inside every
125
120
  * year. The steps are the days the Orders actually land, read
126
- * from the table: 1 April through 2022, 6 April after. Reading
127
- * them off a hardcoded 6 April put a five-day window either
128
- * side of every pre-2023 April and counted a step that had not
129
- * happened.
121
+ * from the table: 1 April through 2022, 6 April after, so a
122
+ * date between the two Aprils of any year is read on the right
123
+ * side of that year's step.
130
124
  *
131
125
  * Symmetric, so a year behind the run date is divided by
132
126
  * exactly what a year ahead is multiplied by, and a caller
@@ -144,3 +138,26 @@ export declare function inflationFactor(asAt: Date, from: Date, assumedCpi: numb
144
138
  * date the module needs.
145
139
  */
146
140
  export declare function createPrices(assumedCpi: number, asOf: Date): Prices;
141
+ /**
142
+ * The price series of a cash run read the way an Annual Benefit
143
+ * Statement is: the published record wherever it exists, the
144
+ * caller's assumption beyond it.
145
+ *
146
+ * ONE per-year answer, `publishedCpiFor`, serves both halves, so
147
+ * the pot and the pay can never disagree about which years are
148
+ * published:
149
+ *
150
+ * - a year's uplift is its Order's CPI, SI on the entry;
151
+ * - pay is carried between the run date and any other date, in
152
+ * either direction, by the CPI of each Order landing between
153
+ * them, on the days the pot moves. The promotional curve that
154
+ * built the pay path measures growth ABOVE general pay, so the
155
+ * general half is still missing, and prices stand in for it.
156
+ * That reads pay as having kept pace with prices, which the pay
157
+ * awards of these years did not exactly do: it is the one
158
+ * estimate here, and the Orders themselves are the record.
159
+ *
160
+ * `valueAt` stays the assumption's: it carries an externally
161
+ * fixed amount between dates, which is not pay.
162
+ */
163
+ export declare function createPublishedPrices(assumedCpi: number, asOf: Date): Prices;