@casomoltd/nhs-pay 0.27.0 → 0.29.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 (44) hide show
  1. package/dist/additional-pension.js +56 -32
  2. package/dist/additional-pension.js.map +1 -1
  3. package/dist/dates.d.ts +2 -0
  4. package/dist/dates.js +17 -3
  5. package/dist/dates.js.map +1 -1
  6. package/dist/index.d.ts +5 -4
  7. package/dist/index.js +3 -3
  8. package/dist/index.js.map +1 -1
  9. package/dist/iso-date.d.ts +4 -9
  10. package/dist/iso-date.js +10 -11
  11. package/dist/iso-date.js.map +1 -1
  12. package/dist/member/benefits.d.ts +11 -0
  13. package/dist/member/benefits.js +179 -0
  14. package/dist/member/benefits.js.map +1 -0
  15. package/dist/member/index.d.ts +9 -0
  16. package/dist/member/index.js +9 -0
  17. package/dist/member/index.js.map +1 -0
  18. package/dist/member/service.d.ts +65 -0
  19. package/dist/member/service.js +166 -0
  20. package/dist/member/service.js.map +1 -0
  21. package/dist/{member-benefits.d.ts → member/types.d.ts} +39 -42
  22. package/dist/member/types.js +46 -0
  23. package/dist/member/types.js.map +1 -0
  24. package/dist/member/valuation.d.ts +67 -0
  25. package/dist/member/valuation.js +162 -0
  26. package/dist/member/valuation.js.map +1 -0
  27. package/dist/pension/ages.d.ts +64 -31
  28. package/dist/pension/ages.js +66 -38
  29. package/dist/pension/ages.js.map +1 -1
  30. package/dist/post.d.ts +22 -29
  31. package/dist/post.js +14 -17
  32. package/dist/post.js.map +1 -1
  33. package/dist/sections/final-salary.d.ts +1 -0
  34. package/dist/sections/final-salary.js +1 -0
  35. package/dist/sections/final-salary.js.map +1 -1
  36. package/dist/sources.d.ts +13 -1
  37. package/dist/sources.js +25 -1
  38. package/dist/sources.js.map +1 -1
  39. package/dist/take-home.d.ts +12 -6
  40. package/dist/take-home.js +12 -6
  41. package/dist/take-home.js.map +1 -1
  42. package/package.json +3 -3
  43. package/dist/member-benefits.js +0 -462
  44. package/dist/member-benefits.js.map +0 -1
