@casomoltd/nhs-pay 0.30.0 → 0.31.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/README.md +69 -251
- package/dist/bands.d.ts +9 -1
- package/dist/bands.js +20 -0
- package/dist/bands.js.map +1 -1
- package/dist/document-source.d.ts +16 -0
- package/dist/document-source.js +3 -1
- package/dist/document-source.js.map +1 -1
- package/dist/errors.d.ts +46 -11
- package/dist/errors.js +68 -28
- package/dist/errors.js.map +1 -1
- package/dist/factor-basis.d.ts +14 -0
- package/dist/factor-basis.js.map +1 -1
- package/dist/index.d.ts +13 -11
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/member/benefits.js +18 -11
- package/dist/member/benefits.js.map +1 -1
- package/dist/member/index.d.ts +1 -1
- package/dist/member/input-period.d.ts +4 -4
- package/dist/member/input-period.js +11 -9
- package/dist/member/input-period.js.map +1 -1
- package/dist/member/service.d.ts +4 -0
- package/dist/member/service.js +9 -3
- package/dist/member/service.js.map +1 -1
- package/dist/member/types.d.ts +81 -49
- package/dist/member/types.js.map +1 -1
- package/dist/member/valuation.d.ts +10 -8
- package/dist/member/valuation.js +17 -21
- package/dist/member/valuation.js.map +1 -1
- package/dist/pay-path.d.ts +21 -25
- package/dist/pay-path.js +85 -67
- package/dist/pay-path.js.map +1 -1
- package/dist/pension/ages.d.ts +6 -4
- package/dist/pension/ages.js +6 -4
- package/dist/pension/ages.js.map +1 -1
- package/dist/pension/curve.d.ts +2 -1
- package/dist/pension/curve.js +15 -7
- package/dist/pension/curve.js.map +1 -1
- package/dist/pension/history.d.ts +18 -3
- package/dist/pension/history.js +12 -5
- package/dist/pension/history.js.map +1 -1
- package/dist/pension/ledger.d.ts +15 -9
- package/dist/pension/ledger.js +91 -56
- package/dist/pension/ledger.js.map +1 -1
- package/dist/pension/prices.d.ts +11 -2
- package/dist/pension/prices.js +35 -14
- package/dist/pension/prices.js.map +1 -1
- package/dist/pension/scheme-year.d.ts +59 -0
- package/dist/pension/scheme-year.js +80 -0
- package/dist/pension/scheme-year.js.map +1 -0
- package/dist/pension/seed.d.ts +66 -50
- package/dist/pension/seed.js +111 -65
- package/dist/pension/seed.js.map +1 -1
- package/dist/pension/uplift.d.ts +13 -33
- package/dist/pension/uplift.js +11 -56
- package/dist/pension/uplift.js.map +1 -1
- package/dist/pension-projection.js +30 -22
- package/dist/pension-projection.js.map +1 -1
- package/dist/post.d.ts +1 -10
- package/dist/post.js +1 -12
- package/dist/post.js.map +1 -1
- package/dist/revaluation.d.ts +34 -35
- package/dist/revaluation.js +41 -41
- package/dist/revaluation.js.map +1 -1
- package/dist/scale-point.d.ts +6 -0
- package/dist/sections/final-salary.d.ts +3 -8
- package/dist/sections/final-salary.js +13 -9
- package/dist/sections/final-salary.js.map +1 -1
- package/dist/sections/section-2015.d.ts +2 -1
- package/dist/sections/section-2015.js.map +1 -1
- package/dist/sources.d.ts +10 -0
- package/dist/sources.js +20 -0
- package/dist/sources.js.map +1 -1
- package/dist/take-home.d.ts +4 -20
- package/dist/take-home.js +3 -23
- package/dist/take-home.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-period.js","sourceRoot":"","sources":["../../src/member/input-period.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,+BAA+B,EAAE,cAAc,EAAE,aAAa,EAC9D,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGzC,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"input-period.js","sourceRoot":"","sources":["../../src/member/input-period.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL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AAC,EAAC,MAAM,EAAE,MAAM,EAAM,EAAE,EAAQ;IAC5C,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAChE,CAAC;AAED;;mBAEmB;AACnB,SAAS,UAAU,CACjB,MAAgC,EAAE,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAU;IAEhE,MAAM,UAAU,GAAG,IAAI,KAAK,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACnD,OAAO;QACL,cAAc,EAAE,OAAO,CAAC,OAAO;QAC/B,cAAc,EAAE,OAAO,CAAC,OAAO;QAC/B,cAAc,EAAE,OAAO,CAAC,OAAO;QAC/B,cAAc,EAAE,OAAO,CAAC,OAAO;KAChC,CAAC;AACJ,CAAC"}
|
package/dist/member/service.d.ts
CHANGED
|
@@ -62,6 +62,10 @@ export declare function legacyPeriodsOf({ own, window }: LegacyHolding): Service
|
|
|
62
62
|
/** The last day a period is valued to: its own end, or the leaving
|
|
63
63
|
* date where that comes first or the period is still open. */
|
|
64
64
|
export declare function until(p: ServicePeriod, leaving: Date): Date;
|
|
65
|
+
/** The elections a member may be valued on: both bases for a remedy
|
|
66
|
+
* member, `none` alone for anyone else. The one place that rule lives,
|
|
67
|
+
* read by `MemberBenefits.elections` and by the refusal below. */
|
|
68
|
+
export declare function electionsFor(remedy: boolean): readonly RemedyBasis[];
|
|
65
69
|
/** Refuse a remedy member with no election, or an election for anyone
|
|
66
70
|
* else: which basis applies is the caller's to say, never ours. */
|
|
67
71
|
export declare function refuseElectionMismatch(asked: keyof MemberBenefits, remedy: boolean, basis: RemedyBasis): void;
|
package/dist/member/service.js
CHANGED
|
@@ -84,12 +84,18 @@ export function legacyPeriodsOf({ own, window }) {
|
|
|
84
84
|
export function until(p, leaving) {
|
|
85
85
|
return p.to === null || isoToDate(p.to) > leaving ? leaving : isoToDate(p.to);
|
|
86
86
|
}
|
|
87
|
+
/** The elections a member may be valued on: both bases for a remedy
|
|
88
|
+
* member, `none` alone for anyone else. The one place that rule lives,
|
|
89
|
+
* read by `MemberBenefits.elections` and by the refusal below. */
|
|
90
|
+
export function electionsFor(remedy) {
|
|
91
|
+
return remedy
|
|
92
|
+
? [REMEDY_BASES.legacy, REMEDY_BASES.section2015]
|
|
93
|
+
: [REMEDY_BASES.none];
|
|
94
|
+
}
|
|
87
95
|
/** Refuse a remedy member with no election, or an election for anyone
|
|
88
96
|
* else: which basis applies is the caller's to say, never ours. */
|
|
89
97
|
export function refuseElectionMismatch(asked, remedy, basis) {
|
|
90
|
-
|
|
91
|
-
const electionMatches = remedy === elects;
|
|
92
|
-
if (electionMatches)
|
|
98
|
+
if (electionsFor(remedy).includes(basis))
|
|
93
99
|
return;
|
|
94
100
|
throw new RangeError(remedy
|
|
95
101
|
? `${asked}: a remedy member needs an election`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/member/service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AACzE,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AA+BhE;gEACgE;AAChE,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAC1C,MAAM,SAAS,GAAG,OAAO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
|
7
7
|
import type { PensionInputPeriod, TaxYearEnd } from '@casomoltd/paye-calc';
|
|
8
8
|
import type { CashChoice, CommutationResult } from '../commutation.js';
|
|
9
|
-
import type { FactorOutcome } from '../factor-basis.js';
|
|
9
|
+
import type { Factored, FactorOutcome } from '../factor-basis.js';
|
|
10
10
|
import type { IsoDate } from '../iso-date.js';
|
|
11
11
|
import type { MemberPay, PayPath } from '../pay-path.js';
|
|
12
12
|
import type { ProjectionPoint } from '../pension/curve.js';
|
|
@@ -14,6 +14,7 @@ import type { EstimatedHistory } from '../pension/history.js';
|
|
|
14
14
|
import type { MemberLedger } from '../pension/ledger.js';
|
|
15
15
|
import type { ProjectionMoney } from '../pension/money.js';
|
|
16
16
|
import type { Prices } from '../pension/prices.js';
|
|
17
|
+
import type { SchemeYearEnd } from '../pension/scheme-year.js';
|
|
17
18
|
import type { FinalSalaryRules, PayMeasure } from '../sections/final-salary.js';
|
|
18
19
|
/**
|
|
19
20
|
* One scheme, the NHS Pension Scheme, in three sections. "Scheme" only
|
|
@@ -40,13 +41,40 @@ export interface Member {
|
|
|
40
41
|
readonly dateOfBirth: IsoDate;
|
|
41
42
|
readonly service: readonly DeclaredPeriod[];
|
|
42
43
|
readonly pay: MemberPay;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
/** The 2015 Section balance off the member's Annual Benefit Statement;
|
|
45
|
+
* null where they gave none. */
|
|
46
|
+
readonly statement: StatementBalance | null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A 2015 Section balance read off an Annual Benefit Statement, which seeds
|
|
50
|
+
* its ledger at the close of `yearEnd`.
|
|
51
|
+
*
|
|
52
|
+
* A scheme year rather than a date, because an Annual Benefit Statement is
|
|
53
|
+
* always as at 31 March, so a mid-year date cannot be stated. NHSBSA says
|
|
54
|
+
* so in the two pages `sources.ts` exports as `NHSBSA_STATEMENT_GUIDE` and
|
|
55
|
+
* `NHSBSA_ESTIMATE_GUIDE` (SA-63 and SA-64 in docs/source-archive.md). The
|
|
56
|
+
* Scottish and Northern Irish administrators say the same of theirs: SPPA's
|
|
57
|
+
* statement "estimates your pension benefits accrued up to the end of the
|
|
58
|
+
* most recent financial year" (SA-65), its practitioners' running "12 months
|
|
59
|
+
* in arrears", so to the end of the financial year before (SA-66); HSC's
|
|
60
|
+
* is "a snapshot of your pension benefits up to 31st March that year"
|
|
61
|
+
* (SA-67).
|
|
62
|
+
*
|
|
63
|
+
* Out of scope: a deferred member's statement valued at the date of
|
|
64
|
+
* leaving, which NHSBSA's estimate request also offers; a retirement
|
|
65
|
+
* estimate on any other date; and the projection to normal pension age an
|
|
66
|
+
* active member's statement shows from 2026, which is not the accrued
|
|
67
|
+
* balance and is never passed here. NHSBSA: "From 2026, if you're an
|
|
68
|
+
* active member in the 2015 Scheme" the figure "is a projection" (SA-68).
|
|
69
|
+
*
|
|
70
|
+
* Nothing is read before the statement: a read on an earlier date, or a
|
|
71
|
+
* leaving before it, throws `BeforeStatement`.
|
|
72
|
+
*/
|
|
73
|
+
export interface StatementBalance {
|
|
74
|
+
readonly accruedPension: number;
|
|
75
|
+
/** The scheme year the statement runs to; its balance is at that
|
|
76
|
+
* year's 31 March. */
|
|
77
|
+
readonly yearEnd: SchemeYearEnd;
|
|
50
78
|
}
|
|
51
79
|
/** How the cash ruler reads the years behind the run date. */
|
|
52
80
|
export declare const PAST_YEARS: {
|
|
@@ -127,33 +155,18 @@ export interface Award {
|
|
|
127
155
|
/** Where it is held and paid from. */
|
|
128
156
|
readonly section: SectionId;
|
|
129
157
|
readonly periods: readonly ServicePeriod[];
|
|
130
|
-
/** The PENSION at the drawing before its factor
|
|
131
|
-
* measured
|
|
132
|
-
readonly
|
|
133
|
-
/**
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
* cannot forget to ask
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
*
|
|
141
|
-
|
|
142
|
-
readonly automaticLumpSumBeforeFactor: ProjectionMoney;
|
|
143
|
-
/** The PENSION's early or late factor. The lump sum is reduced by its
|
|
144
|
-
* own, `automaticLumpSumFactor`, so read the lump sum before it from
|
|
145
|
-
* `automaticLumpSumBeforeFactor`, never by dividing by this. */
|
|
146
|
-
readonly pensionFactor: FactorOutcome;
|
|
147
|
-
/** The automatic lump sum's own early or late factor; null where the
|
|
148
|
-
* rules pay no automatic lump sum, as a career average award never
|
|
149
|
-
* does. */
|
|
150
|
-
readonly automaticLumpSumFactor: FactorOutcome | null;
|
|
151
|
-
/** A career average award's year-by-year walk, in cash and in today's
|
|
152
|
-
* money; null for final salary, which keeps no balance to walk. */
|
|
153
|
-
readonly ledgers: {
|
|
154
|
-
readonly cash: MemberLedger;
|
|
155
|
-
readonly todaysMoney: MemberLedger;
|
|
156
|
-
} | null;
|
|
158
|
+
/** The PENSION at the drawing: before its factor, final salary as
|
|
159
|
+
* measured or the career average pot as revalued; and after it. */
|
|
160
|
+
readonly pension: Factored;
|
|
161
|
+
/** The automatic lump sum at the drawing, on the same rulers: before its
|
|
162
|
+
* own factor it is the section's multiple of the pension before
|
|
163
|
+
* factor. Nil rather than absent where the rules pay none, as a career
|
|
164
|
+
* average award never does, so a caller cannot forget to ask; its
|
|
165
|
+
* factor is then null. */
|
|
166
|
+
readonly automaticLumpSum: Factored<FactorOutcome | null>;
|
|
167
|
+
/** A career average award's year-by-year walk; null for final salary,
|
|
168
|
+
* which keeps no balance to walk. */
|
|
169
|
+
readonly ledgers: RulerLedgers | null;
|
|
157
170
|
readonly provenance: {
|
|
158
171
|
readonly accrual: typeof ACCRUALS.finalSalary;
|
|
159
172
|
readonly denominator: FinalSalaryRules['denominator'];
|
|
@@ -183,21 +196,30 @@ export interface Position {
|
|
|
183
196
|
/** The price series the cash reading walked with, for converting an
|
|
184
197
|
* outside figure — a cap, a target — into the same rulers. */
|
|
185
198
|
readonly prices: Prices;
|
|
186
|
-
/** The 2015 Section's
|
|
187
|
-
*
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
*
|
|
195
|
-
*
|
|
199
|
+
/** The 2015 Section's own walk: a final-salary section keeps no
|
|
200
|
+
* year-by-year balance to walk. */
|
|
201
|
+
readonly section2015: Section2015Walk;
|
|
202
|
+
}
|
|
203
|
+
/** The 2015 Section's balance as `at()` walked it, read against a
|
|
204
|
+
* statement, which covers this one section. */
|
|
205
|
+
export interface Section2015Walk {
|
|
206
|
+
/** The walk as the member reads it on a statement, in cash, and the
|
|
207
|
+
* same walk in today's money: the same objects as the 2015 Section
|
|
208
|
+
* award's own `ledgers`. */
|
|
209
|
+
readonly ledgers: RulerLedgers;
|
|
210
|
+
/** The years before a stated balance, estimated in today's money; null
|
|
211
|
+
* where the member gave no statement, or joined in its own year.
|
|
212
|
+
* Calibrated to land exactly on the stated balance. */
|
|
196
213
|
readonly estimatedHistory: EstimatedHistory | null;
|
|
197
|
-
/** The
|
|
198
|
-
* rulers. */
|
|
214
|
+
/** The balance at each scheme year end, both rulers. */
|
|
199
215
|
readonly curve: readonly ProjectionPoint[];
|
|
200
216
|
}
|
|
217
|
+
/** One career average walk on both rulers: in cash, and in today's
|
|
218
|
+
* money. */
|
|
219
|
+
export interface RulerLedgers {
|
|
220
|
+
readonly cash: MemberLedger;
|
|
221
|
+
readonly todaysMoney: MemberLedger;
|
|
222
|
+
}
|
|
201
223
|
/** A legacy section's rules, read from its statute. */
|
|
202
224
|
export interface LegacyRules {
|
|
203
225
|
readonly section: LegacySectionId;
|
|
@@ -230,11 +252,20 @@ export interface MemberBenefits {
|
|
|
230
252
|
/** Whether they have a remedy window, and so must pass an election
|
|
231
253
|
* to `at()`. */
|
|
232
254
|
readonly remedy: boolean;
|
|
255
|
+
/** The McCloud elections this member is compared on, each one `at()`
|
|
256
|
+
* and `pensionInputPeriod` accept: both bases for a remedy member, in
|
|
257
|
+
* `REMEDY_BASES` order, and `none` alone otherwise. */
|
|
258
|
+
readonly elections: readonly RemedyBasis[];
|
|
233
259
|
/** The legacy section they hold and its rules; null where they hold
|
|
234
260
|
* the 2015 Section alone. */
|
|
235
261
|
readonly legacy: LegacyRules | null;
|
|
236
262
|
/** The pay every section reads, built once for the member. */
|
|
237
263
|
readonly payPath: PayPath;
|
|
264
|
+
/** The statement's 31 March, the first date the 2015 Section balance is
|
|
265
|
+
* answered on: a read before it, or a leaving before it, throws
|
|
266
|
+
* `BeforeStatement`, so a caller can check its own dates first. Null
|
|
267
|
+
* where the member gave no statement and every date is answered. */
|
|
268
|
+
readonly statementAnswersFrom: Date | null;
|
|
238
269
|
/** The earliest age this member may draw every section they hold on
|
|
239
270
|
* `drawing`, other than through ill health: the law's minimum pension
|
|
240
271
|
* age on that day, or the protected age they keep. A 1995 Section age
|
|
@@ -263,8 +294,9 @@ export interface MemberBenefits {
|
|
|
263
294
|
* arrangement's pension and automatic lump sum at the year's start and
|
|
264
295
|
* end, before any early or late factor, in cash at `assumedCpi` (a
|
|
265
296
|
* decimal) on this member's reading of the past years, whatever CPI they
|
|
266
|
-
* were built at. The period
|
|
267
|
-
* published past years it is the
|
|
297
|
+
* were built at. The period carries `taxYearEnd` as its own, and its
|
|
298
|
+
* `cpi` is read from that series, so on published past years it is the
|
|
299
|
+
* Order's figure. The year the member
|
|
268
300
|
* leaves in closes on the leaving date, and every year after holds the
|
|
269
301
|
* deferred benefits. Throws RangeError for a year before 2016-17, a
|
|
270
302
|
* leaving after the one declared, or an election `at()` would refuse
|
package/dist/member/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/member/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/member/types.ts"],"names":[],"mappings":"AAmBA,uDAAuD;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,cAAc;CACb,CAAC;AA2DX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,yDAAyD;IACzD,OAAO,EAAE,SAAS;IAClB;;;yDAGqD;IACrD,SAAS,EAAE,WAAW;CACd,CAAC;AAcX;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,cAAc;IACtB,WAAW,EAAE,oBAAoB;CACzB,CAAC;AAmBX,uDAAuD;AAEvD;qEACqE;AACrE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,eAAe;CACrB,CAAC;AAYX,sEAAsE;AACtE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,WAAW,EAAE,cAAc;IAC3B,aAAa,EAAE,gBAAgB;CACvB,CAAC"}
|
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
* The owner in `benefits.ts` decides which awards a drawing has and sums
|
|
9
9
|
* them.
|
|
10
10
|
*/
|
|
11
|
-
import type { Award, Holdings, Member, MemberBenefits,
|
|
11
|
+
import type { Award, Holdings, Member, MemberBenefits, Section2015Walk, ServicePeriod } from './types.js';
|
|
12
12
|
import type { LegacySectionId, RemedyBasis, SectionId } from './types.js';
|
|
13
13
|
import type { LegacyHolding } from './service.js';
|
|
14
14
|
import type { JoiningHistory } from '../pension/ages.js';
|
|
15
15
|
import type { PayPath } from '../pay-path.js';
|
|
16
16
|
import type { MemberLedger } from '../pension/ledger.js';
|
|
17
17
|
import type { Prices } from '../pension/prices.js';
|
|
18
|
+
import type { SchemeYearEnd } from '../pension/scheme-year.js';
|
|
18
19
|
import type { LedgerSeed } from '../pension/seed.js';
|
|
19
20
|
import type { FinalSalaryRules, UnreducedPension } from '../sections/final-salary.js';
|
|
20
21
|
import { careerAverage } from '../sections/section-2015.js';
|
|
@@ -50,11 +51,11 @@ interface CareerAward {
|
|
|
50
51
|
readonly todays: CareerAverageRun;
|
|
51
52
|
}
|
|
52
53
|
/** What a career average award values: a window of one section, and the
|
|
53
|
-
* seed its walk starts from in
|
|
54
|
+
* seed its walk starts from, the same in both price series. */
|
|
54
55
|
interface CareerWindow {
|
|
55
56
|
readonly section: SectionId;
|
|
56
57
|
readonly window: ServicePeriod;
|
|
57
|
-
readonly
|
|
58
|
+
readonly seed: LedgerSeed;
|
|
58
59
|
}
|
|
59
60
|
/** One walk: a window, its seed, and the price series it walks in. */
|
|
60
61
|
interface Walk {
|
|
@@ -82,8 +83,9 @@ export declare function finalSalaryValued(legacy: LegacyHolding, basis: RemedyBa
|
|
|
82
83
|
/** A remedy window's seed on the 2015 basis: it walks from its first day,
|
|
83
84
|
* since no statement counts the remedy years in the 2015 Section. */
|
|
84
85
|
export declare function windowSeed(window: ServicePeriod): LedgerSeed;
|
|
85
|
-
/** The 2015 Section's own seed: its statement,
|
|
86
|
-
|
|
86
|
+
/** The 2015 Section's own seed: its statement, at the 31 March closing
|
|
87
|
+
* the year it runs to, or its first day. */
|
|
88
|
+
export declare function seed2015(b: Built): LedgerSeed;
|
|
87
89
|
/** What the member holds today, with the remedy window on the legacy
|
|
88
90
|
* basis: unreduced, since nothing is drawn. A member who has left holds
|
|
89
91
|
* their deferred benefits, final pay measured at leaving. */
|
|
@@ -92,10 +94,10 @@ export declare function holdings(b: Built): Holdings;
|
|
|
92
94
|
* final salary, which the election decides. */
|
|
93
95
|
export declare function legacyAward(b: Built, { section, valued }: FinalSalaryValued, dates: Drawing): Award;
|
|
94
96
|
/** A career average award over one window, walked in both rulers. */
|
|
95
|
-
export declare function careerAward(b: Built, { section, window,
|
|
97
|
+
export declare function careerAward(b: Built, { section, window, seed }: CareerWindow, dates: Drawing): CareerAward;
|
|
96
98
|
/** The 2015 Section's balance, with its estimated run-up before a
|
|
97
99
|
* statement, as the ledgers, history and curve a `Position` carries. */
|
|
98
|
-
export declare function section2015(b: Built, own: CareerAward, { leaving, drawing }: Drawing):
|
|
100
|
+
export declare function section2015(b: Built, own: CareerAward, { leaving, drawing }: Drawing): Section2015Walk;
|
|
99
101
|
/**
|
|
100
102
|
* The same walk as the ledger alone, with no drawing on it, through the
|
|
101
103
|
* scheme year ending in `through`: what the window holds on any date to
|
|
@@ -103,7 +105,7 @@ export declare function section2015(b: Built, own: CareerAward, { leaving, drawi
|
|
|
103
105
|
* no factor to read, and a factor read for a drawing far past the pension
|
|
104
106
|
* age is one GAD's tables may not price.
|
|
105
107
|
*/
|
|
106
|
-
export declare function accruedLedger(b: Built, { window, seed, prices }: Walk, { leaving, drawing }: Drawing, through:
|
|
108
|
+
export declare function accruedLedger(b: Built, { window, seed, prices }: Walk, { leaving, drawing }: Drawing, through: SchemeYearEnd): MemberLedger;
|
|
107
109
|
/** Refuse a leaving after the one the member declared, naming `asked`,
|
|
108
110
|
* the call a caller was answering: service that has ended cannot run on. */
|
|
109
111
|
export declare function refuseLeavingAfterDeclared(asked: keyof MemberBenefits, b: Built, leaving: Date): void;
|
package/dist/member/valuation.js
CHANGED
|
@@ -5,10 +5,10 @@ import { normalPensionAge } from '../pension/ages.js';
|
|
|
5
5
|
import { earliest } from '../dates.js';
|
|
6
6
|
import { buildCurve, walkThrough } from '../pension/curve.js';
|
|
7
7
|
import { buildLedger } from '../pension/ledger.js';
|
|
8
|
-
import { seedFromBalanceAt } from '../pension/uplift.js';
|
|
9
8
|
import { estimateHistory } from '../pension/history.js';
|
|
10
9
|
import { moneyAt, sumMoney } from '../pension/money.js';
|
|
11
|
-
import { schemeYearEndDate, schemeYearEndFor,
|
|
10
|
+
import { schemeYearBefore, schemeYearEndDate, schemeYearEndFor, } from '../pension/scheme-year.js';
|
|
11
|
+
import { seedFromJoinDate, seedFromStatement } from '../pension/seed.js';
|
|
12
12
|
import { finalSalaryBenefit, unreducedPension, } from '../sections/final-salary.js';
|
|
13
13
|
import { RULES_1995 } from '../sections/section-1995.js';
|
|
14
14
|
import { RULES_2008 } from '../sections/section-2008.js';
|
|
@@ -45,12 +45,13 @@ export function finalSalaryValued(legacy, basis) {
|
|
|
45
45
|
export function windowSeed(window) {
|
|
46
46
|
return seedFromJoinDate(isoToDate(window.from));
|
|
47
47
|
}
|
|
48
|
-
/** The 2015 Section's own seed: its statement,
|
|
49
|
-
|
|
48
|
+
/** The 2015 Section's own seed: its statement, at the 31 March closing
|
|
49
|
+
* the year it runs to, or its first day. */
|
|
50
|
+
export function seed2015(b) {
|
|
50
51
|
const { statement } = b.member;
|
|
51
52
|
return statement === null
|
|
52
53
|
? seedFromJoinDate(isoToDate(b.ordinary2015.from))
|
|
53
|
-
:
|
|
54
|
+
: seedFromStatement(statement.accruedPension, statement.yearEnd);
|
|
54
55
|
}
|
|
55
56
|
/** What the member holds today, with the remedy window on the legacy
|
|
56
57
|
* basis: unreduced, since nothing is drawn. A member who has left holds
|
|
@@ -73,7 +74,7 @@ export function holdings(b) {
|
|
|
73
74
|
const dates = walkDates(b, left ?? b.npaOn);
|
|
74
75
|
const accrued = walk(b, {
|
|
75
76
|
window: b.ordinary2015,
|
|
76
|
-
seed: seed2015(b
|
|
77
|
+
seed: seed2015(b),
|
|
77
78
|
prices: b.todaysPrices,
|
|
78
79
|
}, dates).ledger.accruedAt(today);
|
|
79
80
|
bySection.push({
|
|
@@ -97,12 +98,8 @@ export function legacyAward(b, { section, valued }, dates) {
|
|
|
97
98
|
return {
|
|
98
99
|
section,
|
|
99
100
|
periods: valued,
|
|
100
|
-
pensionBeforeFactor: benefit.pensionBeforeFactor,
|
|
101
101
|
pension: benefit.pension,
|
|
102
102
|
automaticLumpSum: benefit.automaticLumpSum,
|
|
103
|
-
automaticLumpSumBeforeFactor: benefit.automaticLumpSumBeforeFactor,
|
|
104
|
-
pensionFactor: benefit.pensionFactor,
|
|
105
|
-
automaticLumpSumFactor: benefit.automaticLumpSumFactor,
|
|
106
103
|
ledgers: null,
|
|
107
104
|
provenance: {
|
|
108
105
|
accrual: ACCRUALS.finalSalary,
|
|
@@ -114,8 +111,8 @@ export function legacyAward(b, { section, valued }, dates) {
|
|
|
114
111
|
};
|
|
115
112
|
}
|
|
116
113
|
/** A career average award over one window, walked in both rulers. */
|
|
117
|
-
export function careerAward(b, { section, window,
|
|
118
|
-
const walkIn = (prices) => walk(b, { window, seed
|
|
114
|
+
export function careerAward(b, { section, window, seed }, dates) {
|
|
115
|
+
const walkIn = (prices) => walk(b, { window, seed, prices }, dates);
|
|
119
116
|
const cash = walkIn(b.cashPrices);
|
|
120
117
|
const todays = walkIn(b.todaysPrices);
|
|
121
118
|
// A career average award pays no automatic lump sum, before or after a
|
|
@@ -125,12 +122,12 @@ export function careerAward(b, { section, window, seedFor }, dates) {
|
|
|
125
122
|
award: {
|
|
126
123
|
section,
|
|
127
124
|
periods: [window],
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
125
|
+
pension: {
|
|
126
|
+
beforeFactor: moneyAt({ nominal: cash.revalued, real: todays.revalued }, dates.drawing),
|
|
127
|
+
after: moneyAt({ nominal: cash.drawn, real: todays.drawn }, dates.drawing),
|
|
128
|
+
factor: cash.factor,
|
|
129
|
+
},
|
|
130
|
+
automaticLumpSum: { beforeFactor: noLumpSum, after: noLumpSum, factor: null },
|
|
134
131
|
ledgers: { cash: cash.ledger, todaysMoney: todays.ledger },
|
|
135
132
|
provenance: { accrual: ACCRUALS.careerAverage },
|
|
136
133
|
},
|
|
@@ -157,11 +154,10 @@ export function section2015(b, own, { leaving, drawing }) {
|
|
|
157
154
|
ledger: r.ledger, history,
|
|
158
155
|
curveFrom: earliest(b.today, leaving, schemeYearEndDate(history === null
|
|
159
156
|
? r.seed.atSchemeYearEnd
|
|
160
|
-
: history.from
|
|
157
|
+
: schemeYearBefore(history.from))),
|
|
161
158
|
});
|
|
162
159
|
return {
|
|
163
|
-
|
|
164
|
-
todaysMoneyLedger: own.todays.ledger,
|
|
160
|
+
ledgers: { cash: own.cash.ledger, todaysMoney: own.todays.ledger },
|
|
165
161
|
estimatedHistory: todaysHistory,
|
|
166
162
|
curve: buildCurve(run(own.cash, cashHistory), run(own.todays, todaysHistory)),
|
|
167
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valuation.js","sourceRoot":"","sources":["../../src/member/valuation.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAI5D,OAAO,EAAC,eAAe,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"valuation.js","sourceRoot":"","sources":["../../src/member/valuation.ts"],"names":[],"mappings":"AAaA,OAAO,EAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAI5D,OAAO,EAAC,eAAe,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,qBAAqB,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;QACP,MAAM;QACN,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC;KACvC,CAAC,CAAC;AACL,CAAC;AAED;kBACkB;AAClB,SAAS,SAAS,CAAC,CAAQ,EAAE,MAAqB,EAAE,OAAa;IAC/D,MAAM,KAAK,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,IAAI;QAC7C,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;QACxB,CAAC,CAAC,IAAI,CAAC,CAAC;AACZ,CAAC;AAED,mEAAmE;AACnE,SAAS,YAAY,CACnB,MAAgC,EAAE,OAAa;IAE/C,OAAO,MAAM;SACV,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC;SAC3C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,EAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/pay-path.d.ts
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import type { IsoDate } from './iso-date.js';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
* GAD's promotional pay index at an age: growth from promotion and
|
|
5
|
-
* progression over and above general pay awards, 100 at age 25,
|
|
6
|
-
* linear between the published five-year rows and flat beyond their
|
|
7
|
-
* ends.
|
|
8
|
-
*
|
|
9
|
-
* **The two non-manual columns, averaged.** GAD splits the index by
|
|
10
|
-
* sex and we do not ask a member's sex, nor infer it: averaging is
|
|
11
|
-
* the only version that encodes no guess about the member. It
|
|
12
|
-
* overstates progression for women and understates it for men, which a
|
|
13
|
-
* caller showing its figures should disclose. Non-manual is not a second
|
|
14
|
-
* assumption — every Agenda for Change band is non-manual in GAD's
|
|
15
|
-
* terms.
|
|
16
|
-
*/
|
|
17
|
-
export declare function promotionalIndex(age: number): number;
|
|
2
|
+
import type { SchemeYearEnd } from './pension/scheme-year.js';
|
|
3
|
+
import type { PayLadder } from './scale-point.js';
|
|
18
4
|
/**
|
|
19
5
|
* A year's pensionable pay the member gave us, in today's money, which
|
|
20
6
|
* the field's name says so a caller cannot pass a payslip's cash
|
|
@@ -24,7 +10,7 @@ export declare function promotionalIndex(age: number): number;
|
|
|
24
10
|
* https://github.com/casomoltd/nhs-pay/issues/22
|
|
25
11
|
*/
|
|
26
12
|
export interface DeclaredPay {
|
|
27
|
-
readonly schemeYearEnd:
|
|
13
|
+
readonly schemeYearEnd: SchemeYearEnd;
|
|
28
14
|
readonly todaysMoney: number;
|
|
29
15
|
}
|
|
30
16
|
/** What a member told us about their pay. */
|
|
@@ -38,13 +24,8 @@ export interface MemberPay {
|
|
|
38
24
|
readonly asAt: IsoDate;
|
|
39
25
|
};
|
|
40
26
|
/** The member's pay scale and where on it they are, while steps
|
|
41
|
-
* remain. Null off a stepped scale, or at its top.
|
|
42
|
-
|
|
43
|
-
* scale does not have. */
|
|
44
|
-
readonly ladder: {
|
|
45
|
-
readonly points: readonly SteppedPoint[];
|
|
46
|
-
readonly current: SteppedPoint;
|
|
47
|
-
} | null;
|
|
27
|
+
* remain. Null off a stepped scale, or at its top. */
|
|
28
|
+
readonly ladder: PayLadder | null;
|
|
48
29
|
/** Whether `declared` and `current` are actual pay for fewer than
|
|
49
30
|
* full-time hours. The 2015 Section accrues on actual pay, so it prices
|
|
50
31
|
* them as given; the final-salary sections need whole-time pay and
|
|
@@ -67,7 +48,7 @@ export interface YearPay {
|
|
|
67
48
|
}
|
|
68
49
|
/** A member's pensionable pay, every scheme year, in today's money. */
|
|
69
50
|
export interface PayPath {
|
|
70
|
-
payFor(schemeYearEnd:
|
|
51
|
+
payFor(schemeYearEnd: SchemeYearEnd): YearPay;
|
|
71
52
|
}
|
|
72
53
|
/**
|
|
73
54
|
* Build a member's pay path. Refuses only where there is nothing to
|
|
@@ -75,3 +56,18 @@ export interface PayPath {
|
|
|
75
56
|
* and labelled as filled.
|
|
76
57
|
*/
|
|
77
58
|
export declare function buildPayPath(dateOfBirth: IsoDate, pay: MemberPay): PayPath;
|
|
59
|
+
/**
|
|
60
|
+
* GAD's promotional pay index at an age: growth from promotion and
|
|
61
|
+
* progression over and above general pay awards, 100 at age 25,
|
|
62
|
+
* linear between the published five-year rows and flat beyond their
|
|
63
|
+
* ends.
|
|
64
|
+
*
|
|
65
|
+
* **The two non-manual columns, averaged.** GAD splits the index by
|
|
66
|
+
* sex and we do not ask a member's sex, nor infer it: averaging is
|
|
67
|
+
* the only version that encodes no guess about the member. It
|
|
68
|
+
* overstates progression for women and understates it for men, which a
|
|
69
|
+
* caller showing its figures should disclose. Non-manual is not a second
|
|
70
|
+
* assumption — every Agenda for Change band is non-manual in GAD's
|
|
71
|
+
* terms.
|
|
72
|
+
*/
|
|
73
|
+
export declare function promotionalIndex(age: number): number;
|