@casomoltd/nhs-pay 0.29.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 +78 -249
- package/dist/bands.d.ts +9 -1
- package/dist/bands.js +20 -0
- package/dist/bands.js.map +1 -1
- package/dist/dates.d.ts +3 -0
- package/dist/dates.js +7 -2
- package/dist/dates.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 +41 -39
- package/dist/member/benefits.js.map +1 -1
- package/dist/member/index.d.ts +1 -1
- package/dist/member/input-period.d.ts +41 -0
- package/dist/member/input-period.js +168 -0
- package/dist/member/input-period.js.map +1 -0
- package/dist/member/service.d.ts +8 -1
- package/dist/member/service.js +18 -1
- package/dist/member/service.js.map +1 -1
- package/dist/member/types.d.ts +101 -44
- package/dist/member/types.js.map +1 -1
- package/dist/member/valuation.d.ts +72 -14
- package/dist/member/valuation.js +115 -34
- 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 +64 -52
- package/dist/sections/final-salary.js +131 -69
- 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,18 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Each section's award for a member, valued at one set of dates: the
|
|
3
3
|
* legacy section on final salary, the 2015 Section and a remedy window
|
|
4
|
-
* on its basis as career average walks,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* on its basis as career average walks. Beside them, what the member
|
|
5
|
+
* holds before any drawing: today's holdings, and the final-salary value
|
|
6
|
+
* and undrawn walk a tax year's pension input reads on a date. `Built`
|
|
7
|
+
* is everything about the member, derived once, that all of it reads.
|
|
8
|
+
* The owner in `benefits.ts` decides which awards a drawing has and sums
|
|
9
|
+
* them.
|
|
7
10
|
*/
|
|
8
|
-
import type { Award, Holdings, Member,
|
|
9
|
-
import type { LegacySectionId, SectionId } from './types.js';
|
|
11
|
+
import type { Award, Holdings, Member, MemberBenefits, Section2015Walk, ServicePeriod } from './types.js';
|
|
12
|
+
import type { LegacySectionId, RemedyBasis, SectionId } from './types.js';
|
|
10
13
|
import type { LegacyHolding } from './service.js';
|
|
11
14
|
import type { JoiningHistory } from '../pension/ages.js';
|
|
12
15
|
import type { PayPath } from '../pay-path.js';
|
|
16
|
+
import type { MemberLedger } from '../pension/ledger.js';
|
|
13
17
|
import type { Prices } from '../pension/prices.js';
|
|
18
|
+
import type { SchemeYearEnd } from '../pension/scheme-year.js';
|
|
14
19
|
import type { LedgerSeed } from '../pension/seed.js';
|
|
15
|
-
import type { FinalSalaryRules } from '../sections/final-salary.js';
|
|
20
|
+
import type { FinalSalaryRules, UnreducedPension } from '../sections/final-salary.js';
|
|
16
21
|
import { careerAverage } from '../sections/section-2015.js';
|
|
17
22
|
/** Everything about the member, derived once, that every question
|
|
18
23
|
* asked of them reads. */
|
|
@@ -25,6 +30,9 @@ export interface Built {
|
|
|
25
30
|
readonly npaOn: Date;
|
|
26
31
|
readonly payPath: PayPath;
|
|
27
32
|
readonly legacy: LegacyHolding | null;
|
|
33
|
+
/** Whether the member has a remedy window, and so must elect a basis
|
|
34
|
+
* for it, as every refusal of an election reads it. */
|
|
35
|
+
readonly remedy: boolean;
|
|
28
36
|
readonly ordinary2015: ServicePeriod;
|
|
29
37
|
readonly cashPrices: Prices;
|
|
30
38
|
readonly todaysPrices: Prices;
|
|
@@ -43,25 +51,75 @@ interface CareerAward {
|
|
|
43
51
|
readonly todays: CareerAverageRun;
|
|
44
52
|
}
|
|
45
53
|
/** What a career average award values: a window of one section, and the
|
|
46
|
-
* seed its walk starts from in
|
|
54
|
+
* seed its walk starts from, the same in both price series. */
|
|
47
55
|
interface CareerWindow {
|
|
48
56
|
readonly section: SectionId;
|
|
49
57
|
readonly window: ServicePeriod;
|
|
50
|
-
readonly
|
|
58
|
+
readonly seed: LedgerSeed;
|
|
51
59
|
}
|
|
60
|
+
/** One walk: a window, its seed, and the price series it walks in. */
|
|
61
|
+
interface Walk {
|
|
62
|
+
readonly window: ServicePeriod;
|
|
63
|
+
readonly seed: LedgerSeed;
|
|
64
|
+
readonly prices: Prices;
|
|
65
|
+
}
|
|
66
|
+
/** The legacy periods valued on final salary, which the election decides,
|
|
67
|
+
* and the section whose rules value them. */
|
|
68
|
+
interface FinalSalaryValued {
|
|
69
|
+
readonly section: LegacySectionId;
|
|
70
|
+
readonly valued: readonly ServicePeriod[];
|
|
71
|
+
}
|
|
72
|
+
/** A final-salary pension and automatic lump sum, unreduced, in today's
|
|
73
|
+
* money. */
|
|
74
|
+
type FinalSalaryHeld = Pick<UnreducedPension, 'pension' | 'automaticLumpSum'>;
|
|
52
75
|
/** Each legacy section's statute. */
|
|
53
76
|
export declare const RULES: Record<LegacySectionId, FinalSalaryRules>;
|
|
54
|
-
/**
|
|
55
|
-
export declare function
|
|
77
|
+
/** Whether an election walks the remedy window as career average. */
|
|
78
|
+
export declare function walksWindow(basis: RemedyBasis): boolean;
|
|
79
|
+
/** The legacy periods final salary values under an election: every one on
|
|
80
|
+
* the legacy basis; on the 2015 basis the section's own service alone,
|
|
81
|
+
* the remedy window leaving it for a career average walk. */
|
|
82
|
+
export declare function finalSalaryValued(legacy: LegacyHolding, basis: RemedyBasis): FinalSalaryValued;
|
|
83
|
+
/** A remedy window's seed on the 2015 basis: it walks from its first day,
|
|
84
|
+
* since no statement counts the remedy years in the 2015 Section. */
|
|
85
|
+
export declare function windowSeed(window: ServicePeriod): LedgerSeed;
|
|
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;
|
|
56
89
|
/** What the member holds today, with the remedy window on the legacy
|
|
57
|
-
* basis: unreduced, since nothing is drawn.
|
|
90
|
+
* basis: unreduced, since nothing is drawn. A member who has left holds
|
|
91
|
+
* their deferred benefits, final pay measured at leaving. */
|
|
58
92
|
export declare function holdings(b: Built): Holdings;
|
|
59
93
|
/** The legacy section's final-salary award over the periods valued on
|
|
60
94
|
* final salary, which the election decides. */
|
|
61
|
-
export declare function legacyAward(b: Built,
|
|
95
|
+
export declare function legacyAward(b: Built, { section, valued }: FinalSalaryValued, dates: Drawing): Award;
|
|
62
96
|
/** A career average award over one window, walked in both rulers. */
|
|
63
|
-
export declare function careerAward(b: Built, { section, window,
|
|
97
|
+
export declare function careerAward(b: Built, { section, window, seed }: CareerWindow, dates: Drawing): CareerAward;
|
|
64
98
|
/** The 2015 Section's balance, with its estimated run-up before a
|
|
65
99
|
* statement, as the ledgers, history and curve a `Position` carries. */
|
|
66
|
-
export declare function section2015(b: Built, own: CareerAward, { leaving, drawing }: Drawing):
|
|
100
|
+
export declare function section2015(b: Built, own: CareerAward, { leaving, drawing }: Drawing): Section2015Walk;
|
|
101
|
+
/**
|
|
102
|
+
* The same walk as the ledger alone, with no drawing on it, through the
|
|
103
|
+
* scheme year ending in `through`: what the window holds on any date to
|
|
104
|
+
* then, before any early or late factor. A valuation that never draws has
|
|
105
|
+
* no factor to read, and a factor read for a drawing far past the pension
|
|
106
|
+
* age is one GAD's tables may not price.
|
|
107
|
+
*/
|
|
108
|
+
export declare function accruedLedger(b: Built, { window, seed, prices }: Walk, { leaving, drawing }: Drawing, through: SchemeYearEnd): MemberLedger;
|
|
109
|
+
/** Refuse a leaving after the one the member declared, naming `asked`,
|
|
110
|
+
* the call a caller was answering: service that has ended cannot run on. */
|
|
111
|
+
export declare function refuseLeavingAfterDeclared(asked: keyof MemberBenefits, b: Built, leaving: Date): void;
|
|
112
|
+
/**
|
|
113
|
+
* The legacy section's final-salary pension and automatic lump sum held on
|
|
114
|
+
* `on`, unreduced, in today's money: membership to that day, on final pay
|
|
115
|
+
* measured back from it, as a leaving on it is measured. Where the member
|
|
116
|
+
* `left` before `on`, both are measured at leaving. `left` is the caller's:
|
|
117
|
+
* today's holdings read the declared leaving, and a tax year's input the
|
|
118
|
+
* leaving it was asked about.
|
|
119
|
+
*/
|
|
120
|
+
export declare function finalSalaryHeldOn(b: Built, { section, valued }: FinalSalaryValued, on: Date, left: Date | null): FinalSalaryHeld;
|
|
121
|
+
/** The dates a walk that never draws runs to: leaving, and a drawing at
|
|
122
|
+
* the pension age or at leaving where that is later. It reads no factor,
|
|
123
|
+
* so the drawing decides only which years after leaving are deferred. */
|
|
124
|
+
export declare function walkDates(b: Built, leaving: Date): Drawing;
|
|
67
125
|
export {};
|
package/dist/member/valuation.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { ACCRUALS, SECTIONS } from './types.js';
|
|
1
|
+
import { ACCRUALS, REMEDY_BASES, SECTIONS } from './types.js';
|
|
2
2
|
import { legacyPeriodsOf, until } from './service.js';
|
|
3
3
|
import { isoToDate } from '../iso-date.js';
|
|
4
4
|
import { normalPensionAge } from '../pension/ages.js';
|
|
5
5
|
import { earliest } from '../dates.js';
|
|
6
6
|
import { buildCurve, walkThrough } from '../pension/curve.js';
|
|
7
|
-
import {
|
|
7
|
+
import { buildLedger } from '../pension/ledger.js';
|
|
8
8
|
import { estimateHistory } from '../pension/history.js';
|
|
9
9
|
import { moneyAt, sumMoney } from '../pension/money.js';
|
|
10
|
-
import { schemeYearEndDate, schemeYearEndFor,
|
|
10
|
+
import { schemeYearBefore, schemeYearEndDate, schemeYearEndFor, } from '../pension/scheme-year.js';
|
|
11
|
+
import { seedFromJoinDate, seedFromStatement } from '../pension/seed.js';
|
|
11
12
|
import { finalSalaryBenefit, unreducedPension, } from '../sections/final-salary.js';
|
|
12
13
|
import { RULES_1995 } from '../sections/section-1995.js';
|
|
13
14
|
import { RULES_2008 } from '../sections/section-2008.js';
|
|
@@ -17,21 +18,51 @@ export const RULES = {
|
|
|
17
18
|
[SECTIONS.s1995]: RULES_1995,
|
|
18
19
|
[SECTIONS.s2008]: RULES_2008,
|
|
19
20
|
};
|
|
20
|
-
/**
|
|
21
|
-
|
|
21
|
+
/** How each election values the remedy window: on final salary, as more
|
|
22
|
+
* legacy service, or as a career average walk paid from the legacy
|
|
23
|
+
* section. No election means no window, so nothing walks. Total over
|
|
24
|
+
* `RemedyBasis`, so a new basis fails the build until it says which. */
|
|
25
|
+
const WINDOW_ACCRUAL = {
|
|
26
|
+
[REMEDY_BASES.none]: ACCRUALS.finalSalary,
|
|
27
|
+
[REMEDY_BASES.legacy]: ACCRUALS.finalSalary,
|
|
28
|
+
[REMEDY_BASES.section2015]: ACCRUALS.careerAverage,
|
|
29
|
+
};
|
|
30
|
+
/** Whether an election walks the remedy window as career average. */
|
|
31
|
+
export function walksWindow(basis) {
|
|
32
|
+
return WINDOW_ACCRUAL[basis] === ACCRUALS.careerAverage;
|
|
33
|
+
}
|
|
34
|
+
/** The legacy periods final salary values under an election: every one on
|
|
35
|
+
* the legacy basis; on the 2015 basis the section's own service alone,
|
|
36
|
+
* the remedy window leaving it for a career average walk. */
|
|
37
|
+
export function finalSalaryValued(legacy, basis) {
|
|
38
|
+
return {
|
|
39
|
+
section: legacy.section,
|
|
40
|
+
valued: walksWindow(basis) ? [legacy.own] : legacyPeriodsOf(legacy),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** A remedy window's seed on the 2015 basis: it walks from its first day,
|
|
44
|
+
* since no statement counts the remedy years in the 2015 Section. */
|
|
45
|
+
export function windowSeed(window) {
|
|
46
|
+
return seedFromJoinDate(isoToDate(window.from));
|
|
47
|
+
}
|
|
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) {
|
|
22
51
|
const { statement } = b.member;
|
|
23
52
|
return statement === null
|
|
24
53
|
? seedFromJoinDate(isoToDate(b.ordinary2015.from))
|
|
25
|
-
:
|
|
54
|
+
: seedFromStatement(statement.accruedPension, statement.yearEnd);
|
|
26
55
|
}
|
|
27
56
|
/** What the member holds today, with the remedy window on the legacy
|
|
28
|
-
* basis: unreduced, since nothing is drawn.
|
|
57
|
+
* basis: unreduced, since nothing is drawn. A member who has left holds
|
|
58
|
+
* their deferred benefits, final pay measured at leaving. */
|
|
29
59
|
export function holdings(b) {
|
|
30
60
|
const { today } = b;
|
|
61
|
+
const left = declaredLeaving(b);
|
|
31
62
|
const bySection = [];
|
|
32
63
|
const flat = (x) => moneyAt({ nominal: x, real: x }, today);
|
|
33
64
|
if (b.legacy !== null) {
|
|
34
|
-
const { pension, automaticLumpSum } =
|
|
65
|
+
const { pension, automaticLumpSum } = finalSalaryHeldOn(b, finalSalaryValued(b.legacy, REMEDY_BASES.legacy), today, left);
|
|
35
66
|
bySection.push({
|
|
36
67
|
section: b.legacy.section,
|
|
37
68
|
pension: flat(pension),
|
|
@@ -40,13 +71,10 @@ export function holdings(b) {
|
|
|
40
71
|
}
|
|
41
72
|
// Any leaving and drawing after today give the same balance today;
|
|
42
73
|
// these are only where the walk has to stop.
|
|
43
|
-
const
|
|
44
|
-
? b.npaOn
|
|
45
|
-
: isoToDate(b.ordinary2015.to);
|
|
46
|
-
const dates = { leaving, drawing: leaving < b.npaOn ? b.npaOn : leaving };
|
|
74
|
+
const dates = walkDates(b, left ?? b.npaOn);
|
|
47
75
|
const accrued = walk(b, {
|
|
48
76
|
window: b.ordinary2015,
|
|
49
|
-
seed: seed2015(b
|
|
77
|
+
seed: seed2015(b),
|
|
50
78
|
prices: b.todaysPrices,
|
|
51
79
|
}, dates).ledger.accruedAt(today);
|
|
52
80
|
bySection.push({
|
|
@@ -60,21 +88,18 @@ export function holdings(b) {
|
|
|
60
88
|
}
|
|
61
89
|
/** The legacy section's final-salary award over the periods valued on
|
|
62
90
|
* final salary, which the election decides. */
|
|
63
|
-
export function legacyAward(b,
|
|
64
|
-
const rules = RULES[
|
|
91
|
+
export function legacyAward(b, { section, valued }, dates) {
|
|
92
|
+
const rules = RULES[section];
|
|
65
93
|
const benefit = finalSalaryBenefit(rules, {
|
|
66
94
|
windows: membershipOf(valued, dates.leaving),
|
|
67
95
|
payPath: b.payPath, dateOfBirth: b.born, ...dates,
|
|
68
96
|
prices: b.cashPrices,
|
|
69
97
|
});
|
|
70
98
|
return {
|
|
71
|
-
section
|
|
99
|
+
section,
|
|
72
100
|
periods: valued,
|
|
73
|
-
beforeFactor: benefit.beforeFactor,
|
|
74
101
|
pension: benefit.pension,
|
|
75
102
|
automaticLumpSum: benefit.automaticLumpSum,
|
|
76
|
-
automaticLumpSumBeforeFactor: benefit.automaticLumpSumBeforeFactor,
|
|
77
|
-
factor: benefit.factor,
|
|
78
103
|
ledgers: null,
|
|
79
104
|
provenance: {
|
|
80
105
|
accrual: ACCRUALS.finalSalary,
|
|
@@ -86,8 +111,8 @@ export function legacyAward(b, legacy, valued, dates) {
|
|
|
86
111
|
};
|
|
87
112
|
}
|
|
88
113
|
/** A career average award over one window, walked in both rulers. */
|
|
89
|
-
export function careerAward(b, { section, window,
|
|
90
|
-
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);
|
|
91
116
|
const cash = walkIn(b.cashPrices);
|
|
92
117
|
const todays = walkIn(b.todaysPrices);
|
|
93
118
|
// A career average award pays no automatic lump sum, before or after a
|
|
@@ -97,11 +122,12 @@ export function careerAward(b, { section, window, seedFor }, dates) {
|
|
|
97
122
|
award: {
|
|
98
123
|
section,
|
|
99
124
|
periods: [window],
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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 },
|
|
105
131
|
ledgers: { cash: cash.ledger, todaysMoney: todays.ledger },
|
|
106
132
|
provenance: { accrual: ACCRUALS.careerAverage },
|
|
107
133
|
},
|
|
@@ -128,24 +154,70 @@ export function section2015(b, own, { leaving, drawing }) {
|
|
|
128
154
|
ledger: r.ledger, history,
|
|
129
155
|
curveFrom: earliest(b.today, leaving, schemeYearEndDate(history === null
|
|
130
156
|
? r.seed.atSchemeYearEnd
|
|
131
|
-
: history.from
|
|
157
|
+
: schemeYearBefore(history.from))),
|
|
132
158
|
});
|
|
133
159
|
return {
|
|
134
|
-
|
|
135
|
-
todaysMoneyLedger: own.todays.ledger,
|
|
160
|
+
ledgers: { cash: own.cash.ledger, todaysMoney: own.todays.ledger },
|
|
136
161
|
estimatedHistory: todaysHistory,
|
|
137
162
|
curve: buildCurve(run(own.cash, cashHistory), run(own.todays, todaysHistory)),
|
|
138
163
|
};
|
|
139
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* The same walk as the ledger alone, with no drawing on it, through the
|
|
167
|
+
* scheme year ending in `through`: what the window holds on any date to
|
|
168
|
+
* then, before any early or late factor. A valuation that never draws has
|
|
169
|
+
* no factor to read, and a factor read for a drawing far past the pension
|
|
170
|
+
* age is one GAD's tables may not price.
|
|
171
|
+
*/
|
|
172
|
+
export function accruedLedger(b, { window, seed, prices }, { leaving, drawing }, through) {
|
|
173
|
+
return buildLedger({
|
|
174
|
+
seed,
|
|
175
|
+
payIn: payInside(b, window, leaving),
|
|
176
|
+
exitDate: leaving,
|
|
177
|
+
retirementDate: drawing,
|
|
178
|
+
prices,
|
|
179
|
+
through,
|
|
180
|
+
drawingFor: () => null,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/** Refuse a leaving after the one the member declared, naming `asked`,
|
|
184
|
+
* the call a caller was answering: service that has ended cannot run on. */
|
|
185
|
+
export function refuseLeavingAfterDeclared(asked, b, leaving) {
|
|
186
|
+
const left = declaredLeaving(b);
|
|
187
|
+
if (left !== null && left < leaving) {
|
|
188
|
+
throw new RangeError(`${asked}: leaving after the member already left, on `
|
|
189
|
+
+ `${b.ordinary2015.to}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The legacy section's final-salary pension and automatic lump sum held on
|
|
194
|
+
* `on`, unreduced, in today's money: membership to that day, on final pay
|
|
195
|
+
* measured back from it, as a leaving on it is measured. Where the member
|
|
196
|
+
* `left` before `on`, both are measured at leaving. `left` is the caller's:
|
|
197
|
+
* today's holdings read the declared leaving, and a tax year's input the
|
|
198
|
+
* leaving it was asked about.
|
|
199
|
+
*/
|
|
200
|
+
export function finalSalaryHeldOn(b, { section, valued }, on, left) {
|
|
201
|
+
const asAt = left === null ? on : earliest(left, on);
|
|
202
|
+
const { pension, automaticLumpSum } = unreducedPension(RULES[section], membershipOf(valued, asAt), b.payPath, asAt);
|
|
203
|
+
return { pension, automaticLumpSum };
|
|
204
|
+
}
|
|
205
|
+
/** The dates a walk that never draws runs to: leaving, and a drawing at
|
|
206
|
+
* the pension age or at leaving where that is later. It reads no factor,
|
|
207
|
+
* so the drawing decides only which years after leaving are deferred. */
|
|
208
|
+
export function walkDates(b, leaving) {
|
|
209
|
+
return { leaving, drawing: leaving < b.npaOn ? b.npaOn : leaving };
|
|
210
|
+
}
|
|
211
|
+
/** The member's last day of service, as they declared it; null while they
|
|
212
|
+
* serve. The 2015 Section is the one every member serves in last. */
|
|
213
|
+
function declaredLeaving(b) {
|
|
214
|
+
return b.ordinary2015.to === null ? null : isoToDate(b.ordinary2015.to);
|
|
215
|
+
}
|
|
140
216
|
/** A career average walk over `window`, accruing only inside it. */
|
|
141
217
|
function walk(b, { window, seed, prices }, { leaving, drawing }) {
|
|
142
|
-
const first = schemeYearEndFor(isoToDate(window.from));
|
|
143
|
-
const last = schemeYearEndFor(until(window, leaving));
|
|
144
218
|
return careerAverage({
|
|
145
219
|
seed,
|
|
146
|
-
payIn: (
|
|
147
|
-
? b.payPath.payFor(year)
|
|
148
|
-
: null),
|
|
220
|
+
payIn: payInside(b, window, leaving),
|
|
149
221
|
dateOfBirth: b.born,
|
|
150
222
|
leaving,
|
|
151
223
|
drawing,
|
|
@@ -153,6 +225,15 @@ function walk(b, { window, seed, prices }, { leaving, drawing }) {
|
|
|
153
225
|
through: walkThrough(drawing, b.npaOn),
|
|
154
226
|
});
|
|
155
227
|
}
|
|
228
|
+
/** Pay for the scheme years `window` accrues in, to `leaving`; none
|
|
229
|
+
* outside it. */
|
|
230
|
+
function payInside(b, window, leaving) {
|
|
231
|
+
const first = schemeYearEndFor(isoToDate(window.from));
|
|
232
|
+
const last = schemeYearEndFor(until(window, leaving));
|
|
233
|
+
return (year) => (year >= first && year <= last
|
|
234
|
+
? b.payPath.payFor(year)
|
|
235
|
+
: null);
|
|
236
|
+
}
|
|
156
237
|
/** The legacy windows as final-salary membership, to `leaving`. */
|
|
157
238
|
function membershipOf(valued, leaving) {
|
|
158
239
|
return valued
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valuation.js","sourceRoot":"","sources":["../../src/member/valuation.ts"],"names":[],"mappings":"
|
|
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,CAAC;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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;
|