@casomoltd/nhs-pay 0.4.14 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bands.d.ts +8 -17
- package/dist/bands.js +12 -130
- package/dist/bands.js.map +1 -1
- package/dist/errors.d.ts +30 -0
- package/dist/errors.js +51 -0
- package/dist/errors.js.map +1 -0
- package/dist/format.d.ts +1 -2
- package/dist/format.js +1 -2
- package/dist/format.js.map +1 -1
- package/dist/hcas-pcts.js +1 -1
- package/dist/hcas-pcts.js.map +1 -1
- package/dist/hcas.d.ts +17 -7
- package/dist/hcas.js +23 -10
- package/dist/hcas.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/pension.d.ts +33 -7
- package/dist/pension.js +50 -16
- package/dist/pension.js.map +1 -1
- package/dist/post.d.ts +50 -0
- package/dist/post.js +65 -0
- package/dist/post.js.map +1 -0
- package/dist/regions.d.ts +0 -5
- package/dist/regions.js +0 -19
- package/dist/regions.js.map +1 -1
- package/dist/resolver.d.ts +39 -0
- package/dist/resolver.js +55 -0
- package/dist/resolver.js.map +1 -0
- package/dist/role.d.ts +31 -0
- package/dist/role.js +14 -0
- package/dist/role.js.map +1 -0
- package/dist/scales.d.ts +13 -9
- package/dist/scales.js +100 -72
- package/dist/scales.js.map +1 -1
- package/dist/values.d.ts +19 -0
- package/dist/values.js +13 -0
- package/dist/values.js.map +1 -0
- package/package.json +1 -1
package/dist/pension.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NHS pension tier types,
|
|
3
|
-
* year-specific tier
|
|
2
|
+
* NHS pension contributions: member tier types, the
|
|
3
|
+
* `PensionTiers` lookup value object, year-specific tier
|
|
4
|
+
* data, and the per-nation employer contribution rates.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
+
* Sources:
|
|
7
|
+
* - Member tiers: https://www.nhsbsa.nhs.uk/member-hub/member-hub-contribution-rates
|
|
8
|
+
* - Employer rates: see `EmployerPensionRate.source` per nation below.
|
|
6
9
|
*/
|
|
7
10
|
import { TAX_YEARS } from '@casomoltd/paye-calc';
|
|
11
|
+
import { PensionTiersUnavailable } from './errors.js';
|
|
8
12
|
// England and Wales share the NHSBSA-administered scheme, so they
|
|
9
13
|
// share one rate; Scotland (SPPA) and NI (HSC) run their own.
|
|
10
14
|
const NHSBSA_EMPLOYER_RATE = {
|
|
@@ -37,15 +41,39 @@ export function getEmployerPensionRate(nation) {
|
|
|
37
41
|
return EMPLOYER_PENSION_RATES[nation];
|
|
38
42
|
}
|
|
39
43
|
/**
|
|
40
|
-
*
|
|
44
|
+
* A member's pension contribution tier table, owning the
|
|
45
|
+
* salary → tier / rate lookup. Wrap a tax year's tiers
|
|
46
|
+
* (see {@link getPensionTiersVO}) and query it directly,
|
|
47
|
+
* rather than re-scanning the array at each call site.
|
|
41
48
|
*/
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
export class PensionTiers {
|
|
50
|
+
tiers;
|
|
51
|
+
constructor(tiers) {
|
|
52
|
+
this.tiers = tiers;
|
|
53
|
+
}
|
|
54
|
+
/** Contribution rate (%) for a salary; 0 if unbanded. */
|
|
55
|
+
rateFor(salary) {
|
|
56
|
+
const match = this.tierFor(salary);
|
|
57
|
+
return match ? match.band.rate * 100 : 0;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Matching tier (1-based) and band for a salary, or
|
|
61
|
+
* null when no band contains it.
|
|
62
|
+
*/
|
|
63
|
+
tierFor(salary) {
|
|
64
|
+
for (const band of this.tiers) {
|
|
65
|
+
if (salary <= band.max) {
|
|
66
|
+
return { tier: band.tier, band };
|
|
67
|
+
}
|
|
46
68
|
}
|
|
69
|
+
return null;
|
|
47
70
|
}
|
|
48
|
-
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Pension contribution rate (%) for a salary.
|
|
74
|
+
*/
|
|
75
|
+
export function pensionTierRate(salary, tiers) {
|
|
76
|
+
return new PensionTiers(tiers).rateFor(salary);
|
|
49
77
|
}
|
|
50
78
|
/**
|
|
51
79
|
* Look up the matching pension tier for a salary.
|
|
@@ -53,12 +81,7 @@ export function pensionTierRate(salary, tiers) {
|
|
|
53
81
|
* or null if no tiers are provided.
|
|
54
82
|
*/
|
|
55
83
|
export function lookupPensionTier(salary, tiers) {
|
|
56
|
-
|
|
57
|
-
if (salary <= t.max) {
|
|
58
|
-
return { tier: t.tier, band: t };
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
84
|
+
return new PensionTiers(tiers).tierFor(salary);
|
|
62
85
|
}
|
|
63
86
|
// ── Tier data by tax year ───────────────────────
|
|
64
87
|
const PENSION_TIERS_2025_26 = [
|
|
@@ -91,6 +114,17 @@ const PENSION_TIERS = {
|
|
|
91
114
|
* tier — do not treat these as UK-wide.
|
|
92
115
|
*/
|
|
93
116
|
export function getPensionTiers(year) {
|
|
94
|
-
|
|
117
|
+
const tiers = PENSION_TIERS[year];
|
|
118
|
+
if (!tiers) {
|
|
119
|
+
throw new PensionTiersUnavailable(year);
|
|
120
|
+
}
|
|
121
|
+
return tiers;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* {@link PensionTiers} value object for a tax year — the
|
|
125
|
+
* same data as {@link getPensionTiers}, ready to query.
|
|
126
|
+
*/
|
|
127
|
+
export function getPensionTiersVO(year) {
|
|
128
|
+
return new PensionTiers(getPensionTiers(year));
|
|
95
129
|
}
|
|
96
130
|
//# sourceMappingURL=pension.js.map
|
package/dist/pension.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pension.js","sourceRoot":"","sources":["../src/pension.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pension.js","sourceRoot":"","sources":["../src/pension.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO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ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post — an immutable salaried NHS post: a person on a
|
|
3
|
+
* salary, in a nation and tax year, contributing to the
|
|
4
|
+
* NHS pension. Take-home, pension rate and contribution
|
|
5
|
+
* are all *derived* from it.
|
|
6
|
+
*
|
|
7
|
+
* A façade: every derived value delegates to the existing
|
|
8
|
+
* NHS modules ({@link nhsTakeHome}, {@link PensionTiers});
|
|
9
|
+
* nothing is absorbed here. A Post never mutates — change
|
|
10
|
+
* a value by building a new one (see {@link Post.withSalary}).
|
|
11
|
+
*/
|
|
12
|
+
import type { Nation, TaxYear, TakeHomePay } from '@casomoltd/paye-calc';
|
|
13
|
+
import type { Role } from './role.js';
|
|
14
|
+
/** The tax/NI/pension context that fixes a Post. */
|
|
15
|
+
export interface PostIdentity {
|
|
16
|
+
readonly nation: Nation;
|
|
17
|
+
readonly taxYear: TaxYear;
|
|
18
|
+
}
|
|
19
|
+
export declare class Post {
|
|
20
|
+
readonly identity: PostIdentity;
|
|
21
|
+
readonly salary: number;
|
|
22
|
+
readonly role: Role;
|
|
23
|
+
private constructor();
|
|
24
|
+
/**
|
|
25
|
+
* Build a Post from a gross salary — whatever the member
|
|
26
|
+
* is actually paid, already adjusted for HCAS / floors
|
|
27
|
+
* by the resolver. `salary` is the fundamental input;
|
|
28
|
+
* everything else is derived.
|
|
29
|
+
*
|
|
30
|
+
* A bare salary is a `vsm` role (an off-scale post); a
|
|
31
|
+
* scale-point resolver passes the scale identity instead.
|
|
32
|
+
*/
|
|
33
|
+
static fromSalary(salary: number, nation: Nation, year: TaxYear, role?: Role): Post;
|
|
34
|
+
/** Member contribution rate (%) for this salary. */
|
|
35
|
+
get pensionRate(): number;
|
|
36
|
+
/**
|
|
37
|
+
* Annual member pension contribution (£) — read from the
|
|
38
|
+
* take-home breakdown rather than re-derived, so it can
|
|
39
|
+
* never drift from what paye-calc actually deducts.
|
|
40
|
+
*/
|
|
41
|
+
get pensionContribution(): number;
|
|
42
|
+
/** Full take-home breakdown (tax, NI, pension, net). */
|
|
43
|
+
get takeHome(): TakeHomePay;
|
|
44
|
+
/** Annual income tax (£). */
|
|
45
|
+
get tax(): number;
|
|
46
|
+
/** Annual national insurance (£). */
|
|
47
|
+
get nationalInsurance(): number;
|
|
48
|
+
/** The same post at a different salary (e.g. a raise). */
|
|
49
|
+
withSalary(salary: number): Post;
|
|
50
|
+
}
|
package/dist/post.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post — an immutable salaried NHS post: a person on a
|
|
3
|
+
* salary, in a nation and tax year, contributing to the
|
|
4
|
+
* NHS pension. Take-home, pension rate and contribution
|
|
5
|
+
* are all *derived* from it.
|
|
6
|
+
*
|
|
7
|
+
* A façade: every derived value delegates to the existing
|
|
8
|
+
* NHS modules ({@link nhsTakeHome}, {@link PensionTiers});
|
|
9
|
+
* nothing is absorbed here. A Post never mutates — change
|
|
10
|
+
* a value by building a new one (see {@link Post.withSalary}).
|
|
11
|
+
*/
|
|
12
|
+
import { nationToTaxRegion } from '@casomoltd/paye-calc';
|
|
13
|
+
import { getPensionTiersVO } from './pension.js';
|
|
14
|
+
import { nhsTakeHome } from './take-home.js';
|
|
15
|
+
export class Post {
|
|
16
|
+
identity;
|
|
17
|
+
salary;
|
|
18
|
+
role;
|
|
19
|
+
constructor(identity, salary, role) {
|
|
20
|
+
this.identity = identity;
|
|
21
|
+
this.salary = salary;
|
|
22
|
+
this.role = role;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build a Post from a gross salary — whatever the member
|
|
26
|
+
* is actually paid, already adjusted for HCAS / floors
|
|
27
|
+
* by the resolver. `salary` is the fundamental input;
|
|
28
|
+
* everything else is derived.
|
|
29
|
+
*
|
|
30
|
+
* A bare salary is a `vsm` role (an off-scale post); a
|
|
31
|
+
* scale-point resolver passes the scale identity instead.
|
|
32
|
+
*/
|
|
33
|
+
static fromSalary(salary, nation, year, role = { kind: 'vsm' }) {
|
|
34
|
+
return new Post({ nation, taxYear: year }, salary, role);
|
|
35
|
+
}
|
|
36
|
+
/** Member contribution rate (%) for this salary. */
|
|
37
|
+
get pensionRate() {
|
|
38
|
+
return getPensionTiersVO(this.identity.taxYear).rateFor(this.salary);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Annual member pension contribution (£) — read from the
|
|
42
|
+
* take-home breakdown rather than re-derived, so it can
|
|
43
|
+
* never drift from what paye-calc actually deducts.
|
|
44
|
+
*/
|
|
45
|
+
get pensionContribution() {
|
|
46
|
+
return this.takeHome.pensionDeduction;
|
|
47
|
+
}
|
|
48
|
+
/** Full take-home breakdown (tax, NI, pension, net). */
|
|
49
|
+
get takeHome() {
|
|
50
|
+
return nhsTakeHome(this.salary, this.pensionRate / 100, this.identity.taxYear, nationToTaxRegion(this.identity.nation));
|
|
51
|
+
}
|
|
52
|
+
/** Annual income tax (£). */
|
|
53
|
+
get tax() {
|
|
54
|
+
return this.takeHome.incomeTax;
|
|
55
|
+
}
|
|
56
|
+
/** Annual national insurance (£). */
|
|
57
|
+
get nationalInsurance() {
|
|
58
|
+
return this.takeHome.nationalInsurance;
|
|
59
|
+
}
|
|
60
|
+
/** The same post at a different salary (e.g. a raise). */
|
|
61
|
+
withSalary(salary) {
|
|
62
|
+
return new Post(this.identity, salary, this.role);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=post.js.map
|
package/dist/post.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../src/post.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAMvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAS3C,MAAM,OAAO,IAAI;IAEJ;IACA;IAC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HANGED
|
@@ -28,10 +28,6 @@ export interface ResolvedRegion {
|
|
|
28
28
|
taxRegion: TaxRegion;
|
|
29
29
|
/** Key into AfcScaleYear.hcas, if applicable */
|
|
30
30
|
hcasProp: keyof HcasZones | null;
|
|
31
|
-
/** Short label for page titles */
|
|
32
|
-
label: string;
|
|
33
|
-
/** Tax system description for intro copy */
|
|
34
|
-
taxNote: string;
|
|
35
31
|
isWales: boolean;
|
|
36
32
|
}
|
|
37
33
|
/** Resolve a region code to tax/HCAS/label info. */
|
|
@@ -42,6 +38,5 @@ export declare const ZONE_TO_REGION: Record<HcasZoneId, AfcRegionId>;
|
|
|
42
38
|
/** Map an AfC region code to its HCAS zone,
|
|
43
39
|
* or null for non-HCAS regions. */
|
|
44
40
|
export declare function afcRegionToHcasZone(id: AfcRegionId): HcasZoneId | null;
|
|
45
|
-
export declare const ZONE_LABELS: Record<HcasZoneId, string>;
|
|
46
41
|
/** Type guard for paye-calc Nation strings. */
|
|
47
42
|
export declare function isNation(raw: string | null | undefined): raw is Nation;
|
package/dist/regions.js
CHANGED
|
@@ -28,50 +28,36 @@ const REGION_INFO = {
|
|
|
28
28
|
[AFC_REGIONS.ENG]: {
|
|
29
29
|
taxRegion: TAX_REGIONS.rUK,
|
|
30
30
|
hcasProp: null,
|
|
31
|
-
label: 'England',
|
|
32
|
-
taxNote: 'England and Wales tax rates',
|
|
33
31
|
isWales: false,
|
|
34
32
|
},
|
|
35
33
|
[AFC_REGIONS.ENG_IL]: {
|
|
36
34
|
taxRegion: TAX_REGIONS.rUK,
|
|
37
35
|
hcasProp: 'innerLondon',
|
|
38
|
-
label: 'England \u2014 Inner London HCAS',
|
|
39
|
-
taxNote: 'England and Wales tax rates',
|
|
40
36
|
isWales: false,
|
|
41
37
|
},
|
|
42
38
|
[AFC_REGIONS.ENG_OL]: {
|
|
43
39
|
taxRegion: TAX_REGIONS.rUK,
|
|
44
40
|
hcasProp: 'outerLondon',
|
|
45
|
-
label: 'England \u2014 Outer London HCAS',
|
|
46
|
-
taxNote: 'England and Wales tax rates',
|
|
47
41
|
isWales: false,
|
|
48
42
|
},
|
|
49
43
|
[AFC_REGIONS.ENG_FR]: {
|
|
50
44
|
taxRegion: TAX_REGIONS.rUK,
|
|
51
45
|
hcasProp: 'fringe',
|
|
52
|
-
label: 'England \u2014 Fringe HCAS',
|
|
53
|
-
taxNote: 'England and Wales tax rates',
|
|
54
46
|
isWales: false,
|
|
55
47
|
},
|
|
56
48
|
[AFC_REGIONS.WAL]: {
|
|
57
49
|
taxRegion: TAX_REGIONS.rUK,
|
|
58
50
|
hcasProp: null,
|
|
59
|
-
label: 'Wales',
|
|
60
|
-
taxNote: 'England and Wales tax rates',
|
|
61
51
|
isWales: true,
|
|
62
52
|
},
|
|
63
53
|
[AFC_REGIONS.SCO]: {
|
|
64
54
|
taxRegion: TAX_REGIONS.scotland,
|
|
65
55
|
hcasProp: null,
|
|
66
|
-
label: 'Scotland',
|
|
67
|
-
taxNote: 'Scottish income tax rates',
|
|
68
56
|
isWales: false,
|
|
69
57
|
},
|
|
70
58
|
[AFC_REGIONS.NI]: {
|
|
71
59
|
taxRegion: TAX_REGIONS.rUK,
|
|
72
60
|
hcasProp: null,
|
|
73
|
-
label: 'Northern Ireland',
|
|
74
|
-
taxNote: 'England and Wales tax rates',
|
|
75
61
|
isWales: false,
|
|
76
62
|
},
|
|
77
63
|
};
|
|
@@ -107,11 +93,6 @@ const REGION_TO_ZONE = Object.fromEntries(Object.entries(ZONE_TO_REGION)
|
|
|
107
93
|
export function afcRegionToHcasZone(id) {
|
|
108
94
|
return REGION_TO_ZONE[id] ?? null;
|
|
109
95
|
}
|
|
110
|
-
export const ZONE_LABELS = {
|
|
111
|
-
'inner-london': 'Inner London',
|
|
112
|
-
'outer-london': 'Outer London',
|
|
113
|
-
fringe: 'Fringe',
|
|
114
|
-
};
|
|
115
96
|
// ── Nation type guard ──────────────────────
|
|
116
97
|
const NATION_SET = new Set(Object.keys(NATIONS));
|
|
117
98
|
/** Type guard for paye-calc Nation strings. */
|
package/dist/regions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regions.js","sourceRoot":"","sources":["../src/regions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,WAAW,EACX,OAAO,GACR,MAAM,sBAAsB,CAAC;AAQ9B,mDAAmD;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;CACA,CAAC;AAKX,MAAM,kBAAkB,GACtB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAE7B,mCAAmC;AACnC,MAAM,UAAU,aAAa,CAC3B,GAAW;IAEX,OACE,kBACD,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"regions.js","sourceRoot":"","sources":["../src/regions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,WAAW,EACX,OAAO,GACR,MAAM,sBAAsB,CAAC;AAQ9B,mDAAmD;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;CACA,CAAC;AAKX,MAAM,kBAAkB,GACtB,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAE7B,mCAAmC;AACnC,MAAM,UAAU,aAAa,CAC3B,GAAW;IAEX,OACE,kBACD,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAClB,CAAC;AAYD,MAAM,WAAW,GAGb;I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ver reads the
|
|
4
|
+
* Agenda-for-Change tables; medical / dental resolvers
|
|
5
|
+
* (Phase 2) will read their own, all producing the same
|
|
6
|
+
* uniform Post. Polymorphism lives here, not on the Post.
|
|
7
|
+
*
|
|
8
|
+
* Each resolver stamps the Post's {@link Role} identity from
|
|
9
|
+
* the inputs it already holds (band / point / region), so the
|
|
10
|
+
* Post knows which scale position it came from.
|
|
11
|
+
*/
|
|
12
|
+
import type { Nation, TaxYear } from '@casomoltd/paye-calc';
|
|
13
|
+
import type { AfcBandId } from './scales.js';
|
|
14
|
+
import type { AfcRegionId } from './regions.js';
|
|
15
|
+
import { Post } from './post.js';
|
|
16
|
+
/**
|
|
17
|
+
* The uniform contract every pay family satisfies: build a
|
|
18
|
+
* Post from a salary, and enumerate what is published. The
|
|
19
|
+
* scale-point entry is family-specific (grades and their
|
|
20
|
+
* region model differ per family), so it is added by each
|
|
21
|
+
* resolver's own interface, not this shared one.
|
|
22
|
+
*/
|
|
23
|
+
export interface PayScaleResolver<G extends string> {
|
|
24
|
+
fromSalary(salary: number, nation: Nation, year: TaxYear): Post;
|
|
25
|
+
/** Grades with a published scale for this nation/year. */
|
|
26
|
+
availableGrades(nation: Nation, year: TaxYear): readonly G[];
|
|
27
|
+
/** Latest year a grade is published for a nation, or null. */
|
|
28
|
+
latestYearFor(gradeId: G, nation: Nation): TaxYear | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* AfC resolver — adds a band + point + region entry. AfC
|
|
32
|
+
* take-home threads an {@link AfcRegionId} (nation + HCAS
|
|
33
|
+
* zone collapsed), not a bare Nation, so its scale-point
|
|
34
|
+
* path resolves the HCAS / Wales-floor gross itself.
|
|
35
|
+
*/
|
|
36
|
+
export interface AfcResolver extends PayScaleResolver<AfcBandId> {
|
|
37
|
+
fromScalePoint(band: AfcBandId, pointLabel: string, region: AfcRegionId, year: TaxYear): Post;
|
|
38
|
+
}
|
|
39
|
+
export declare const afcResolver: AfcResolver;
|
package/dist/resolver.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pay-scale resolvers — build a {@link Post} from a
|
|
3
|
+
* published pay scale. The AfC resolver reads the
|
|
4
|
+
* Agenda-for-Change tables; medical / dental resolvers
|
|
5
|
+
* (Phase 2) will read their own, all producing the same
|
|
6
|
+
* uniform Post. Polymorphism lives here, not on the Post.
|
|
7
|
+
*
|
|
8
|
+
* Each resolver stamps the Post's {@link Role} identity from
|
|
9
|
+
* the inputs it already holds (band / point / region), so the
|
|
10
|
+
* Post knows which scale position it came from.
|
|
11
|
+
*/
|
|
12
|
+
import { AFC_TAX_YEARS } from './scales.js';
|
|
13
|
+
import { afcRegionToNation } from './regions.js';
|
|
14
|
+
import { getAfcScales } from './bands.js';
|
|
15
|
+
import { grossSalary } from './hcas.js';
|
|
16
|
+
import { ScaleUnavailable } from './errors.js';
|
|
17
|
+
import { Post } from './post.js';
|
|
18
|
+
export const afcResolver = {
|
|
19
|
+
fromSalary(salary, nation, year) {
|
|
20
|
+
return Post.fromSalary(salary, nation, year);
|
|
21
|
+
},
|
|
22
|
+
fromScalePoint(band, pointLabel, region, year) {
|
|
23
|
+
const nation = afcRegionToNation(region);
|
|
24
|
+
const scales = getAfcScales(year, nation);
|
|
25
|
+
const meta = scales.bands.find((b) => b.band === band);
|
|
26
|
+
if (!meta) {
|
|
27
|
+
throw new ScaleUnavailable(nation, year, band);
|
|
28
|
+
}
|
|
29
|
+
const point = meta.points.find((p) => p.label === pointLabel);
|
|
30
|
+
if (!point) {
|
|
31
|
+
throw new ScaleUnavailable(nation, year, band, pointLabel);
|
|
32
|
+
}
|
|
33
|
+
const gross = grossSalary(point.salary, region, scales.hcas, year);
|
|
34
|
+
return Post.fromSalary(gross, nation, year, {
|
|
35
|
+
kind: 'afc',
|
|
36
|
+
band,
|
|
37
|
+
point,
|
|
38
|
+
region,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
availableGrades(nation, year) {
|
|
42
|
+
return getAfcScales(year, nation).bands.map((b) => b.band);
|
|
43
|
+
},
|
|
44
|
+
latestYearFor(gradeId, nation) {
|
|
45
|
+
for (const year of [...AFC_TAX_YEARS].reverse()) {
|
|
46
|
+
const published = getAfcScales(year, nation)
|
|
47
|
+
.bands.some((b) => b.band === gradeId);
|
|
48
|
+
if (published) {
|
|
49
|
+
return year;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.js","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,YAAY,CAAC;AACxC,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAoC/B,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI;QAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI;QAC3C,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAC5B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI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,CAAC;IACd,CAAC;CACF,CAAC"}
|
package/dist/role.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role — a Post's domain identity: which published pay-scale
|
|
3
|
+
* position it represents (band / point / region, or a bare
|
|
4
|
+
* salary). Identity ONLY; never presentation copy (labels,
|
|
5
|
+
* role descriptions, colour) — that lives in the consumer.
|
|
6
|
+
*
|
|
7
|
+
* Resolvers set it and every Post carries one, so a Post is
|
|
8
|
+
* never an anonymous salary that has forgotten what it is.
|
|
9
|
+
*
|
|
10
|
+
* `afc` and `vsm` ship today; `medical` / `dental` variants
|
|
11
|
+
* join when their scales land (Phase 2).
|
|
12
|
+
*/
|
|
13
|
+
import type { AfcBandId, ScalePoint } from './scales.js';
|
|
14
|
+
import type { AfcRegionId } from './regions.js';
|
|
15
|
+
/** An Agenda-for-Change post: a band at a point, in a region. */
|
|
16
|
+
export interface AfcRole {
|
|
17
|
+
readonly kind: 'afc';
|
|
18
|
+
readonly band: AfcBandId;
|
|
19
|
+
readonly point: ScalePoint;
|
|
20
|
+
readonly region: AfcRegionId;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A bare custom salary — an off-scale / very-senior-manager
|
|
24
|
+
* post with no published scale point. Its identity is the
|
|
25
|
+
* salary itself, so it carries no further fields.
|
|
26
|
+
*/
|
|
27
|
+
export interface VsmRole {
|
|
28
|
+
readonly kind: 'vsm';
|
|
29
|
+
}
|
|
30
|
+
export type Role = AfcRole | VsmRole;
|
|
31
|
+
export type RoleKind = Role['kind'];
|
package/dist/role.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role — a Post's domain identity: which published pay-scale
|
|
3
|
+
* position it represents (band / point / region, or a bare
|
|
4
|
+
* salary). Identity ONLY; never presentation copy (labels,
|
|
5
|
+
* role descriptions, colour) — that lives in the consumer.
|
|
6
|
+
*
|
|
7
|
+
* Resolvers set it and every Post carries one, so a Post is
|
|
8
|
+
* never an anonymous salary that has forgotten what it is.
|
|
9
|
+
*
|
|
10
|
+
* `afc` and `vsm` ship today; `medical` / `dental` variants
|
|
11
|
+
* join when their scales land (Phase 2).
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=role.js.map
|
package/dist/role.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role.js","sourceRoot":"","sources":["../src/role.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
package/dist/scales.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* NHS Agenda for Change pay scales by tax year.
|
|
3
3
|
*
|
|
4
4
|
* Pure salary data — no metadata (labels, slugs, role
|
|
5
|
-
* descriptions)
|
|
5
|
+
* descriptions); presentation copy is a hub-site concern.
|
|
6
6
|
*
|
|
7
7
|
* Sources:
|
|
8
8
|
* - https://www.nhsemployers.org/articles/pay-scales-202526
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
* - https://www.healthcareers.nhs.uk/working-health/working-nhs/nhs-pay-and-benefits/agenda-change-pay-rates
|
|
11
11
|
* - NLW: https://www.gov.uk/national-minimum-wage-rates
|
|
12
12
|
* - Wales floor: https://www.nhs.wales/files/pc-resources/2026-afc-1-2026-living-wage-pdf-pdf/
|
|
13
|
-
* - HCAS: NHS
|
|
14
|
-
* - Scotland
|
|
15
|
-
*
|
|
13
|
+
* - HCAS rates: NHS T&Cs Handbook Annex 9 (HCAS supplements)
|
|
14
|
+
* - Scotland (both years): MSG consolidated AfC pay scales
|
|
15
|
+
* https://www.msg.scot.nhs.uk/wp-content/uploads/AfC-Pay-Scales-2025-26-and-2026-27.pdf
|
|
16
|
+
* (2025-26 rates revised by PCS(AFC)2026/1; 2026-27 in its Annex B)
|
|
16
17
|
*/
|
|
17
|
-
import type { TaxYear } from '@casomoltd/paye-calc';
|
|
18
|
+
import type { Nation, TaxYear } from '@casomoltd/paye-calc';
|
|
18
19
|
export declare const AFC_BANDS: {
|
|
19
20
|
readonly B2: "2";
|
|
20
21
|
readonly B3: "3";
|
|
@@ -72,8 +73,11 @@ export declare const WALES_LW_FLOOR: Partial<Record<TaxYear, number>>;
|
|
|
72
73
|
export declare function applyWalesFloor(salary: number, year: TaxYear): number;
|
|
73
74
|
/** Tax years that have AFC scale data. */
|
|
74
75
|
export declare const AFC_TAX_YEARS: TaxYear[];
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
|
|
76
|
+
/** Resolve the published, nation-adjusted scale table for a
|
|
77
|
+
* year — the single place a nation modifies the base scale:
|
|
78
|
+
* Scotland swaps to its own family, Wales floors the
|
|
79
|
+
* England/NI base, England/NI use the base as-is. Throws
|
|
80
|
+
* {@link ScaleUnavailable} for an unpublished year rather
|
|
81
|
+
* than silently substituting another year's figures. */
|
|
82
|
+
export declare function getScalesForYear(year: TaxYear, nation?: Nation): AfcScaleYear;
|
|
79
83
|
export {};
|