@casomoltd/nhs-pay 0.26.0 → 0.28.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.
- package/dist/additional-pension.js +57 -33
- package/dist/additional-pension.js.map +1 -1
- package/dist/dates.d.ts +2 -0
- package/dist/dates.js +17 -3
- package/dist/dates.js.map +1 -1
- package/dist/factor-basis.d.ts +1 -10
- package/dist/factor-basis.js +1 -10
- package/dist/factor-basis.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/iso-date.d.ts +4 -9
- package/dist/iso-date.js +10 -11
- package/dist/iso-date.js.map +1 -1
- package/dist/member/benefits.d.ts +11 -0
- package/dist/member/benefits.js +179 -0
- package/dist/member/benefits.js.map +1 -0
- package/dist/member/index.d.ts +9 -0
- package/dist/member/index.js +9 -0
- package/dist/member/index.js.map +1 -0
- package/dist/member/service.d.ts +65 -0
- package/dist/member/service.js +166 -0
- package/dist/member/service.js.map +1 -0
- package/dist/{member-benefits.d.ts → member/types.d.ts} +30 -41
- package/dist/member/types.js +46 -0
- package/dist/member/types.js.map +1 -0
- package/dist/member/valuation.d.ts +67 -0
- package/dist/member/valuation.js +157 -0
- package/dist/member/valuation.js.map +1 -0
- package/dist/pension/ages.d.ts +105 -0
- package/dist/pension/ages.js +138 -0
- package/dist/pension/ages.js.map +1 -0
- package/dist/sections/section-1995.js +2 -1
- package/dist/sections/section-1995.js.map +1 -1
- package/dist/sections/section-2008.js +2 -1
- package/dist/sections/section-2008.js.map +1 -1
- package/dist/sections/section-2015.js +1 -1
- package/dist/sections/section-2015.js.map +1 -1
- package/dist/sources.d.ts +19 -2
- package/dist/sources.js +37 -3
- package/dist/sources.js.map +1 -1
- package/package.json +3 -3
- package/dist/member-benefits.js +0 -462
- package/dist/member-benefits.js.map +0 -1
- package/dist/npa.d.ts +0 -28
- package/dist/npa.js +0 -60
- package/dist/npa.js.map +0 -1
package/dist/sources.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* allowance — so a second copy of its url or issue date is a second
|
|
8
8
|
* copy that can fall out of step with the first.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* Five kinds live here and the difference is load-bearing:
|
|
11
11
|
*
|
|
12
12
|
* - **Award instruments** — what a nation ACCEPTED. A written
|
|
13
13
|
* ministerial statement, a gov.scot news page, a Welsh written
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
* - **Scale circulars** — what PUBLISHES the salary figures. Prints a
|
|
16
16
|
* pay table, often no percentage at all.
|
|
17
17
|
* - **Allowance letters** — what sets a cash allowance per session.
|
|
18
|
+
* - **Scheme statements** — what an issuer says of a scheme: a factsheet,
|
|
19
|
+
* or a government response, which says so where it cites no instrument.
|
|
20
|
+
* - **Legislation** — an Act's own provision, where the rule a figure
|
|
21
|
+
* turns on is the statute's rather than the scheme's.
|
|
18
22
|
*
|
|
19
23
|
* They diverge in every nation. England's 2026-27 medical award was
|
|
20
24
|
* enacted by HCWS1462 on parliament.uk while its salaries are printed
|
|
@@ -207,7 +211,7 @@ export const AFC_W_02_2026 = new DocumentSource({
|
|
|
207
211
|
* Wales applies to its lowest spine points.
|
|
208
212
|
*
|
|
209
213
|
* A LETTER that sets an allowance, not a circular that publishes a
|
|
210
|
-
* ladder — the third of `DocumentSource`'s
|
|
214
|
+
* ladder — the third of `DocumentSource`'s kinds. It carries
|
|
211
215
|
* the hourly floor in its Action paragraph and the annual floor in
|
|
212
216
|
* its own spine-point table, and neither derives from the other, so
|
|
213
217
|
* both are transcribed from it in `scales.ts`.
|
|
@@ -393,7 +397,24 @@ export const HSC_TC8_05_2025 = new DocumentSource({
|
|
|
393
397
|
nextExpectedReason: 'the 2026-27 HSC(TC8) medical & dental pay circular, which has '
|
|
394
398
|
+ 'not been issued',
|
|
395
399
|
});
|
|
396
|
-
// ── Scheme
|
|
400
|
+
// ── Scheme statements ─────────────────────────────
|
|
401
|
+
/** DHSC on who the 2028 rise in the minimum age reaches; archived as SA-59 in
|
|
402
|
+
* docs/source-archive.md. A petition response that cites no instrument. */
|
|
403
|
+
export const DHSC_PETITION_779519 = new DocumentSource({
|
|
404
|
+
issuer: 'the Department of Health and Social Care',
|
|
405
|
+
reference: 'Government response to petition 779519',
|
|
406
|
+
url: 'https://petition.parliament.uk/petitions/779519?reveal_response=yes',
|
|
407
|
+
issued: isoDate('2026-10-19'),
|
|
408
|
+
});
|
|
409
|
+
/** The Scottish scheme's own statement of who keeps 55; archived as SA-61 in
|
|
410
|
+
* docs/source-archive.md, the version with paragraph 9 updated. */
|
|
411
|
+
export const SPPA_NHS_CIRCULAR_2025_09 = new DocumentSource({
|
|
412
|
+
issuer: 'the Scottish Public Pensions Agency',
|
|
413
|
+
reference: 'NHS Circular 2025/09, Increase to the normal minimum pension age',
|
|
414
|
+
url: 'https://pensions.gov.scot/sites/default/files/2025-07/NHS_Circular_2025-09'
|
|
415
|
+
+ '_Increase_to_the_normal_minimum_pension_age_from_6_April_2028.pdf',
|
|
416
|
+
issued: isoDate('2025-11-04'),
|
|
417
|
+
});
|
|
397
418
|
/** The additional pension limit and unit; archived as SA-58 in
|
|
398
419
|
* docs/source-archive.md. */
|
|
399
420
|
export const AP_FACTSHEET_2026 = new DocumentSource({
|
|
@@ -407,4 +428,17 @@ export const AP_FACTSHEET_2026 = new DocumentSource({
|
|
|
407
428
|
// expected each April.
|
|
408
429
|
nextExpected: isoDate('2027-04-01'),
|
|
409
430
|
});
|
|
431
|
+
// ── Legislation ───────────────────────────────────
|
|
432
|
+
/** The protected pension age kept through the 2028 rise in the minimum age:
|
|
433
|
+
* Finance Act 2004 Sch 36 para 23ZB, inserted by Finance Act 2022 s.10(5)
|
|
434
|
+
* (Royal Assent 24 February 2022); archived as SA-60 in docs/source-archive.md.
|
|
435
|
+
* paye-calc's `minimumPensionAgeFor` models the rule, and
|
|
436
|
+
* `memberMinimumPensionAge` applies it to the scheme's right from 55. Held
|
|
437
|
+
* here because paye-calc keeps no source records. */
|
|
438
|
+
export const FA2004_SCH36_PARA_23ZB = new DocumentSource({
|
|
439
|
+
issuer: 'Parliament',
|
|
440
|
+
reference: 'Finance Act 2004, Schedule 36, paragraph 23ZB',
|
|
441
|
+
url: 'https://www.legislation.gov.uk/ukpga/2004/12/schedule/36/paragraph/23ZB',
|
|
442
|
+
issued: isoDate('2022-02-24'),
|
|
443
|
+
});
|
|
410
444
|
//# sourceMappingURL=sources.js.map
|
package/dist/sources.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../src/sources.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../src/sources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAEtC,oDAAoD;AAEpD;;;6BAG6B;AAC7B,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,cAAc,CAAC;IAC9C,MAAM,EAAE,mBAAmB;IAC3B,SAAS,EAAE,wCAAwC;IACnD,GAAG,EAAE,+DAA+D;UAChE,6BAA6B;IACjC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;IAC7B,2DAA2D;IAC3D,oCAAoC;IACpC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,cAAc,CAAC;IAC5C,MAAM,EAAE,sBAAsB;IAC9B,SAAS,EAAE,2CAA2C;IACtD,GAAG,EAAE,uBAAuB;UACxB,qEAAqE;IACzE,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;IAC7B,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gB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E,qEAAqE;IAC1E,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;CAChC,CAAC,CAAC;AAEH;oEACoE;AACpE,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,cAAc,CAAC;IACxD,MAAM,EAAE,qCAAqC;IAC7C,SAAS,EAAE,kEAAkE;IAC7E,GAAG,EAAE,4EAA4E;UAC7E,mEAAmE;IACvE,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;CAChC,CAAC,CAAC;AAEH;8BAC8B;AAC9B,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,cAAc,CAAC;IAChD,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,oDAAoD;IAC/D,GAAG,EAAE,uDAAuD;UACxD,oDAAoD;UACpD,0BAA0B;IAC9B,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;IAC7B,gEAAgE;IAChE,uBAAuB;IACvB,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC;CACtC,CAAC,CAAC;AAEH,qDAAqD;AAErD;;;;;sDAKsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,cAAc,CAAC;IACrD,MAAM,EAAE,YAAY;IACpB,SAAS,EAAE,+CAA+C;IAC1D,GAAG,EAAE,yEAAyE;IAC9E,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC;CAChC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casomoltd/nhs-pay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.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.
|
|
70
|
+
"@casomoltd/paye-calc": ">=0.12.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@casomoltd/paye-calc": "^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",
|
package/dist/member-benefits.js
DELETED
|
@@ -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 './npa.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,0 @@
|
|
|
1
|
-
{"version":3,"file":"member-benefits.js","sourceRoot":"","sources":["../src/member-benefits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAC,MAAM,EAAE,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAC,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAGxE,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,GACtD,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAC,UAAU,EAAC,MAAM,4B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MAAM,KAAK,GAAU;QACnB,MAAM;QACN,KAAK;QACL,IAAI;QACJ,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC5C,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC;QACrD,MAAM;QACN,YAAY;QACZ,UAAU,EAAE,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAC5C,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC;QAChC,YAAY,EAAE,YAAY,CAAC,gBAAgB,EAAE,KAAK,CAAC;KACpD,CAAC;IACF,OAAO;QACL,OAAO;QACP,MAAM;QACN,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;QACzD,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC1B,EAAE,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
package/dist/npa.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NHS 2015 scheme normal pension age.
|
|
3
|
-
*
|
|
4
|
-
* NPA = the member's State Pension age, with a floor of 65
|
|
5
|
-
* (NHSBSA 2015 Members' Guide V13, May 2024). The SPA timetable
|
|
6
|
-
* is legislated — Pensions Acts 1995/2007/2011/2014 — and
|
|
7
|
-
* reproduced in gov.uk's "State Pension age timetable"
|
|
8
|
-
* (last updated 15 May 2014; the legislated dates have not
|
|
9
|
-
* changed since — the 2023 SPA review left them as enacted).
|
|
10
|
-
*
|
|
11
|
-
* Whole years only. The Acts phase each rise through narrow
|
|
12
|
-
* transitional birth cohorts whose exact SPA is 65/66/67 plus
|
|
13
|
-
* some months; this function returns the NEXT whole year for
|
|
14
|
-
* those cohorts (66/67/68). Rounding up is member-conservative,
|
|
15
|
-
* in the same spirit as the ERF part-month round-up (GAD 2019
|
|
16
|
-
* guidance §2.3): a projection anchored on the later NPA can
|
|
17
|
-
* understate early-retirement pension by a few months' factor,
|
|
18
|
-
* never overstate it. Callers needing month-exact SPA for the
|
|
19
|
-
* transitional cohorts need the per-cohort tables in the Acts,
|
|
20
|
-
* which this library deliberately does not transcribe.
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Normal pension age for a 2015-scheme member born on
|
|
24
|
-
* `dateOfBirth`, in whole years (see the module header for the
|
|
25
|
-
* transitional-cohort rounding). The result is what
|
|
26
|
-
* `projectPension` expects as its `npa` input.
|
|
27
|
-
*/
|
|
28
|
-
export declare function normalPensionAge(dateOfBirth: Date): number;
|