@casomoltd/nhs-pay 0.30.0 → 0.32.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 +71 -252
- 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 +32 -7
- package/dist/document-source.js +32 -8
- package/dist/document-source.js.map +1 -1
- package/dist/errors.d.ts +57 -11
- package/dist/errors.js +85 -28
- package/dist/errors.js.map +1 -1
- package/dist/factor-basis.d.ts +23 -3
- package/dist/factor-basis.js +40 -28
- package/dist/factor-basis.js.map +1 -1
- package/dist/index.d.ts +16 -14
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/member/benefits.js +25 -13
- 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 +14 -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 +95 -59
- package/dist/pension/ledger.js.map +1 -1
- package/dist/pension/money.d.ts +2 -0
- package/dist/pension/money.js +4 -0
- package/dist/pension/money.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 +38 -54
- package/dist/pension/uplift.js +38 -68
- 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 +56 -41
- package/dist/revaluation.js +76 -62
- 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 +6 -10
- package/dist/sections/final-salary.js.map +1 -1
- package/dist/sections/section-2015.d.ts +3 -4
- package/dist/sections/section-2015.js +1 -1
- package/dist/sections/section-2015.js.map +1 -1
- package/dist/sources.d.ts +14 -0
- package/dist/sources.js +24 -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
package/dist/document-source.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The published document a figure in this library was read from.
|
|
3
3
|
*
|
|
4
|
-
* One record type for any cited document
|
|
5
|
-
*
|
|
4
|
+
* One record type for any dated cited document. The library cites five
|
|
5
|
+
* KINDS (listed in `sources.ts`), three of which are easily confused: the
|
|
6
6
|
* instrument that ENACTED an award, the circular that PUBLISHES a pay
|
|
7
7
|
* scale, and the letter that sets an allowance. They are different
|
|
8
8
|
* documents in every nation — England's 2026-27 medical award was
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* scale carries one too, and `award.ts` imports every scale module —
|
|
19
19
|
* so defining it there would make a scale citing its source a cycle.
|
|
20
20
|
*/
|
|
21
|
+
import { isoDateOf } from './iso-date.js';
|
|
21
22
|
/**
|
|
22
23
|
* A document this library cites — not commentary about it. Held on the
|
|
23
24
|
* record so a consumer cites the document rather than keeping its own
|
|
@@ -64,17 +65,40 @@ export class DocumentSource {
|
|
|
64
65
|
* Takes `now` rather than reading the clock, and is a method rather
|
|
65
66
|
* than a stored flag, because currency is a question about a moment
|
|
66
67
|
* and not a property of the record. A boolean computed at module
|
|
67
|
-
* load would freeze the answer for the life of the process
|
|
68
|
-
* same shape as the year defect this round exists to fix — and a
|
|
68
|
+
* load would freeze the answer for the life of the process, and a
|
|
69
69
|
* caller could not ask "was this current when the page was built?".
|
|
70
|
+
*
|
|
71
|
+
* `now` is compared as the calendar day it falls on in the reader's
|
|
72
|
+
* own frame, never its UTC day, which is the day before for a local
|
|
73
|
+
* midnight in summer time.
|
|
70
74
|
*/
|
|
71
75
|
currencyAt(now) {
|
|
72
76
|
if (!this.nextExpected) {
|
|
73
|
-
return
|
|
77
|
+
return SOURCE_CURRENCIES.unknown;
|
|
74
78
|
}
|
|
75
|
-
return this.nextExpected >= now
|
|
76
|
-
?
|
|
77
|
-
:
|
|
79
|
+
return this.nextExpected >= isoDateOf(now)
|
|
80
|
+
? SOURCE_CURRENCIES.current
|
|
81
|
+
: SOURCE_CURRENCIES.lapsed;
|
|
78
82
|
}
|
|
79
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Whether a source is still within the window in which it is the
|
|
86
|
+
* newest document expected to exist.
|
|
87
|
+
*
|
|
88
|
+
* `lapsed` means the date we expected a successor by has passed and
|
|
89
|
+
* we hold no successor — so either the publisher is late, or one
|
|
90
|
+
* exists and we have not transcribed it. Both are worth surfacing;
|
|
91
|
+
* the caller decides which it is.
|
|
92
|
+
*
|
|
93
|
+
* `unknown` where no `nextExpected` is recorded. Absence of a date is
|
|
94
|
+
* not evidence of currency, and a consumer must never render it as
|
|
95
|
+
* "current" — nor render nothing, which reads the same way. House
|
|
96
|
+
* position is to state the gap: an unchecked citation should not look
|
|
97
|
+
* identical to a fresh one.
|
|
98
|
+
*/
|
|
99
|
+
export const SOURCE_CURRENCIES = {
|
|
100
|
+
current: 'current',
|
|
101
|
+
lapsed: 'lapsed',
|
|
102
|
+
unknown: 'unknown',
|
|
103
|
+
};
|
|
80
104
|
//# sourceMappingURL=document-source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-source.js","sourceRoot":"","sources":["../src/document-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"document-source.js","sourceRoot":"","sources":["../src/document-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAgFxC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,cAAc;IACzB,8DAA8D;IACrD,MAAM,CAAS;IACxB,mEAAmE;IAC1D,SAAS,CAAS;IAC3B,+CAA+C;IACtC,GAAG,CAAS;IACrB,wCAAwC;IAC/B,MAAM,CAAU;IACzB,sDAAsD;IAC7C,YAAY,CAAW;IAChC;iCAC6B;IACpB,kBAAkB,CAAU;IAErC,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IACtD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,GAAS;QAClB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,OAAO,iBAAiB,CAAC,OAAO,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC,YAAY,IAAI,SAAS,CAAC,GAAG,CAAC;YACxC,CAAC,CAAC,iBAAiB,CAAC,OAAO;YAC3B,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC;IAC/B,CAAC;CACF;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACV,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* the library does not publish ({@link ScaleUnavailable} and
|
|
5
5
|
* siblings — never silently substitute another year's or nation's
|
|
6
6
|
* figures), a member it cannot build pay for
|
|
7
|
-
* ({@link PayPathUnavailable}),
|
|
7
|
+
* ({@link PayPathUnavailable}), service it does not model
|
|
8
8
|
* ({@link BenefitNotModelled}, keyed by a {@link NOT_MODELLED}
|
|
9
|
-
* code)
|
|
9
|
+
* code), and a read before a member's statement, where no balance
|
|
10
|
+
* exists ({@link BeforeStatement}, its boundary
|
|
11
|
+
* {@link isBeforeStatement}, which a caller can check first).
|
|
10
12
|
* - RangeError, thrown where a caller's input cannot be true.
|
|
11
13
|
* - {@link invariant} — an internal consistency guard. Its failure
|
|
12
14
|
* is a library bug, not an input problem, so no caller catches it;
|
|
@@ -19,15 +21,6 @@ interface YearsMonths {
|
|
|
19
21
|
readonly years: number;
|
|
20
22
|
readonly months: number;
|
|
21
23
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Assert a domain invariant that must ALWAYS hold. Throws a bare
|
|
24
|
-
* Error when `condition` is false. Unlike the absent-data errors
|
|
25
|
-
* below — which callers catch by type — an invariant failure signals
|
|
26
|
-
* an internal inconsistency (a regression), so it is deliberately a
|
|
27
|
-
* plain, uncatchable-by-type throw: better a loud stop in a test or
|
|
28
|
-
* page than a silently wrong figure.
|
|
29
|
-
*/
|
|
30
|
-
export declare function invariant(condition: unknown, message: string): asserts condition;
|
|
31
24
|
/**
|
|
32
25
|
* Thrown when no pay scale is published for a
|
|
33
26
|
* (nation, year), optionally narrowed to a grade and a
|
|
@@ -158,6 +151,40 @@ export declare class BenefitNotModelled extends Error {
|
|
|
158
151
|
readonly code: NotModelled;
|
|
159
152
|
constructor(code: NotModelled, detail: string);
|
|
160
153
|
}
|
|
154
|
+
/** What a {@link BeforeStatement} refused, as a closed set a consumer can
|
|
155
|
+
* branch on. */
|
|
156
|
+
export declare const STATEMENT_READS: {
|
|
157
|
+
/** A leaving, which a walk would never reach. */
|
|
158
|
+
readonly leaving: "leaving";
|
|
159
|
+
/** The balance held on a date. */
|
|
160
|
+
readonly balance: "balance";
|
|
161
|
+
/** The close of a scheme year. */
|
|
162
|
+
readonly yearClose: "year-close";
|
|
163
|
+
};
|
|
164
|
+
export type StatementRead = (typeof STATEMENT_READS)[keyof typeof STATEMENT_READS];
|
|
165
|
+
/**
|
|
166
|
+
* A read of a member's 2015 Section balance on a date before their
|
|
167
|
+
* statement's 31 March, or a leaving before it. Not a build to come: a
|
|
168
|
+
* statement gives a balance at its 31 March and nothing of the dates
|
|
169
|
+
* before it, so there is no figure to give, and answering with the
|
|
170
|
+
* statement's own balance would state one nobody holds. Data absence,
|
|
171
|
+
* like {@link ScaleUnavailable}.
|
|
172
|
+
*/
|
|
173
|
+
export declare class BeforeStatement extends Error {
|
|
174
|
+
/** What was refused. */
|
|
175
|
+
readonly read: StatementRead;
|
|
176
|
+
/** The date it was asked on. */
|
|
177
|
+
readonly on: Date;
|
|
178
|
+
/** The statement's 31 March. */
|
|
179
|
+
readonly statementDate: Date;
|
|
180
|
+
constructor(
|
|
181
|
+
/** What was refused. */
|
|
182
|
+
read: StatementRead,
|
|
183
|
+
/** The date it was asked on. */
|
|
184
|
+
on: Date,
|
|
185
|
+
/** The statement's 31 March. */
|
|
186
|
+
statementDate: Date);
|
|
187
|
+
}
|
|
161
188
|
/** Why an additional pension purchase is refused, as a closed set a
|
|
162
189
|
* consumer can branch on. */
|
|
163
190
|
export declare const ADDITIONAL_PENSION_REFUSALS: {
|
|
@@ -184,4 +211,23 @@ export declare class AdditionalPensionUnavailable extends Error {
|
|
|
184
211
|
readonly code: AdditionalPensionRefusal;
|
|
185
212
|
constructor(code: AdditionalPensionRefusal, detail: string);
|
|
186
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Whether a read on `on` falls before the first date a statement answers,
|
|
216
|
+
* and so is one {@link BeforeStatement} refuses. `answersFrom` is that date,
|
|
217
|
+
* the statement's 31 March (`MemberBenefits.statementAnswersFrom`), or null
|
|
218
|
+
* where there is no statement and every date is answered. The one
|
|
219
|
+
* definition of the boundary, so a caller checking its own dates first and
|
|
220
|
+
* the library refusing them cannot disagree on the day itself, which is
|
|
221
|
+
* answered.
|
|
222
|
+
*/
|
|
223
|
+
export declare function isBeforeStatement(on: Date, answersFrom: Date | null): boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Assert a domain invariant that must ALWAYS hold. Throws a bare
|
|
226
|
+
* Error when `condition` is false. Unlike the absent-data errors
|
|
227
|
+
* above — which callers catch by type — an invariant failure signals
|
|
228
|
+
* an internal inconsistency (a regression), so it is deliberately a
|
|
229
|
+
* plain, uncatchable-by-type throw: better a loud stop in a test or
|
|
230
|
+
* page than a silently wrong figure.
|
|
231
|
+
*/
|
|
232
|
+
export declare function invariant(condition: unknown, message: string): asserts condition;
|
|
187
233
|
export {};
|
package/dist/errors.js
CHANGED
|
@@ -4,27 +4,16 @@
|
|
|
4
4
|
* the library does not publish ({@link ScaleUnavailable} and
|
|
5
5
|
* siblings — never silently substitute another year's or nation's
|
|
6
6
|
* figures), a member it cannot build pay for
|
|
7
|
-
* ({@link PayPathUnavailable}),
|
|
7
|
+
* ({@link PayPathUnavailable}), service it does not model
|
|
8
8
|
* ({@link BenefitNotModelled}, keyed by a {@link NOT_MODELLED}
|
|
9
|
-
* code)
|
|
9
|
+
* code), and a read before a member's statement, where no balance
|
|
10
|
+
* exists ({@link BeforeStatement}, its boundary
|
|
11
|
+
* {@link isBeforeStatement}, which a caller can check first).
|
|
10
12
|
* - RangeError, thrown where a caller's input cannot be true.
|
|
11
13
|
* - {@link invariant} — an internal consistency guard. Its failure
|
|
12
14
|
* is a library bug, not an input problem, so no caller catches it;
|
|
13
15
|
* it throws a bare Error to fail loud in tests and pages.
|
|
14
16
|
*/
|
|
15
|
-
/**
|
|
16
|
-
* Assert a domain invariant that must ALWAYS hold. Throws a bare
|
|
17
|
-
* Error when `condition` is false. Unlike the absent-data errors
|
|
18
|
-
* below — which callers catch by type — an invariant failure signals
|
|
19
|
-
* an internal inconsistency (a regression), so it is deliberately a
|
|
20
|
-
* plain, uncatchable-by-type throw: better a loud stop in a test or
|
|
21
|
-
* page than a silently wrong figure.
|
|
22
|
-
*/
|
|
23
|
-
export function invariant(condition, message) {
|
|
24
|
-
if (!condition) {
|
|
25
|
-
throw new Error(message);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
17
|
/**
|
|
29
18
|
* Thrown when no pay scale is published for a
|
|
30
19
|
* (nation, year), optionally narrowed to a grade and a
|
|
@@ -128,17 +117,6 @@ export class AwardUnavailable extends Error {
|
|
|
128
117
|
this.name = 'AwardUnavailable';
|
|
129
118
|
}
|
|
130
119
|
}
|
|
131
|
-
function scaleMessage(nation, year, gradeId, pointLabel) {
|
|
132
|
-
if (pointLabel !== undefined) {
|
|
133
|
-
return `No scale point "${pointLabel}" for `
|
|
134
|
-
+ `${gradeId} in ${nation} ${year}`;
|
|
135
|
-
}
|
|
136
|
-
if (gradeId !== undefined) {
|
|
137
|
-
return `No published scale for ${gradeId} in `
|
|
138
|
-
+ `${nation} ${year}`;
|
|
139
|
-
}
|
|
140
|
-
return `No published pay scale for ${nation} ${year}`;
|
|
141
|
-
}
|
|
142
120
|
/**
|
|
143
121
|
* A pay-point label matched more than one point on a scale.
|
|
144
122
|
*
|
|
@@ -155,8 +133,8 @@ export class AmbiguousScalePoint extends Error {
|
|
|
155
133
|
matches;
|
|
156
134
|
constructor(grade, pointLabel, matches) {
|
|
157
135
|
super(`Pay point "${pointLabel}" matches ${matches} points on `
|
|
158
|
-
+ `${grade} — it does not identify one
|
|
159
|
-
+ '
|
|
136
|
+
+ `${grade} — it does not identify one; pass the point itself `
|
|
137
|
+
+ 'where the caller holds it.');
|
|
160
138
|
this.grade = grade;
|
|
161
139
|
this.pointLabel = pointLabel;
|
|
162
140
|
this.matches = matches;
|
|
@@ -210,6 +188,47 @@ export class BenefitNotModelled extends Error {
|
|
|
210
188
|
this.name = 'BenefitNotModelled';
|
|
211
189
|
}
|
|
212
190
|
}
|
|
191
|
+
/** What a {@link BeforeStatement} refused, as a closed set a consumer can
|
|
192
|
+
* branch on. */
|
|
193
|
+
export const STATEMENT_READS = {
|
|
194
|
+
/** A leaving, which a walk would never reach. */
|
|
195
|
+
leaving: 'leaving',
|
|
196
|
+
/** The balance held on a date. */
|
|
197
|
+
balance: 'balance',
|
|
198
|
+
/** The close of a scheme year. */
|
|
199
|
+
yearClose: 'year-close',
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* A read of a member's 2015 Section balance on a date before their
|
|
203
|
+
* statement's 31 March, or a leaving before it. Not a build to come: a
|
|
204
|
+
* statement gives a balance at its 31 March and nothing of the dates
|
|
205
|
+
* before it, so there is no figure to give, and answering with the
|
|
206
|
+
* statement's own balance would state one nobody holds. Data absence,
|
|
207
|
+
* like {@link ScaleUnavailable}.
|
|
208
|
+
*/
|
|
209
|
+
export class BeforeStatement extends Error {
|
|
210
|
+
read;
|
|
211
|
+
on;
|
|
212
|
+
statementDate;
|
|
213
|
+
constructor(
|
|
214
|
+
/** What was refused. */
|
|
215
|
+
read,
|
|
216
|
+
/** The date it was asked on. */
|
|
217
|
+
on,
|
|
218
|
+
/** The statement's 31 March. */
|
|
219
|
+
statementDate) {
|
|
220
|
+
super(`A ${read} on ${on.toDateString()}, before the statement's `
|
|
221
|
+
+ `balance at ${statementDate.toDateString()}`);
|
|
222
|
+
this.read = read;
|
|
223
|
+
this.on = on;
|
|
224
|
+
this.statementDate = statementDate;
|
|
225
|
+
// A read on or after the statement has a balance to answer with, so
|
|
226
|
+
// refusing one would be the library's own bug, not the caller's.
|
|
227
|
+
invariant(isBeforeStatement(on, statementDate), `BeforeStatement for ${on.toDateString()}, not before the `
|
|
228
|
+
+ `statement's ${statementDate.toDateString()}`);
|
|
229
|
+
this.name = 'BeforeStatement';
|
|
230
|
+
}
|
|
231
|
+
}
|
|
213
232
|
/** Why an additional pension purchase is refused, as a closed set a
|
|
214
233
|
* consumer can branch on. */
|
|
215
234
|
export const ADDITIONAL_PENSION_REFUSALS = {
|
|
@@ -239,4 +258,42 @@ export class AdditionalPensionUnavailable extends Error {
|
|
|
239
258
|
this.name = 'AdditionalPensionUnavailable';
|
|
240
259
|
}
|
|
241
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Whether a read on `on` falls before the first date a statement answers,
|
|
263
|
+
* and so is one {@link BeforeStatement} refuses. `answersFrom` is that date,
|
|
264
|
+
* the statement's 31 March (`MemberBenefits.statementAnswersFrom`), or null
|
|
265
|
+
* where there is no statement and every date is answered. The one
|
|
266
|
+
* definition of the boundary, so a caller checking its own dates first and
|
|
267
|
+
* the library refusing them cannot disagree on the day itself, which is
|
|
268
|
+
* answered.
|
|
269
|
+
*/
|
|
270
|
+
export function isBeforeStatement(on, answersFrom) {
|
|
271
|
+
return answersFrom !== null && on < answersFrom;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Assert a domain invariant that must ALWAYS hold. Throws a bare
|
|
275
|
+
* Error when `condition` is false. Unlike the absent-data errors
|
|
276
|
+
* above — which callers catch by type — an invariant failure signals
|
|
277
|
+
* an internal inconsistency (a regression), so it is deliberately a
|
|
278
|
+
* plain, uncatchable-by-type throw: better a loud stop in a test or
|
|
279
|
+
* page than a silently wrong figure.
|
|
280
|
+
*/
|
|
281
|
+
export function invariant(condition, message) {
|
|
282
|
+
if (!condition) {
|
|
283
|
+
throw new Error(message);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/** The message a missing scale, grade or point gives, most specific
|
|
287
|
+
* first. */
|
|
288
|
+
function scaleMessage(nation, year, gradeId, pointLabel) {
|
|
289
|
+
if (pointLabel !== undefined) {
|
|
290
|
+
return `No scale point "${pointLabel}" for `
|
|
291
|
+
+ `${gradeId} in ${nation} ${year}`;
|
|
292
|
+
}
|
|
293
|
+
if (gradeId !== undefined) {
|
|
294
|
+
return `No published scale for ${gradeId} in `
|
|
295
|
+
+ `${nation} ${year}`;
|
|
296
|
+
}
|
|
297
|
+
return `No published pay scale for ${nation} ${year}`;
|
|
298
|
+
}
|
|
242
299
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAeH;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAE9B;IAIA;IACA;IAEA;IARX,YACW,MAAc;IACvB;;8CAE0C;IACjC,IAAa,EACb,OAAgB;IACzB,6DAA6D;IACpD,UAAmB;QAE5B,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;QAT9C,WAAM,GAAN,MAAM,CAAQ;QAId,SAAI,GAAJ,IAAI,CAAS;QACb,YAAO,GAAP,OAAO,CAAS;QAEhB,eAAU,GAAV,UAAU,CAAS;QAG5B,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,uBAA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AAI,EAAE,CAAC;AACxD,CAAC"}
|
package/dist/factor-basis.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LEGACY_PENSION_AGES } from './pension/ages.js';
|
|
2
2
|
import { FactorTable } from './gad/factor-table.js';
|
|
3
|
+
import type { ProjectionMoney } from './pension/money.js';
|
|
3
4
|
import type { FactorProvenance, FactorTableKind } from './gad/factor-table.js';
|
|
4
5
|
/**
|
|
5
6
|
* The factor tables the library reads, named for what each is for. The
|
|
@@ -54,9 +55,6 @@ declare const TABLES: {
|
|
|
54
55
|
readonly firstAge: 65;
|
|
55
56
|
}>;
|
|
56
57
|
};
|
|
57
|
-
/** Every table the library reads, by its GAD reference. The one set of
|
|
58
|
-
* instances, so two callers cannot read the same table two ways. */
|
|
59
|
-
export declare function factorTable<K extends keyof typeof TABLES>(ref: K): (typeof TABLES)[K];
|
|
60
58
|
/** Which benefit a factor applies to, where two benefits measured from
|
|
61
59
|
* one pension age read different tables: a 1995 Section pension and its
|
|
62
60
|
* automatic lump sum, and 2015 Section additional pension. */
|
|
@@ -122,10 +120,32 @@ export type FactorOutcome = {
|
|
|
122
120
|
readonly source: typeof FACTOR_SOURCES.noLateUplift;
|
|
123
121
|
readonly factor: 1;
|
|
124
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* A figure before and after its early or late factor, and the factor.
|
|
125
|
+
* Read the figure before it from `beforeFactor`, never by dividing `after`
|
|
126
|
+
* by `factor`: a pension and its lump sum each have their own factor.
|
|
127
|
+
* `F` is `FactorOutcome | null` where the rules may apply no factor
|
|
128
|
+
* because they pay nothing.
|
|
129
|
+
*/
|
|
130
|
+
export interface Factored<F extends FactorOutcome | null = FactorOutcome> {
|
|
131
|
+
readonly beforeFactor: ProjectionMoney;
|
|
132
|
+
/** After the factor: what is paid. */
|
|
133
|
+
readonly after: ProjectionMoney;
|
|
134
|
+
readonly factor: F;
|
|
135
|
+
}
|
|
136
|
+
/** Every table the library reads, by its GAD reference. The one set of
|
|
137
|
+
* instances, so two callers cannot read the same table two ways. */
|
|
138
|
+
export declare function factorTable<K extends keyof typeof TABLES>(ref: K): (typeof TABLES)[K];
|
|
125
139
|
/**
|
|
126
140
|
* Read the factor for a drawing. The date decides the direction as well
|
|
127
141
|
* as the cell, so a basis whose direction the dates contradict is a bug
|
|
128
142
|
* in the section that derived it and fails loud.
|
|
129
143
|
*/
|
|
130
144
|
export declare function readFactor(basis: FactorBasis, dateOfBirth: Date, drawn: Date): FactorOutcome;
|
|
145
|
+
/**
|
|
146
|
+
* A figure with its factor applied: the one place `after` is made, so it
|
|
147
|
+
* is always `beforeFactor` times the factor, in both rulers. No factor
|
|
148
|
+
* means the rules pay nothing, so nothing is paid after it.
|
|
149
|
+
*/
|
|
150
|
+
export declare function factored<F extends FactorOutcome | null>(beforeFactor: ProjectionMoney, factor: F): Factored<F>;
|
|
131
151
|
export {};
|
package/dist/factor-basis.js
CHANGED
|
@@ -20,6 +20,7 @@ import { periodInYearsMonths, npaDate } from './dates.js';
|
|
|
20
20
|
import { invariant } from './errors.js';
|
|
21
21
|
import { LEGACY_PENSION_AGES } from './pension/ages.js';
|
|
22
22
|
import { FactorTable } from './gad/factor-table.js';
|
|
23
|
+
import { timesMoney } from './pension/money.js';
|
|
23
24
|
import { ERF_0_420 } from './gad/erf-2023-06-30.js';
|
|
24
25
|
import { LRF_0_421 } from './gad/lrf-2023-06-30.js';
|
|
25
26
|
import { LRF_0_422 } from './gad/lrf-0-422-2023-06-30.js';
|
|
@@ -62,11 +63,6 @@ const TABLES = {
|
|
|
62
63
|
[FACTOR_TABLES.earlyAge65]: new FactorTable(ERF_1_402),
|
|
63
64
|
[FACTOR_TABLES.late2008]: new FactorTable(LRF_2_416),
|
|
64
65
|
};
|
|
65
|
-
/** Every table the library reads, by its GAD reference. The one set of
|
|
66
|
-
* instances, so two callers cannot read the same table two ways. */
|
|
67
|
-
export function factorTable(ref) {
|
|
68
|
-
return TABLES[ref];
|
|
69
|
-
}
|
|
70
66
|
/** Which benefit a factor applies to, where two benefits measured from
|
|
71
67
|
* one pension age read different tables: a 1995 Section pension and its
|
|
72
68
|
* automatic lump sum, and 2015 Section additional pension. */
|
|
@@ -95,30 +91,11 @@ export const FACTOR_SOURCES = {
|
|
|
95
91
|
atPensionAge: 'at-normal-pension-age',
|
|
96
92
|
noLateUplift: 'section-awards-no-late-uplift',
|
|
97
93
|
};
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const early = basis.direction === FACTOR_DIRECTIONS.early;
|
|
103
|
-
if (section2015) {
|
|
104
|
-
const additionalPension = basis.applies === FACTOR_APPLIES.additionalPension;
|
|
105
|
-
if (early)
|
|
106
|
-
return TABLES[FACTOR_TABLES.early2015];
|
|
107
|
-
return additionalPension
|
|
108
|
-
? TABLES[FACTOR_TABLES.late2015AdditionalPension]
|
|
109
|
-
: TABLES[FACTOR_TABLES.late2015];
|
|
110
|
-
}
|
|
111
|
-
if (section1995) {
|
|
112
|
-
const pension = basis.applies === FACTOR_APPLIES.pension;
|
|
113
|
-
return pension
|
|
114
|
-
? TABLES[FACTOR_TABLES.early1995Pension]
|
|
115
|
-
: TABLES[FACTOR_TABLES.early1995LumpSum];
|
|
116
|
-
}
|
|
117
|
-
return early
|
|
118
|
-
? TABLES[FACTOR_TABLES.earlyAge65]
|
|
119
|
-
: TABLES[FACTOR_TABLES.late2008];
|
|
94
|
+
/** Every table the library reads, by its GAD reference. The one set of
|
|
95
|
+
* instances, so two callers cannot read the same table two ways. */
|
|
96
|
+
export function factorTable(ref) {
|
|
97
|
+
return TABLES[ref];
|
|
120
98
|
}
|
|
121
|
-
const keyedByAge = (table) => table.index.by === 'age';
|
|
122
99
|
/**
|
|
123
100
|
* Read the factor for a drawing. The date decides the direction as well
|
|
124
101
|
* as the cell, so a basis whose direction the dates contradict is a bug
|
|
@@ -158,4 +135,39 @@ export function readFactor(basis, dateOfBirth, drawn) {
|
|
|
158
135
|
provenance: table.provenance,
|
|
159
136
|
};
|
|
160
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* A figure with its factor applied: the one place `after` is made, so it
|
|
140
|
+
* is always `beforeFactor` times the factor, in both rulers. No factor
|
|
141
|
+
* means the rules pay nothing, so nothing is paid after it.
|
|
142
|
+
*/
|
|
143
|
+
export function factored(beforeFactor, factor) {
|
|
144
|
+
const times = factor === null ? 0 : factor.factor;
|
|
145
|
+
return { beforeFactor, after: timesMoney(beforeFactor, times), factor };
|
|
146
|
+
}
|
|
147
|
+
/** The table a basis reads, and how it is keyed. */
|
|
148
|
+
function tableFor(basis) {
|
|
149
|
+
const section2015 = basis.against === MEMBERS_NPA;
|
|
150
|
+
const section1995 = basis.against === LEGACY_PENSION_AGES.section1995;
|
|
151
|
+
const early = basis.direction === FACTOR_DIRECTIONS.early;
|
|
152
|
+
if (section2015) {
|
|
153
|
+
const additionalPension = basis.applies === FACTOR_APPLIES.additionalPension;
|
|
154
|
+
if (early)
|
|
155
|
+
return TABLES[FACTOR_TABLES.early2015];
|
|
156
|
+
return additionalPension
|
|
157
|
+
? TABLES[FACTOR_TABLES.late2015AdditionalPension]
|
|
158
|
+
: TABLES[FACTOR_TABLES.late2015];
|
|
159
|
+
}
|
|
160
|
+
if (section1995) {
|
|
161
|
+
const pension = basis.applies === FACTOR_APPLIES.pension;
|
|
162
|
+
return pension
|
|
163
|
+
? TABLES[FACTOR_TABLES.early1995Pension]
|
|
164
|
+
: TABLES[FACTOR_TABLES.early1995LumpSum];
|
|
165
|
+
}
|
|
166
|
+
return early
|
|
167
|
+
? TABLES[FACTOR_TABLES.earlyAge65]
|
|
168
|
+
: TABLES[FACTOR_TABLES.late2008];
|
|
169
|
+
}
|
|
170
|
+
function keyedByAge(table) {
|
|
171
|
+
return table.index.by === 'age';
|
|
172
|
+
}
|
|
161
173
|
//# sourceMappingURL=factor-basis.js.map
|
package/dist/factor-basis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factor-basis.js","sourceRoot":"","sources":["../src/factor-basis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAC,mBAAmB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"factor-basis.js","sourceRoot":"","sources":["../src/factor-basis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAC,mBAAmB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAQ9C,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAC,SAAS,EAAC,MAAM,+BAA+B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;2CACuC;IACvC,SAAS,EAAE,OAAO;IAClB;iCAC6B;IAC7B,QAAQ,EAAE,OAAO;IACjB;sCACkC;IAClC,yBAAyB,EAAE,OAAO;IAClC,6CAA6C;IAC7C,gBAAgB,EAAE,OAAO;I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ACD,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,KAAK,cAAc,CAAC,OAAO,CAAC;QACzD,OAAO,OAAO;YACZ,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC;YACxC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,KAAK;QACV,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC;QAClC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,UAAU,CACjB,KAAuD;IAEvD,OAAO,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC;AAClC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { afcBand1 } from './afc-scales.js';
|
|
|
2
2
|
export type { AfcBand1, AfcBand1Published } from './afc-scales.js';
|
|
3
3
|
export { AFC_BANDS, AFC_BAND_IDS, afcScaleSource, latestAfcYear, payYearLag, isAwaitingPayAward, assertPayYearLagIsSane, afcPayYears, NLW_HOURLY, WALES_LIVING_WAGE, annualiseHourly, } from './scales.js';
|
|
4
4
|
export type { AfcBandId, HcasZone, HcasZones, WalesLivingWage, } from './scales.js';
|
|
5
|
-
export type { ScalePoint } from './scale-point.js';
|
|
5
|
+
export type { PayLadder, ScalePoint } from './scale-point.js';
|
|
6
6
|
export { PensionTiers, getEmployerPensionRate, getPensionScheme, getPensionTiers, getPensionTiersVO, lookupPensionTier, pensionTierRate, } from './pension.js';
|
|
7
7
|
export type { EmployerPensionRate, NhsPensionScheme, PensionTier, } from './pension.js';
|
|
8
8
|
export type { SalaryRange } from './values.js';
|
|
@@ -19,30 +19,30 @@ export { ADDITIONAL_PENSION_LIMIT, ADDITIONAL_PENSION_PAYMENTS, ADDITIONAL_PENSI
|
|
|
19
19
|
export type { AdditionalPensionPayment, AdditionalPensionPurchase, } from './additional-pension.js';
|
|
20
20
|
export { ADDITIONAL_PENSION_COVERS } from './gad/additional-pension-table.js';
|
|
21
21
|
export type { AdditionalPensionCover, AdditionalPensionProvenance, } from './gad/additional-pension-table.js';
|
|
22
|
-
export { ADDITIONAL_PENSION_REFUSALS, AdditionalPensionUnavailable, AmbiguousScalePoint, AwardUnavailable, BenefitNotModelled, NOT_MODELLED, PayPathUnavailable, PensionTiersUnavailable, RetirementFactorOutOfRange, ScaleUnavailable, } from './errors.js';
|
|
23
|
-
export type { AdditionalPensionRefusal, NotModelled } from './errors.js';
|
|
24
|
-
export { DocumentSource } from './document-source.js';
|
|
22
|
+
export { ADDITIONAL_PENSION_REFUSALS, AdditionalPensionUnavailable, AmbiguousScalePoint, AwardUnavailable, BeforeStatement, BenefitNotModelled, isBeforeStatement, NOT_MODELLED, PayPathUnavailable, PensionTiersUnavailable, RetirementFactorOutOfRange, ScaleUnavailable, STATEMENT_READS, } from './errors.js';
|
|
23
|
+
export type { AdditionalPensionRefusal, NotModelled, StatementRead, } from './errors.js';
|
|
24
|
+
export { DocumentSource, SOURCE_CURRENCIES } from './document-source.js';
|
|
25
25
|
export { isoDate, isoMonth, monthOf, firstOfMonth, monthToDate, isoToDate, isoDateOf, } from './iso-date.js';
|
|
26
26
|
export type { IsoDate, IsoMonth } from './iso-date.js';
|
|
27
|
-
export type { DocumentSourceFields, SourceCurrency, } from './document-source.js';
|
|
28
|
-
export { AFC_ENGLAND_SCALES_2025, AFC_ENGLAND_SCALES_2026, AFC_NI_2025, AFC_SCOTLAND, AFC_SCOTLAND_36_HOUR_WEEK, AFC_W_01_2026, AFC_W_02_2025, AFC_W_02_2026, AP_FACTSHEET_2026, DHSC_PETITION_779519, FA2004_SCH36_PARA_23ZB, SPPA_NHS_CIRCULAR_2025_09, HSC_TC8_05_2025, MD_W_01_2025, MD_W_01_2026, PC_MD_1_2026_R2, PCS_DD_2025_01, PCS_DD_2025_01_ADDENDUM, PCS_DD_2026_01, PCS_DD_2026_02, } from './sources.js';
|
|
27
|
+
export type { DocumentSourceFields, PageSource, SourceCurrency, } from './document-source.js';
|
|
28
|
+
export { AFC_ENGLAND_SCALES_2025, AFC_ENGLAND_SCALES_2026, AFC_NI_2025, AFC_SCOTLAND, AFC_SCOTLAND_36_HOUR_WEEK, AFC_W_01_2026, AFC_W_02_2025, AFC_W_02_2026, AP_FACTSHEET_2026, DHSC_PETITION_779519, FA2004_SCH36_PARA_23ZB, SPPA_NHS_CIRCULAR_2025_09, HSC_TC8_05_2025, MD_W_01_2025, MD_W_01_2026, NHSBSA_ESTIMATE_GUIDE, NHSBSA_STATEMENT_GUIDE, PC_MD_1_2026_R2, PCS_DD_2025_01, PCS_DD_2025_01_ADDENDUM, PCS_DD_2026_01, PCS_DD_2026_02, } from './sources.js';
|
|
29
29
|
export { AWARD_FAMILIES, afcAward, anyNationSettled, awardFamilyFor, awardsFor, changesFor, } from './award.js';
|
|
30
30
|
export type { AwardFamily, ForthcomingChange, PayAward, PayChange, PayScaleId, } from './award.js';
|
|
31
31
|
export { payRound } from './pay-round.js';
|
|
32
32
|
export type { PayRound, RoundStatus } from './pay-round.js';
|
|
33
33
|
export { SESSION_ALLOWANCES, afcSessionAllowances, sessionAllowance, } from './allowances.js';
|
|
34
34
|
export type { SessionAllowance, SessionAllowanceId, } from './allowances.js';
|
|
35
|
-
export { ACTIVE_REVAL_BONUS_PCT, IN_SERVICE_REVALUATION, revaluationFor, } from './revaluation.js';
|
|
35
|
+
export { ACTIVE_REVAL_BONUS_PCT, activeRatePct, IN_SERVICE_REVALUATION, revaluationFor, } from './revaluation.js';
|
|
36
36
|
export type { RevaluationYear } from './revaluation.js';
|
|
37
37
|
export { buildPayPath, PAY_BASES, promotionalIndex } from './pay-path.js';
|
|
38
38
|
export type { PayBasis, PayPath, YearPay } from './pay-path.js';
|
|
39
39
|
export { ACCRUALS, memberBenefits, PAST_YEARS, PERIOD_KINDS, REMEDY, REMEDY_BASES, SECTION_OPENED, SECTIONS, } from './member/index.js';
|
|
40
40
|
export { PAY_MEASURES } from './sections/final-salary.js';
|
|
41
41
|
export type { PayMeasure } from './sections/final-salary.js';
|
|
42
|
-
export type { Assumptions, Award, DeclaredPeriod, Holdings, LegacyRules, LegacySectionId, Member, MemberBenefits, PastYears, Position, RemedyBasis, RemedyElection, RetirementChoices, SectionId, ServicePeriod, } from './member/index.js';
|
|
42
|
+
export type { Assumptions, Award, DeclaredPeriod, Holdings, LegacyRules, LegacySectionId, Member, MemberBenefits, PastYears, Position, RemedyBasis, RemedyElection, RetirementChoices, RulerLedgers, Section2015Walk, SectionId, ServicePeriod, StatementBalance, } from './member/index.js';
|
|
43
43
|
export type { DeclaredPay, MemberPay } from './pay-path.js';
|
|
44
44
|
export { FACTOR_APPLIES, FACTOR_SOURCES } from './factor-basis.js';
|
|
45
|
-
export type { Applies2015, FactorOutcome } from './factor-basis.js';
|
|
45
|
+
export type { Applies2015, Factored, FactorOutcome } from './factor-basis.js';
|
|
46
46
|
export { factor2015 } from './sections/section-2015.js';
|
|
47
47
|
export { CASH_CHOICES } from './commutation.js';
|
|
48
48
|
export type { CashChoice } from './commutation.js';
|
|
@@ -57,10 +57,12 @@ export type { ProjectionPoint } from './pension/curve.js';
|
|
|
57
57
|
export type { ProjectionMoney } from './pension/money.js';
|
|
58
58
|
export { createPrices, createPublishedPrices, inflationFactor, TODAYS_MONEY_CPI, } from './pension/prices.js';
|
|
59
59
|
export type { CpiEntry, CpiSource, Prices, } from './pension/prices.js';
|
|
60
|
-
export {
|
|
60
|
+
export { deferredRatePct, MEMBER_PHASES, upliftsFor, } from './pension/uplift.js';
|
|
61
61
|
export type { AppliedUplift, MemberPhase, UpliftSource, } from './pension/uplift.js';
|
|
62
|
-
export { schemeYearClosedBy, schemeYearEndDate, schemeYearEndFor, schemeYearStartDate,
|
|
63
|
-
export type {
|
|
62
|
+
export { isSchemeYearEnd, schemeYearAfter, schemeYearBefore, schemeYearClosedBy, schemeYearEnd, schemeYearEndDate, schemeYearEndFor, schemeYearStartDate, } from './pension/scheme-year.js';
|
|
63
|
+
export type { SchemeYearEnd } from './pension/scheme-year.js';
|
|
64
|
+
export { SEED_BASES, seedFromJoinDate, seedFromStatement, } from './pension/seed.js';
|
|
65
|
+
export type { LedgerSeed, SeedBasis } from './pension/seed.js';
|
|
64
66
|
export { buildLedger } from './pension/ledger.js';
|
|
65
67
|
export type { AppliedDrawing, AppliedLeaverAdjustment, LedgerRequest, LedgerYear, MemberLedger, } from './pension/ledger.js';
|
|
66
68
|
export type { EstimatedHistory } from './pension/history.js';
|
|
@@ -70,9 +72,9 @@ export { getHcasPcts, getHcasZone, } from './hcas-pcts.js';
|
|
|
70
72
|
export type { HcasPct } from './hcas-pcts.js';
|
|
71
73
|
export { AFC_REGIONS, ZONE_TO_REGION, afcRegionToHcasZone, afcRegionToNation, isAfcRegionId, isNation, resolveRegion, } from './regions.js';
|
|
72
74
|
export type { AfcRegionId, ResolvedRegion, } from './regions.js';
|
|
73
|
-
export { AFC_CURRENT_YEAR, AFC_PREVIOUS_YEAR, getAfcScales, } from './bands.js';
|
|
75
|
+
export { AFC_CURRENT_YEAR, AFC_PREVIOUS_YEAR, afcPointOf, getAfcScales, } from './bands.js';
|
|
74
76
|
export type { AfcBandMeta, AfcScaleData, } from './bands.js';
|
|
75
|
-
export {
|
|
77
|
+
export { nhsTakeHome } from './take-home.js';
|
|
76
78
|
export { afcWeekInForce, afcWeeklyHours, hoursPerYear } from './working-week.js';
|
|
77
79
|
export type { NhsTakeHomeOptions } from './take-home.js';
|
|
78
80
|
export { fmtMoney, fmtPct, fmtSalary, formatGBP, formatGBPPrecise, formatPct, formatPctPrecise, yearLabel, } from './format.js';
|