@casomoltd/nhs-pay 0.28.0 → 0.30.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 +14 -3
- package/dist/dates.d.ts +3 -0
- package/dist/dates.js +7 -2
- package/dist/dates.js.map +1 -1
- package/dist/member/benefits.js +27 -32
- package/dist/member/benefits.js.map +1 -1
- package/dist/member/input-period.d.ts +41 -0
- package/dist/member/input-period.js +166 -0
- package/dist/member/input-period.js.map +1 -0
- package/dist/member/service.d.ts +4 -1
- package/dist/member/service.js +12 -1
- package/dist/member/service.js.map +1 -1
- package/dist/member/types.d.ts +37 -4
- package/dist/member/types.js.map +1 -1
- package/dist/member/valuation.d.ts +64 -8
- package/dist/member/valuation.js +110 -20
- package/dist/member/valuation.js.map +1 -1
- package/dist/post.d.ts +22 -29
- package/dist/post.js +14 -17
- package/dist/post.js.map +1 -1
- package/dist/sections/final-salary.d.ts +65 -47
- package/dist/sections/final-salary.js +127 -68
- package/dist/sections/final-salary.js.map +1 -1
- package/dist/take-home.d.ts +12 -6
- package/dist/take-home.js +12 -6
- package/dist/take-home.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,18 +1,22 @@
|
|
|
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, Position, ServicePeriod } from './types.js';
|
|
9
|
-
import type { LegacySectionId, SectionId } from './types.js';
|
|
11
|
+
import type { Award, Holdings, Member, MemberBenefits, Position, 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';
|
|
14
18
|
import type { LedgerSeed } from '../pension/seed.js';
|
|
15
|
-
import type { FinalSalaryRules } from '../sections/final-salary.js';
|
|
19
|
+
import type { FinalSalaryRules, UnreducedPension } from '../sections/final-salary.js';
|
|
16
20
|
import { careerAverage } from '../sections/section-2015.js';
|
|
17
21
|
/** Everything about the member, derived once, that every question
|
|
18
22
|
* asked of them reads. */
|
|
@@ -25,6 +29,9 @@ export interface Built {
|
|
|
25
29
|
readonly npaOn: Date;
|
|
26
30
|
readonly payPath: PayPath;
|
|
27
31
|
readonly legacy: LegacyHolding | null;
|
|
32
|
+
/** Whether the member has a remedy window, and so must elect a basis
|
|
33
|
+
* for it, as every refusal of an election reads it. */
|
|
34
|
+
readonly remedy: boolean;
|
|
28
35
|
readonly ordinary2015: ServicePeriod;
|
|
29
36
|
readonly cashPrices: Prices;
|
|
30
37
|
readonly todaysPrices: Prices;
|
|
@@ -49,19 +56,68 @@ interface CareerWindow {
|
|
|
49
56
|
readonly window: ServicePeriod;
|
|
50
57
|
readonly seedFor: (prices: Prices) => LedgerSeed;
|
|
51
58
|
}
|
|
59
|
+
/** One walk: a window, its seed, and the price series it walks in. */
|
|
60
|
+
interface Walk {
|
|
61
|
+
readonly window: ServicePeriod;
|
|
62
|
+
readonly seed: LedgerSeed;
|
|
63
|
+
readonly prices: Prices;
|
|
64
|
+
}
|
|
65
|
+
/** The legacy periods valued on final salary, which the election decides,
|
|
66
|
+
* and the section whose rules value them. */
|
|
67
|
+
interface FinalSalaryValued {
|
|
68
|
+
readonly section: LegacySectionId;
|
|
69
|
+
readonly valued: readonly ServicePeriod[];
|
|
70
|
+
}
|
|
71
|
+
/** A final-salary pension and automatic lump sum, unreduced, in today's
|
|
72
|
+
* money. */
|
|
73
|
+
type FinalSalaryHeld = Pick<UnreducedPension, 'pension' | 'automaticLumpSum'>;
|
|
52
74
|
/** Each legacy section's statute. */
|
|
53
75
|
export declare const RULES: Record<LegacySectionId, FinalSalaryRules>;
|
|
76
|
+
/** Whether an election walks the remedy window as career average. */
|
|
77
|
+
export declare function walksWindow(basis: RemedyBasis): boolean;
|
|
78
|
+
/** The legacy periods final salary values under an election: every one on
|
|
79
|
+
* the legacy basis; on the 2015 basis the section's own service alone,
|
|
80
|
+
* the remedy window leaving it for a career average walk. */
|
|
81
|
+
export declare function finalSalaryValued(legacy: LegacyHolding, basis: RemedyBasis): FinalSalaryValued;
|
|
82
|
+
/** A remedy window's seed on the 2015 basis: it walks from its first day,
|
|
83
|
+
* since no statement counts the remedy years in the 2015 Section. */
|
|
84
|
+
export declare function windowSeed(window: ServicePeriod): LedgerSeed;
|
|
54
85
|
/** The 2015 Section's own seed: its statement, or its first day. */
|
|
55
86
|
export declare function seed2015(b: Built, { leaving, drawing }: Drawing, prices: Prices): LedgerSeed;
|
|
56
87
|
/** What the member holds today, with the remedy window on the legacy
|
|
57
|
-
* basis: unreduced, since nothing is drawn.
|
|
88
|
+
* basis: unreduced, since nothing is drawn. A member who has left holds
|
|
89
|
+
* their deferred benefits, final pay measured at leaving. */
|
|
58
90
|
export declare function holdings(b: Built): Holdings;
|
|
59
91
|
/** The legacy section's final-salary award over the periods valued on
|
|
60
92
|
* final salary, which the election decides. */
|
|
61
|
-
export declare function legacyAward(b: Built,
|
|
93
|
+
export declare function legacyAward(b: Built, { section, valued }: FinalSalaryValued, dates: Drawing): Award;
|
|
62
94
|
/** A career average award over one window, walked in both rulers. */
|
|
63
95
|
export declare function careerAward(b: Built, { section, window, seedFor }: CareerWindow, dates: Drawing): CareerAward;
|
|
64
96
|
/** The 2015 Section's balance, with its estimated run-up before a
|
|
65
97
|
* statement, as the ledgers, history and curve a `Position` carries. */
|
|
66
98
|
export declare function section2015(b: Built, own: CareerAward, { leaving, drawing }: Drawing): Pick<Position, 'ledger' | 'todaysMoneyLedger' | 'estimatedHistory' | 'curve'>;
|
|
99
|
+
/**
|
|
100
|
+
* The same walk as the ledger alone, with no drawing on it, through the
|
|
101
|
+
* scheme year ending in `through`: what the window holds on any date to
|
|
102
|
+
* then, before any early or late factor. A valuation that never draws has
|
|
103
|
+
* no factor to read, and a factor read for a drawing far past the pension
|
|
104
|
+
* age is one GAD's tables may not price.
|
|
105
|
+
*/
|
|
106
|
+
export declare function accruedLedger(b: Built, { window, seed, prices }: Walk, { leaving, drawing }: Drawing, through: number): MemberLedger;
|
|
107
|
+
/** Refuse a leaving after the one the member declared, naming `asked`,
|
|
108
|
+
* the call a caller was answering: service that has ended cannot run on. */
|
|
109
|
+
export declare function refuseLeavingAfterDeclared(asked: keyof MemberBenefits, b: Built, leaving: Date): void;
|
|
110
|
+
/**
|
|
111
|
+
* The legacy section's final-salary pension and automatic lump sum held on
|
|
112
|
+
* `on`, unreduced, in today's money: membership to that day, on final pay
|
|
113
|
+
* measured back from it, as a leaving on it is measured. Where the member
|
|
114
|
+
* `left` before `on`, both are measured at leaving. `left` is the caller's:
|
|
115
|
+
* today's holdings read the declared leaving, and a tax year's input the
|
|
116
|
+
* leaving it was asked about.
|
|
117
|
+
*/
|
|
118
|
+
export declare function finalSalaryHeldOn(b: Built, { section, valued }: FinalSalaryValued, on: Date, left: Date | null): FinalSalaryHeld;
|
|
119
|
+
/** The dates a walk that never draws runs to: leaving, and a drawing at
|
|
120
|
+
* the pension age or at leaving where that is later. It reads no factor,
|
|
121
|
+
* so the drawing decides only which years after leaving are deferred. */
|
|
122
|
+
export declare function walkDates(b: Built, leaving: Date): Drawing;
|
|
67
123
|
export {};
|
package/dist/member/valuation.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
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 { buildLedger } from '../pension/ledger.js';
|
|
7
8
|
import { seedFromBalanceAt } from '../pension/uplift.js';
|
|
8
9
|
import { estimateHistory } from '../pension/history.js';
|
|
9
10
|
import { moneyAt, sumMoney } from '../pension/money.js';
|
|
@@ -17,6 +18,33 @@ export const RULES = {
|
|
|
17
18
|
[SECTIONS.s1995]: RULES_1995,
|
|
18
19
|
[SECTIONS.s2008]: RULES_2008,
|
|
19
20
|
};
|
|
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
|
+
}
|
|
20
48
|
/** The 2015 Section's own seed: its statement, or its first day. */
|
|
21
49
|
export function seed2015(b, { leaving, drawing }, prices) {
|
|
22
50
|
const { statement } = b.member;
|
|
@@ -25,13 +53,15 @@ export function seed2015(b, { leaving, drawing }, prices) {
|
|
|
25
53
|
: seedFromBalanceAt(statement.accruedPension, isoToDate(statement.asAt), leaving, drawing, prices);
|
|
26
54
|
}
|
|
27
55
|
/** What the member holds today, with the remedy window on the legacy
|
|
28
|
-
* basis: unreduced, since nothing is drawn.
|
|
56
|
+
* basis: unreduced, since nothing is drawn. A member who has left holds
|
|
57
|
+
* their deferred benefits, final pay measured at leaving. */
|
|
29
58
|
export function holdings(b) {
|
|
30
59
|
const { today } = b;
|
|
60
|
+
const left = declaredLeaving(b);
|
|
31
61
|
const bySection = [];
|
|
32
62
|
const flat = (x) => moneyAt({ nominal: x, real: x }, today);
|
|
33
63
|
if (b.legacy !== null) {
|
|
34
|
-
const { pension, automaticLumpSum } =
|
|
64
|
+
const { pension, automaticLumpSum } = finalSalaryHeldOn(b, finalSalaryValued(b.legacy, REMEDY_BASES.legacy), today, left);
|
|
35
65
|
bySection.push({
|
|
36
66
|
section: b.legacy.section,
|
|
37
67
|
pension: flat(pension),
|
|
@@ -40,10 +70,7 @@ export function holdings(b) {
|
|
|
40
70
|
}
|
|
41
71
|
// Any leaving and drawing after today give the same balance today;
|
|
42
72
|
// 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 };
|
|
73
|
+
const dates = walkDates(b, left ?? b.npaOn);
|
|
47
74
|
const accrued = walk(b, {
|
|
48
75
|
window: b.ordinary2015,
|
|
49
76
|
seed: seed2015(b, dates, b.todaysPrices),
|
|
@@ -60,20 +87,22 @@ export function holdings(b) {
|
|
|
60
87
|
}
|
|
61
88
|
/** The legacy section's final-salary award over the periods valued on
|
|
62
89
|
* final salary, which the election decides. */
|
|
63
|
-
export function legacyAward(b,
|
|
64
|
-
const rules = RULES[
|
|
90
|
+
export function legacyAward(b, { section, valued }, dates) {
|
|
91
|
+
const rules = RULES[section];
|
|
65
92
|
const benefit = finalSalaryBenefit(rules, {
|
|
66
93
|
windows: membershipOf(valued, dates.leaving),
|
|
67
94
|
payPath: b.payPath, dateOfBirth: b.born, ...dates,
|
|
68
95
|
prices: b.cashPrices,
|
|
69
96
|
});
|
|
70
97
|
return {
|
|
71
|
-
section
|
|
98
|
+
section,
|
|
72
99
|
periods: valued,
|
|
73
|
-
|
|
100
|
+
pensionBeforeFactor: benefit.pensionBeforeFactor,
|
|
74
101
|
pension: benefit.pension,
|
|
75
102
|
automaticLumpSum: benefit.automaticLumpSum,
|
|
76
|
-
|
|
103
|
+
automaticLumpSumBeforeFactor: benefit.automaticLumpSumBeforeFactor,
|
|
104
|
+
pensionFactor: benefit.pensionFactor,
|
|
105
|
+
automaticLumpSumFactor: benefit.automaticLumpSumFactor,
|
|
77
106
|
ledgers: null,
|
|
78
107
|
provenance: {
|
|
79
108
|
accrual: ACCRUALS.finalSalary,
|
|
@@ -89,14 +118,19 @@ export function careerAward(b, { section, window, seedFor }, dates) {
|
|
|
89
118
|
const walkIn = (prices) => walk(b, { window, seed: seedFor(prices), prices }, dates);
|
|
90
119
|
const cash = walkIn(b.cashPrices);
|
|
91
120
|
const todays = walkIn(b.todaysPrices);
|
|
121
|
+
// A career average award pays no automatic lump sum, before or after a
|
|
122
|
+
// factor.
|
|
123
|
+
const noLumpSum = moneyAt({ nominal: 0, real: 0 }, dates.drawing);
|
|
92
124
|
return {
|
|
93
125
|
award: {
|
|
94
126
|
section,
|
|
95
127
|
periods: [window],
|
|
96
|
-
|
|
128
|
+
pensionBeforeFactor: moneyAt({ nominal: cash.revalued, real: todays.revalued }, dates.drawing),
|
|
97
129
|
pension: moneyAt({ nominal: cash.drawn, real: todays.drawn }, dates.drawing),
|
|
98
|
-
automaticLumpSum:
|
|
99
|
-
|
|
130
|
+
automaticLumpSum: noLumpSum,
|
|
131
|
+
automaticLumpSumBeforeFactor: noLumpSum,
|
|
132
|
+
pensionFactor: cash.factor,
|
|
133
|
+
automaticLumpSumFactor: null,
|
|
100
134
|
ledgers: { cash: cash.ledger, todaysMoney: todays.ledger },
|
|
101
135
|
provenance: { accrual: ACCRUALS.careerAverage },
|
|
102
136
|
},
|
|
@@ -132,15 +166,62 @@ export function section2015(b, own, { leaving, drawing }) {
|
|
|
132
166
|
curve: buildCurve(run(own.cash, cashHistory), run(own.todays, todaysHistory)),
|
|
133
167
|
};
|
|
134
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* The same walk as the ledger alone, with no drawing on it, through the
|
|
171
|
+
* scheme year ending in `through`: what the window holds on any date to
|
|
172
|
+
* then, before any early or late factor. A valuation that never draws has
|
|
173
|
+
* no factor to read, and a factor read for a drawing far past the pension
|
|
174
|
+
* age is one GAD's tables may not price.
|
|
175
|
+
*/
|
|
176
|
+
export function accruedLedger(b, { window, seed, prices }, { leaving, drawing }, through) {
|
|
177
|
+
return buildLedger({
|
|
178
|
+
seed,
|
|
179
|
+
payIn: payInside(b, window, leaving),
|
|
180
|
+
exitDate: leaving,
|
|
181
|
+
retirementDate: drawing,
|
|
182
|
+
prices,
|
|
183
|
+
through,
|
|
184
|
+
drawingFor: () => null,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/** Refuse a leaving after the one the member declared, naming `asked`,
|
|
188
|
+
* the call a caller was answering: service that has ended cannot run on. */
|
|
189
|
+
export function refuseLeavingAfterDeclared(asked, b, leaving) {
|
|
190
|
+
const left = declaredLeaving(b);
|
|
191
|
+
if (left !== null && left < leaving) {
|
|
192
|
+
throw new RangeError(`${asked}: leaving after the member already left, on `
|
|
193
|
+
+ `${b.ordinary2015.to}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The legacy section's final-salary pension and automatic lump sum held on
|
|
198
|
+
* `on`, unreduced, in today's money: membership to that day, on final pay
|
|
199
|
+
* measured back from it, as a leaving on it is measured. Where the member
|
|
200
|
+
* `left` before `on`, both are measured at leaving. `left` is the caller's:
|
|
201
|
+
* today's holdings read the declared leaving, and a tax year's input the
|
|
202
|
+
* leaving it was asked about.
|
|
203
|
+
*/
|
|
204
|
+
export function finalSalaryHeldOn(b, { section, valued }, on, left) {
|
|
205
|
+
const asAt = left === null ? on : earliest(left, on);
|
|
206
|
+
const { pension, automaticLumpSum } = unreducedPension(RULES[section], membershipOf(valued, asAt), b.payPath, asAt);
|
|
207
|
+
return { pension, automaticLumpSum };
|
|
208
|
+
}
|
|
209
|
+
/** The dates a walk that never draws runs to: leaving, and a drawing at
|
|
210
|
+
* the pension age or at leaving where that is later. It reads no factor,
|
|
211
|
+
* so the drawing decides only which years after leaving are deferred. */
|
|
212
|
+
export function walkDates(b, leaving) {
|
|
213
|
+
return { leaving, drawing: leaving < b.npaOn ? b.npaOn : leaving };
|
|
214
|
+
}
|
|
215
|
+
/** The member's last day of service, as they declared it; null while they
|
|
216
|
+
* serve. The 2015 Section is the one every member serves in last. */
|
|
217
|
+
function declaredLeaving(b) {
|
|
218
|
+
return b.ordinary2015.to === null ? null : isoToDate(b.ordinary2015.to);
|
|
219
|
+
}
|
|
135
220
|
/** A career average walk over `window`, accruing only inside it. */
|
|
136
221
|
function walk(b, { window, seed, prices }, { leaving, drawing }) {
|
|
137
|
-
const first = schemeYearEndFor(isoToDate(window.from));
|
|
138
|
-
const last = schemeYearEndFor(until(window, leaving));
|
|
139
222
|
return careerAverage({
|
|
140
223
|
seed,
|
|
141
|
-
payIn: (
|
|
142
|
-
? b.payPath.payFor(year)
|
|
143
|
-
: null),
|
|
224
|
+
payIn: payInside(b, window, leaving),
|
|
144
225
|
dateOfBirth: b.born,
|
|
145
226
|
leaving,
|
|
146
227
|
drawing,
|
|
@@ -148,6 +229,15 @@ function walk(b, { window, seed, prices }, { leaving, drawing }) {
|
|
|
148
229
|
through: walkThrough(drawing, b.npaOn),
|
|
149
230
|
});
|
|
150
231
|
}
|
|
232
|
+
/** Pay for the scheme years `window` accrues in, to `leaving`; none
|
|
233
|
+
* outside it. */
|
|
234
|
+
function payInside(b, window, leaving) {
|
|
235
|
+
const first = schemeYearEndFor(isoToDate(window.from));
|
|
236
|
+
const last = schemeYearEndFor(until(window, leaving));
|
|
237
|
+
return (year) => (year >= first && year <= last
|
|
238
|
+
? b.payPath.payFor(year)
|
|
239
|
+
: null);
|
|
240
|
+
}
|
|
151
241
|
/** The legacy windows as final-salary membership, to `leaving`. */
|
|
152
242
|
function membershipOf(valued, leaving) {
|
|
153
243
|
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;AAE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CAAC,EAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/post.d.ts
CHANGED
|
@@ -26,23 +26,19 @@ export interface PostIdentity {
|
|
|
26
26
|
readonly taxYear: TaxYear;
|
|
27
27
|
/**
|
|
28
28
|
* The year the SALARY was published in, where that differs from
|
|
29
|
-
* {@link PostIdentity.taxYear}.
|
|
29
|
+
* {@link PostIdentity.taxYear}.
|
|
30
30
|
*
|
|
31
31
|
* The two are the same whenever a nation's pay round lands inside
|
|
32
|
-
* its own year
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* Northern Ireland's pay points, the largest by 1.8 points of
|
|
39
|
-
* salary.
|
|
32
|
+
* its own year. They separate the moment a round runs late: Northern
|
|
33
|
+
* Ireland's staff are paid 2025-26 salaries during the 2026-27 tax
|
|
34
|
+
* year, and they contribute at the 2026-27 tier because contribution
|
|
35
|
+
* tiers are set by the SCHEME year, not by which round their salary
|
|
36
|
+
* came from. Read as one, the deduction would be overstated on four of
|
|
37
|
+
* Northern Ireland's pay points, the largest by 1.8 points of salary.
|
|
40
38
|
*
|
|
41
|
-
* REQUIRED
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* them apart. Every construction path already knows both, so the
|
|
45
|
-
* option bought nothing but a place for them to recombine.
|
|
39
|
+
* REQUIRED: a fallback to `taxYear` would let `post.payYear` quietly
|
|
40
|
+
* answer with the tax year, joining the two bases inside the accessor
|
|
41
|
+
* that exists to keep them apart. Every construction path knows both.
|
|
46
42
|
*/
|
|
47
43
|
readonly payYear: PayYear;
|
|
48
44
|
}
|
|
@@ -123,13 +119,12 @@ export declare class Post {
|
|
|
123
119
|
/**
|
|
124
120
|
* The year whose tax, NI and pension tiers apply.
|
|
125
121
|
*
|
|
126
|
-
* REQUIRED, and ahead of `role` for that reason
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
* times it is wrong are exactly the times nobody is looking.
|
|
122
|
+
* REQUIRED, and ahead of `role` for that reason: a default to the
|
|
123
|
+
* pay year would give a caller who did not think about it the
|
|
124
|
+
* salary's own year, pricing a Northern Irish reader's 2025-26 pay
|
|
125
|
+
* at 2025-26 deductions in the 2026-27 tax year. A default that is
|
|
126
|
+
* right most of the time is worse than none, because the times it
|
|
127
|
+
* is wrong are exactly the times nobody is looking.
|
|
133
128
|
*/
|
|
134
129
|
taxYear: TaxYear, role?: Role): Post;
|
|
135
130
|
/**
|
|
@@ -182,18 +177,13 @@ export declare class Post {
|
|
|
182
177
|
* transcribed it".
|
|
183
178
|
*/
|
|
184
179
|
get scaleSource(): DocumentSource | undefined;
|
|
180
|
+
/** The year this post's SALARY was published in. */
|
|
181
|
+
get payYear(): PayYear;
|
|
185
182
|
/**
|
|
186
183
|
* Member contribution rate (%). The tier's single rate applies to
|
|
187
184
|
* the WHOLE of {@link Post.pensionablePay} (a slab/cliff-edge rate,
|
|
188
185
|
* not a marginal band); 0 when opted out.
|
|
189
186
|
*/
|
|
190
|
-
/**
|
|
191
|
-
* The year this post's SALARY was published in.
|
|
192
|
-
*
|
|
193
|
-
* Falls back to the tax year, which is right for every post whose
|
|
194
|
-
* pay round landed inside its own year.
|
|
195
|
-
*/
|
|
196
|
-
get payYear(): PayYear;
|
|
197
187
|
get pensionRate(): number;
|
|
198
188
|
/**
|
|
199
189
|
* Annual member pension contribution (£) — read from the
|
|
@@ -209,7 +199,10 @@ export declare class Post {
|
|
|
209
199
|
/**
|
|
210
200
|
* The pension annual allowance this post's year meets, with the
|
|
211
201
|
* scheme's defined-benefit pension input: read it here, not off
|
|
212
|
-
* `takeHome`, whose own allowance has no scheme input.
|
|
202
|
+
* `takeHome`, whose own allowance has no scheme input. The input is
|
|
203
|
+
* this year's accrual alone (`nhsAnnualAllowance`): a post knows no
|
|
204
|
+
* member history, so revaluation of pension already built up is not
|
|
205
|
+
* counted.
|
|
213
206
|
*/
|
|
214
207
|
get annualAllowance(): AnnualAllowance;
|
|
215
208
|
/** Annual income tax (£). */
|
package/dist/post.js
CHANGED
|
@@ -78,13 +78,12 @@ export class Post {
|
|
|
78
78
|
/**
|
|
79
79
|
* The year whose tax, NI and pension tiers apply.
|
|
80
80
|
*
|
|
81
|
-
* REQUIRED, and ahead of `role` for that reason
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* times it is wrong are exactly the times nobody is looking.
|
|
81
|
+
* REQUIRED, and ahead of `role` for that reason: a default to the
|
|
82
|
+
* pay year would give a caller who did not think about it the
|
|
83
|
+
* salary's own year, pricing a Northern Irish reader's 2025-26 pay
|
|
84
|
+
* at 2025-26 deductions in the 2026-27 tax year. A default that is
|
|
85
|
+
* right most of the time is worse than none, because the times it
|
|
86
|
+
* is wrong are exactly the times nobody is looking.
|
|
88
87
|
*/
|
|
89
88
|
taxYear, role = { kind: 'vsm' }) {
|
|
90
89
|
return new Post({ nation, taxYear, payYear: year }, salary, role);
|
|
@@ -167,20 +166,15 @@ export class Post {
|
|
|
167
166
|
return undefined;
|
|
168
167
|
}
|
|
169
168
|
}
|
|
169
|
+
/** The year this post's SALARY was published in. */
|
|
170
|
+
get payYear() {
|
|
171
|
+
return this.identity.payYear;
|
|
172
|
+
}
|
|
170
173
|
/**
|
|
171
174
|
* Member contribution rate (%). The tier's single rate applies to
|
|
172
175
|
* the WHOLE of {@link Post.pensionablePay} (a slab/cliff-edge rate,
|
|
173
176
|
* not a marginal band); 0 when opted out.
|
|
174
177
|
*/
|
|
175
|
-
/**
|
|
176
|
-
* The year this post's SALARY was published in.
|
|
177
|
-
*
|
|
178
|
-
* Falls back to the tax year, which is right for every post whose
|
|
179
|
-
* pay round landed inside its own year.
|
|
180
|
-
*/
|
|
181
|
-
get payYear() {
|
|
182
|
-
return this.identity.payYear;
|
|
183
|
-
}
|
|
184
178
|
get pensionRate() {
|
|
185
179
|
if (this.adjustments.pensionOptedOut) {
|
|
186
180
|
return 0;
|
|
@@ -210,7 +204,10 @@ export class Post {
|
|
|
210
204
|
/**
|
|
211
205
|
* The pension annual allowance this post's year meets, with the
|
|
212
206
|
* scheme's defined-benefit pension input: read it here, not off
|
|
213
|
-
* `takeHome`, whose own allowance has no scheme input.
|
|
207
|
+
* `takeHome`, whose own allowance has no scheme input. The input is
|
|
208
|
+
* this year's accrual alone (`nhsAnnualAllowance`): a post knows no
|
|
209
|
+
* member history, so revaluation of pension already built up is not
|
|
210
|
+
* counted.
|
|
214
211
|
*/
|
|
215
212
|
get annualAllowance() {
|
|
216
213
|
return nhsAnnualAllowance(this.pensionablePay, this._pensionFraction, this.identity.taxYear, nationToTaxRegion(this.identity.nation));
|
package/dist/post.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.js","sourceRoot":"","sources":["../src/post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAUvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,kBAAkB,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAErC,OAAO,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAGnD;;6CAE6C;AAC7C,SAAS,WAAW,CAClB,KAAoD,EACpD,KAAQ,EACR,QAA4C;IAE5C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IAClD,IAAI,C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