@@ -48,12 +48,18 @@ export interface NhsTakeHomeOptions {
48
48
  */
49
49
  export declare function nhsTakeHome(salary: number, pensionRate: number, taxYear: TaxYear, taxRegion: TaxRegion, options?: NhsTakeHomeOptions): TakeHomePay;
50
50
  /**
51
- * The pension annual allowance an NHS member's year meets. The scheme
52
- * is defined benefit, so the pension input is the growth in CARE
53
- * benefits (paye-calc's DB multiple of the year's accrual), not the
54
- * contribution paid;
55
- * without it adjusted income omits the scheme and the taper never
56
- * bites for high earners. An opted-out member (rate 0) has no input.
51
+ * The pension annual allowance an NHS member's year meets, estimated from
52
+ * this year's 2015 Section accrual alone. The scheme is defined benefit,
53
+ * so the pension input is paye-calc's DB multiple of the year's accrual,
54
+ * not the contribution paid; without it adjusted income omits the scheme
55
+ * and the taper never bites for high earners. An opted-out member (rate
56
+ * 0) has no input.
57
+ *
58
+ * It takes no member history, so the input is a floor for anyone with
59
+ * pension already built up: that pension's revaluation beyond the CPI
60
+ * uplift, and any legacy section's growth, are inputs too, and are not
61
+ * counted here.
62
+ *
57
63
  * Source: HMRC PTM053301 (DB pension input amount), the citation
58
64
  * paye-calc's `DB_PENSION_INPUT_MULTIPLIER` carries.
59
65
  */
package/dist/take-home.js CHANGED
@@ -79,12 +79,18 @@ export function nhsTakeHome(salary, pensionRate, taxYear, taxRegion, options = {
79
79
  return thp;
80
80
  }
81
81
  /**
82
- * The pension annual allowance an NHS member's year meets. The scheme
83
- * is defined benefit, so the pension input is the growth in CARE
84
- * benefits (paye-calc's DB multiple of the year's accrual), not the
85
- * contribution paid;
86
- * without it adjusted income omits the scheme and the taper never
87
- * bites for high earners. An opted-out member (rate 0) has no input.
82
+ * The pension annual allowance an NHS member's year meets, estimated from
83
+ * this year's 2015 Section accrual alone. The scheme is defined benefit,
84
+ * so the pension input is paye-calc's DB multiple of the year's accrual,
85
+ * not the contribution paid; without it adjusted income omits the scheme
86
+ * and the taper never bites for high earners. An opted-out member (rate
87
+ * 0) has no input.
88
+ *
89
+ * It takes no member history, so the input is a floor for anyone with
90
+ * pension already built up: that pension's revaluation beyond the CPI
91
+ * uplift, and any legacy section's growth, are inputs too, and are not
92
+ * counted here.
93
+ *
88
94
  * Source: HMRC PTM053301 (DB pension input amount), the citation
89
95
  * paye-calc's `DB_PENSION_INPUT_MULTIPLIER` carries.
90
96
  */
@@ -1 +1 @@
1
- {"version":3,"file":"take-home.js","sourceRoot":"","sources":["../src/take-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,KAAK,GACN,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,qEAAqE;AACrE,MAAM,QAAQ,GAAG,GAAG,CAAC;AAerB;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CACzB,MAAc,EACd,WAAmB,EACnB,OAAgB,EAChB,SAAoB,EACpB,UAA8B,EAAE;IAEhC,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAChD,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IACnC,qEAAqE;IACrE,8DAA8D;IAC9D,yBAAyB;IACzB,MAAM,QAAQ,GAAG,WAAW,GAAG,CAAC,CAAC;IACjC,GAAG,CAAC,UAAU,CAAC,QAAQ;QACrB,CAAC,CAAC;YACA,KAAK,EAAE,YAAY,CAAC,QAAQ;YAC5B,YAAY,EAAE,cAAc,CAAC,WAAW,GAAG,QAAQ,CAAC;SACrD;QACD,CAAC,CAAC,UAAU,CAAC,CAAC;IAChB,IAAI,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,EAAE,C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mE;IACnE,IAAI,QAAQ,EAAE,CAAC;QACb,gEAAgE;QAChE,2BAA2B;QAC3B,MAAM,MAAM,GAAG;YACb,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC;YAC5C,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,YAAY,EAAE,GAAG,CAAC,gBAAgB;YAClC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,IAAI;SACjC,CAAC;QACF,SAAS,CACP,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,KAAK;gBACjC,KAAK,CAAC,MAAM,EAAE,EAAC,GAAG,MAAM,EAAE,OAAO,EAAE,UAAU,EAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EACvE,8DAA8D;cAC1D,yDAAyD;cACzD,mDAAmD;cACnD,qBAAqB,CAC1B,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,WAAmB,EACnB,OAAgB,EAChB,SAAoB;IAEpB,MAAM,QAAQ,GAAG,WAAW,GAAG,CAAC,CAAC;IACjC,OAAO,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,eAAe,CACzE,QAAQ,CAAC,CAAC,CAAC,EAAC,eAAe,EAAE,aAAa,CAAC,MAAM,CAAC,EAAC,CAAC,CAAC,CAAC,EAAE,CACzD,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casomoltd/nhs-pay",
3
- "version": "0.27.0",
3
+ "version": "0.29.0",
4
4
  "description": "NHS pay scales and take-home pay, and a member's NHS pension across the 1995, 2008 and 2015 Sections",
5
5
  "homepage": "https://casomo.co.uk",
6
6
  "bugs": "https://github.com/casomoltd/nhs-pay/issues",
@@ -67,10 +67,10 @@
67
67
  "provenance": true
68
68
  },
69
69
  "peerDependencies": {
70
- "@casomoltd/paye-calc": ">=0.10.0"
70
+ "@casomoltd/paye-calc": ">=0.12.0"
71
71
  },
72
72
  "devDependencies": {
73
- "@casomoltd/paye-calc": "^0.10.0",
73
+ "@casomoltd/paye-calc": "^0.12.0",
74
74
  "@casomoltd/tooling": "^0.37.0",
75
75
  "@commitlint/cli": "^20.0.0",
76
76
  "@js-temporal/polyfill": "^0.5.1",
@@ -1,462 +0,0 @@
1
- /**
2
- * A member's benefits across every section they hold: built once from
3
- * what the member told us, then asked one question per set of
4
- * retirement choices.
5
- *
6
- * Everything ABOUT the member goes in once, when the owner is built;
7
- * each method takes only the question. So a caller never assembles the
8
- * member again per option, and no section, pay path or ledger is a
9
- * thing it has to build.
10
- *
11
- * Rules come in two tiers. Each section's own — denominator, pay
12
- * measure, pension age, lump sum, factors — belong to that section;
13
- * the ones a caller reads are the legacy section's, through
14
- * `MemberBenefits.legacy`. The rules over the whole set live
15
- * here: which sections a member holds and whether their service is
16
- * eligible for the McCloud remedy, then, at the drawing, summing every
17
- * award into one pension and one automatic lump sum and taking cash
18
- * across that one total.
19
- */
20
- import { cashAt, nhsCommutationLimits } from './commutation.js';
21
- import { BenefitNotModelled, invariant, NOT_MODELLED } from './errors.js';
22
- import { isoDate, isoDateOf, isoToDate } from './iso-date.js';
23
- import { normalPensionAge } from './pension/ages.js';
24
- import { buildPayPath } from './pay-path.js';
25
- import { earliest } from './dates.js';
26
- import { buildCurve, walkThrough } from './pension/curve.js';
27
- import { seedFromBalanceAt } from './pension/uplift.js';
28
- import { estimateHistory } from './pension/history.js';
29
- import { moneyAt, sumMoney } from './pension/money.js';
30
- import { createPrices, createPublishedPrices, TODAYS_MONEY_CPI, } from './pension/prices.js';
31
- import { schemeYearEndDate, schemeYearEndFor, seedFromJoinDate, } from './pension/seed.js';
32
- import { finalSalaryBenefit, unreducedPension, } from './sections/final-salary.js';
33
- import { RULES_1995 } from './sections/section-1995.js';
34
- import { RULES_2008 } from './sections/section-2008.js';
35
- import { careerAverage } from './sections/section-2015.js';
36
- import { npaDate } from './dates.js';
37
- // ── Vocabulary ──────────────────────────────────────
38
- /**
39
- * One scheme, the NHS Pension Scheme, in three sections. "Scheme" only
40
- * ever means the whole; each part is a section, as a member's own
41
- * Annual Benefit Statement prints it.
42
- */
43
- export const SECTIONS = {
44
- s1995: 'section-1995',
45
- s2008: 'section-2008',
46
- s2015: 'section-2015',
47
- };
48
- /** How the cash ruler reads the years behind the run date. */
49
- export const PAST_YEARS = {
50
- /** The assumption throughout, as for the years ahead. */
51
- assumed: 'assumed',
52
- /** The published record: each year's Revaluation Order, and pay
53
- * carried into each year's cash by the same Orders' CPI, an
54
- * approximation to the pay awards — the ledger an Annual Benefit
55
- * Statement prints. See `createPublishedPrices`. */
56
- published: 'published',
57
- };
58
- /** The price series each reading of the past is priced on. Total over
59
- * `PastYears`, so a new reading fails the build until it has one. */
60
- const CASH_SERIES = {
61
- [PAST_YEARS.assumed]: createPrices,
62
- [PAST_YEARS.published]: createPublishedPrices,
63
- };
64
- /**
65
- * How the remedy window is valued, for a member who has one: as more
66
- * service in their legacy section, or under the 2015 Section's rules
67
- * while still paid from the legacy section. There is no default and no
68
- * preferred answer: which pays more depends on the choices a caller
69
- * compares, and the library cannot see them.
70
- */
71
- export const REMEDY_BASES = {
72
- none: 'none',
73
- legacy: 'legacy-basis',
74
- section2015: 'section-2015-basis',
75
- };
76
- // ── What the library answers with ───────────────────
77
- /** What a period is: service in its own right, or the McCloud remedy
78
- * window, held in the legacy section and valued on either basis. */
79
- export const PERIOD_KINDS = {
80
- ordinary: 'ordinary',
81
- remedyWindow: 'remedy-window',
82
- };
83
- /** How a section accrues: on final salary, or on a career average. */
84
- export const ACCRUALS = {
85
- finalSalary: 'final-salary',
86
- careerAverage: 'career-average',
87
- };
88
- /** A legacy section's rules, as `MemberBenefits.legacy` states them. */
89
- function legacyOf(section) {
90
- const rules = RULES[section];
91
- return {
92
- section,
93
- pensionAge: rules.pensionAge,
94
- denominator: rules.denominator,
95
- automaticLumpSum: rules.automaticLumpSum?.multiple ?? null,
96
- lateUplift: rules.lateUplift,
97
- };
98
- }
99
- // ── The service, checked ────────────────────────────
100
- /** The remedy period, 1 April 2015 to 31 March 2022, as PSPJOA 2022
101
- * s.1 defines it. The days either side are derived from it. */
102
- const REMEDY_FROM = isoDate('2015-04-01');
103
- const REMEDY_TO = isoDate('2022-03-31');
104
- /** PSPJOA 2022 s.1: in pensionable service "on 31 March 2012 or any
105
- * earlier day". */
106
- const ELIGIBLE_BY = isoDate('2012-03-31');
107
- /** Rollback put remedy service back in the legacy section on this
108
- * date (SI 2023/985), so a statement before it counts the remedy
109
- * years in the 2015 Section. */
110
- const ROLLBACK = isoDate('2023-10-01');
111
- /**
112
- * The dates the McCloud remedy turns on, for a caller that has to read
113
- * a member's answers against them before it can declare their service.
114
- */
115
- export const REMEDY = {
116
- eligibleBy: ELIGIBLE_BY,
117
- from: REMEDY_FROM,
118
- to: REMEDY_TO,
119
- rollback: ROLLBACK,
120
- };
121
- /**
122
- * The day each later section opened: the 2008 Section to new joiners
123
- * under SI 2008/653, and the 2015 Section, which every member moved to
124
- * for service from that day, under SI 2015/94. The 1995 Section is
125
- * absent: no answer a member gives turns on its opening.
126
- */
127
- export const SECTION_OPENED = {
128
- [SECTIONS.s2008]: isoDate('2008-04-01'),
129
- [SECTIONS.s2015]: REMEDY_FROM,
130
- };
131
- const on = (d) => isoToDate(d);
132
- const daysFrom = (d, days) => {
133
- const date = on(d);
134
- return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);
135
- };
136
- const dayAfter = (d) => daysFrom(d, 1);
137
- const LAST_BEFORE_2015 = isoDateOf(daysFrom(REMEDY_FROM, -1));
138
- const AFTER_REMEDY = isoDateOf(dayAfter(REMEDY_TO));
139
- /** The last day a period is valued to: its own end, or the leaving
140
- * date where that comes first or the period is still open. */
141
- const until = (p, leaving) => p.to === null || on(p.to) > leaving ? leaving : on(p.to);
142
- const isLegacy = (section) => section !== SECTIONS.s2015;
143
- /**
144
- * The periods a member holds, derived from what they declared and
145
- * refused where it describes something the library does not model.
146
- *
147
- * Service is taken as continuous. A break — a gap between one period
148
- * and the next — decides whether remedy service qualifies, and how a
149
- * member comes to hold both legacy sections; both are deferred, so a
150
- * declared break is refused rather than priced as though it were
151
- * continuous: https://github.com/casomoltd/nhs-pay/issues/16
152
- *
153
- * A member with no 2015 Section service after rollback is refused
154
- * too: https://github.com/casomoltd/nhs-pay/issues/19
155
- *
156
- * A declaration that cannot be true — nothing declared, leaving
157
- * before joining, periods that overlap — is a caller's mistake and
158
- * throws RangeError.
159
- */
160
- function servicePeriods(declared) {
161
- if (declared.length === 0) {
162
- throw new RangeError('member: no service declared');
163
- }
164
- const sorted = [...declared].sort((a, b) => on(a.joined).getTime() - on(b.joined).getTime());
165
- sorted.forEach((p, i) => {
166
- if (p.left !== null && on(p.left) < on(p.joined)) {
167
- throw new RangeError(`member: ${p.section} left before it was joined`);
168
- }
169
- const next = sorted.at(i + 1);
170
- if (next === undefined)
171
- return;
172
- if (p.left === null || on(next.joined) <= on(p.left)) {
173
- throw new RangeError(`member: ${p.section} overlaps the next period`);
174
- }
175
- if (dayAfter(p.left).getTime() !== on(next.joined).getTime()) {
176
- throw new BenefitNotModelled(NOT_MODELLED.breakInService, 'a break in pensionable service');
177
- }
178
- });
179
- const legacyDeclared = sorted.filter((p) => isLegacy(p.section));
180
- const reformed = sorted.filter((p) => p.section === SECTIONS.s2015);
181
- if (legacyDeclared.length > 1) {
182
- throw new BenefitNotModelled(NOT_MODELLED.bothLegacySections, 'service in both legacy sections');
183
- }
184
- const current = reformed.at(0);
185
- if (current === undefined || reformed.length > 1) {
186
- throw new BenefitNotModelled(NOT_MODELLED.no2015Section, 'service without the 2015 Section');
187
- }
188
- const held = legacyDeclared.at(0);
189
- const end = current.left;
190
- const remedy = held !== undefined
191
- && on(held.joined) <= on(ELIGIBLE_BY)
192
- && (end === null || on(end) >= on(REMEDY_FROM));
193
- if (remedy && end !== null && on(end) <= on(REMEDY_TO)) {
194
- throw new BenefitNotModelled(NOT_MODELLED.remedyMemberLeftEarly, 'a remedy member who left before 1 April 2022');
195
- }
196
- let legacy = null;
197
- if (held !== undefined && isLegacy(held.section)) {
198
- // A legacy period before a 2015 one has a leaving date: the
199
- // contiguity check above refused an open one.
200
- invariant(held.left !== null, 'a legacy period with no end');
201
- const own = {
202
- section: held.section,
203
- from: held.joined,
204
- to: remedy ? LAST_BEFORE_2015 : held.left,
205
- kind: PERIOD_KINDS.ordinary,
206
- };
207
- legacy = {
208
- section: held.section,
209
- periods: remedy
210
- ? [own, {
211
- section: held.section, from: REMEDY_FROM, to: REMEDY_TO,
212
- kind: PERIOD_KINDS.remedyWindow,
213
- }]
214
- : [own],
215
- };
216
- }
217
- const periods = [
218
- ...(legacy?.periods ?? []),
219
- {
220
- section: SECTIONS.s2015,
221
- from: remedy ? AFTER_REMEDY : current.joined,
222
- to: end,
223
- kind: PERIOD_KINDS.ordinary,
224
- },
225
- ];
226
- return { periods, legacy };
227
- }
228
- // ── The owner ───────────────────────────────────────
229
- const RULES = {
230
- [SECTIONS.s1995]: RULES_1995,
231
- [SECTIONS.s2008]: RULES_2008,
232
- };
233
- /** A career average walk over `window`, accruing only inside it. */
234
- function walk(b, window, seed, { leaving, drawing }, prices) {
235
- const first = schemeYearEndFor(on(window.from));
236
- const last = schemeYearEndFor(until(window, leaving));
237
- return careerAverage({
238
- seed,
239
- payIn: (year) => (year >= first && year <= last
240
- ? b.payPath.payFor(year)
241
- : null),
242
- dateOfBirth: b.born,
243
- leaving,
244
- drawing,
245
- prices,
246
- through: walkThrough(drawing, b.npaOn),
247
- });
248
- }
249
- /** The 2015 Section's own seed: its statement, or its first day. */
250
- function seed2015(b, { leaving, drawing }, prices) {
251
- const { statement } = b.member;
252
- return statement === null
253
- ? seedFromJoinDate(on(b.ordinary2015.from))
254
- : seedFromBalanceAt(statement.accruedPension, on(statement.asAt), leaving, drawing, prices);
255
- }
256
- /** The legacy windows as final-salary membership, to `leaving`. */
257
- const membershipOf = (valued, leaving) => valued
258
- .filter((p) => on(p.from) <= leaving)
259
- .map((p) => ({ from: on(p.from), to: until(p, leaving) }));
260
- /** What the member holds today, with the remedy window on the legacy
261
- * basis: unreduced, since nothing is drawn. */
262
- function holdings(b) {
263
- const { today } = b;
264
- const bySection = [];
265
- const flat = (x) => moneyAt({ nominal: x, real: x }, today);
266
- if (b.legacy !== null) {
267
- const { pension, automaticLumpSum } = unreducedPension(RULES[b.legacy.section], membershipOf(b.legacy.periods, today), b.payPath, schemeYearEndFor(today));
268
- bySection.push({
269
- section: b.legacy.section,
270
- pension: flat(pension),
271
- automaticLumpSum: flat(automaticLumpSum),
272
- });
273
- }
274
- // Any leaving and drawing after today give the same balance today;
275
- // these are only where the walk has to stop.
276
- const leaving = b.ordinary2015.to === null
277
- ? b.npaOn
278
- : on(b.ordinary2015.to);
279
- const dates = { leaving, drawing: leaving < b.npaOn ? b.npaOn : leaving };
280
- const accrued = walk(b, b.ordinary2015, seed2015(b, dates, b.todaysPrices), dates, b.todaysPrices).ledger.accruedAt(today);
281
- bySection.push({
282
- section: SECTIONS.s2015,
283
- pension: flat(accrued),
284
- automaticLumpSum: flat(0),
285
- });
286
- return {
287
- bySection, total: sumMoney(bySection.map((x) => x.pension), today),
288
- };
289
- }
290
- /** Refuse choices that cannot be valued, and return their dates. */
291
- function checked(b, remedy, choices) {
292
- const leaving = on(choices.leaving);
293
- const drawing = on(choices.drawing);
294
- if (drawing < leaving) {
295
- throw new RangeError('at: drawn before leaving');
296
- }
297
- if (b.ordinary2015.to !== null && on(b.ordinary2015.to) < leaving) {
298
- throw new RangeError(`at: leaving after the member already left, on ${b.ordinary2015.to}`);
299
- }
300
- if (remedy !== (choices.remedy.kind !== REMEDY_BASES.none)) {
301
- throw new RangeError(remedy
302
- ? 'at: a remedy member needs an election'
303
- : 'at: an election for a member with no remediable service');
304
- }
305
- return { leaving, drawing };
306
- }
307
- /** The legacy section's final-salary award over the periods valued on
308
- * final salary, which the election decides. */
309
- function legacyAward(b, legacy, valued, dates) {
310
- const rules = RULES[legacy.section];
311
- const benefit = finalSalaryBenefit(rules, {
312
- windows: membershipOf(valued, dates.leaving),
313
- payPath: b.payPath, dateOfBirth: b.born, ...dates,
314
- prices: b.cashPrices,
315
- });
316
- return {
317
- section: legacy.section,
318
- periods: valued,
319
- beforeFactor: benefit.beforeFactor,
320
- pension: benefit.pension,
321
- automaticLumpSum: benefit.automaticLumpSum,
322
- factor: benefit.factor,
323
- ledgers: null,
324
- provenance: {
325
- accrual: ACCRUALS.finalSalary,
326
- denominator: rules.denominator,
327
- payMeasure: rules.payMeasure,
328
- membership: benefit.membership,
329
- finalPay: benefit.finalPay,
330
- },
331
- };
332
- }
333
- /** A career average award over one window, walked in both rulers. */
334
- function careerAward(b, section, window, seedFor, dates) {
335
- const cash = walk(b, window, seedFor(b.cashPrices), dates, b.cashPrices);
336
- const todays = walk(b, window, seedFor(b.todaysPrices), dates, b.todaysPrices);
337
- return {
338
- award: {
339
- section,
340
- periods: [window],
341
- beforeFactor: moneyAt({ nominal: cash.revalued, real: todays.revalued }, dates.drawing),
342
- pension: moneyAt({ nominal: cash.drawn, real: todays.drawn }, dates.drawing),
343
- automaticLumpSum: moneyAt({ nominal: 0, real: 0 }, dates.drawing),
344
- factor: cash.factor,
345
- ledgers: { cash: cash.ledger, todaysMoney: todays.ledger },
346
- provenance: { accrual: ACCRUALS.careerAverage },
347
- },
348
- cash,
349
- todays,
350
- };
351
- }
352
- /** The 2015 Section's balance, with its estimated run-up before a
353
- * statement, as the ledgers, history and curve a `Position` carries. */
354
- function section2015(b, own, { leaving, drawing }) {
355
- const historyIn = (r, prices) => b.member.statement === null
356
- ? null
357
- : estimateHistory({
358
- joinDate: on(b.ordinary2015.from),
359
- statedBalance: r.seed.opening,
360
- statementSchemeYearEnd: r.seed.atSchemeYearEnd,
361
- prices,
362
- });
363
- const cashHistory = historyIn(own.cash, b.cashPrices);
364
- const todaysHistory = historyIn(own.todays, b.todaysPrices);
365
- const run = (r, history) => ({
366
- today: b.today, dateOfBirth: b.born, exitDate: leaving,
367
- retirementDate: drawing, npa: normalPensionAge(b.born),
368
- ledger: r.ledger, history,
369
- curveFrom: earliest(b.today, leaving, schemeYearEndDate(history === null
370
- ? r.seed.atSchemeYearEnd
371
- : history.from - 1)),
372
- });
373
- return {
374
- ledger: own.cash.ledger,
375
- todaysMoneyLedger: own.todays.ledger,
376
- estimatedHistory: todaysHistory,
377
- curve: buildCurve(run(own.cash, cashHistory), run(own.todays, todaysHistory)),
378
- };
379
- }
380
- /** Every section's award at one set of choices, summed, with cash taken
381
- * across the total. */
382
- function position(b, remedy, choices) {
383
- const dates = checked(b, remedy, choices);
384
- const onThe2015Basis = choices.remedy.kind === REMEDY_BASES.section2015;
385
- const awards = [];
386
- const { legacy } = b;
387
- if (legacy !== null) {
388
- // On the legacy basis every legacy period is final salary; on the
389
- // 2015 basis the remedy window leaves it for a career average walk.
390
- const window = legacy.periods.find((p) => p.kind === PERIOD_KINDS.remedyWindow);
391
- const valued = onThe2015Basis
392
- ? legacy.periods.filter((p) => p.kind === PERIOD_KINDS.ordinary)
393
- : legacy.periods;
394
- awards.push(legacyAward(b, legacy, valued, dates));
395
- if (onThe2015Basis) {
396
- // `checked` refused an election for a member with no window.
397
- invariant(window !== undefined, 'a 2015 basis with no remedy window');
398
- awards.push(careerAward(b, legacy.section, window, () => seedFromJoinDate(on(window.from)), dates).award);
399
- }
400
- }
401
- const own = careerAward(b, SECTIONS.s2015, b.ordinary2015, (prices) => seed2015(b, dates, prices), dates);
402
- awards.push(own.award);
403
- const pension = sumMoney(awards.map((a) => a.pension), dates.drawing);
404
- const automaticLumpSum = sumMoney(awards.map((a) => a.automaticLumpSum), dates.drawing);
405
- return {
406
- choices,
407
- awards,
408
- crystallised: { pension, automaticLumpSum },
409
- cash: cashAt(pension, automaticLumpSum, choices.cash, nhsCommutationLimits(b.cashPrices)),
410
- prices: b.cashPrices,
411
- ...section2015(b, own, dates),
412
- };
413
- }
414
- /**
415
- * Build a member's benefits. Throws `PayPathUnavailable` where there
416
- * is no current pay to build pay from, `BenefitNotModelled` for service
417
- * the library does not model, and RangeError for a declaration that
418
- * cannot be true.
419
- *
420
- * `today` is required because it decides which answer comes back: it
421
- * is the date the figures are as at, so a figure reproduces as at it.
422
- */
423
- export function memberBenefits(member, assumptions, today) {
424
- const { periods, legacy } = servicePeriods(member.service);
425
- const remedy = periods.some((p) => p.kind === PERIOD_KINDS.remedyWindow);
426
- // Deferred until the split of a pre-rollback balance is read:
427
- // https://github.com/casomoltd/nhs-pay/issues/20
428
- if (remedy && member.statement !== null
429
- && on(member.statement.asAt) < on(ROLLBACK)) {
430
- throw new BenefitNotModelled(NOT_MODELLED.statementBeforeRollback, 'a statement from before rollback on 1 October 2023, which '
431
- + 'counts the remedy years in the 2015 Section');
432
- }
433
- // Deferred until part-time final-salary membership is modelled:
434
- // https://github.com/casomoltd/nhs-pay/issues/26
435
- if (member.pay.partTime === true && legacy !== null) {
436
- throw new BenefitNotModelled(NOT_MODELLED.partTimeLegacy, 'part-time pay with 1995 or 2008 Section service, which counts '
437
- + 'part-time membership pro rata on whole-time final pay');
438
- }
439
- const ordinary2015 = periods.at(-1);
440
- invariant(ordinary2015?.section === SECTIONS.s2015, 'the last period is the 2015 Section\'s');
441
- const born = on(member.dateOfBirth);
442
- const built = {
443
- member,
444
- today,
445
- born,
446
- npaOn: npaDate(born, normalPensionAge(born)),
447
- payPath: buildPayPath(member.dateOfBirth, member.pay),
448
- legacy,
449
- ordinary2015,
450
- cashPrices: CASH_SERIES[assumptions.pastYears](assumptions.assumedCpi, today),
451
- todaysPrices: createPrices(TODAYS_MONEY_CPI, today),
452
- };
453
- return {
454
- periods,
455
- remedy,
456
- legacy: legacy === null ? null : legacyOf(legacy.section),
457
- payPath: built.payPath,
458
- now: () => holdings(built),
459
- at: (choices) => position(built, remedy, choices),
460
- };
461
- }
462
- //# sourceMappingURL=member-benefits.js.map
@@ -1 +0,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