@casomoltd/nhs-pay 0.4.15 → 0.6.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 +134 -3
- package/dist/award.d.ts +32 -0
- package/dist/award.js +59 -0
- package/dist/award.js.map +1 -0
- package/dist/bands.d.ts +14 -24
- package/dist/bands.js +18 -138
- package/dist/bands.js.map +1 -1
- package/dist/circulars/england-md-1-2026r.d.ts +257 -0
- package/dist/circulars/england-md-1-2026r.js +302 -0
- package/dist/circulars/england-md-1-2026r.js.map +1 -0
- package/dist/circulars/ni-hsc-tc8-05-2025.d.ts +166 -0
- package/dist/circulars/ni-hsc-tc8-05-2025.js +249 -0
- package/dist/circulars/ni-hsc-tc8-05-2025.js.map +1 -0
- package/dist/circulars/scotland-pcs-dd-2026-01.d.ts +34 -0
- package/dist/circulars/scotland-pcs-dd-2026-01.js +96 -0
- package/dist/circulars/scotland-pcs-dd-2026-01.js.map +1 -0
- package/dist/circulars/wales-mdw-01-2025.d.ts +130 -0
- package/dist/circulars/wales-mdw-01-2025.js +221 -0
- package/dist/circulars/wales-mdw-01-2025.js.map +1 -0
- package/dist/dental-scales.d.ts +44 -0
- package/dist/dental-scales.js +103 -0
- package/dist/dental-scales.js.map +1 -0
- package/dist/errors.d.ts +44 -0
- package/dist/errors.js +71 -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 +16 -4
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/medical-scales.d.ts +64 -0
- package/dist/medical-scales.js +148 -0
- package/dist/medical-scales.js.map +1 -0
- package/dist/pension.d.ts +43 -14
- package/dist/pension.js +138 -30
- 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 +56 -0
- package/dist/resolver.js +116 -0
- package/dist/resolver.js.map +1 -0
- package/dist/role.d.ts +51 -0
- package/dist/role.js +13 -0
- package/dist/role.js.map +1 -0
- package/dist/scale-tables.d.ts +63 -0
- package/dist/scale-tables.js +87 -0
- package/dist/scale-tables.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/format.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GBP and percentage formatting helpers for NHS
|
|
3
|
-
* pay data.
|
|
4
|
-
* across afc-format.ts and calculator format.ts.
|
|
3
|
+
* pay data.
|
|
5
4
|
*/
|
|
6
5
|
// ── Intl formatters (reused across calls) ───────
|
|
7
6
|
const gbpFormat = new Intl.NumberFormat('en-GB', {
|
package/dist/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,mDAAmD;AAEnD,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAC/C,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,KAAK;IACf,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,IAAI,IAAI,CAAC,YAAY,CAC5C,OAAO,EACP;IACE,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,KAAK;IACf,qBA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ANGED
package/dist/hcas-pcts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hcas-pcts.js","sourceRoot":"","sources":["../src/hcas-pcts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,
|
|
1
|
+
{"version":3,"file":"hcas-pcts.js","sourceRoot":"","sources":["../src/hcas-pcts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,0DAA0D;AAE1D,MAAM,iBAAiB,GAAsB;IAC3C,sBAAsB;IACtB,sBAAsB;IACtB,aAAa;IACb,QAAQ;IACR,WAAW;IACX,gBAAgB;IAChB,eAAe;IACf,SAAS;IACT,UAAU;IACV,WAAW;IACX,YAAY;CACb,CAAC;AAEF,MAAM,iBAAiB,GAAsB;IAC3C,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,SAAS;IACT,UAAU;IACV,oBAAoB;IACpB,UAAU;IACV,QAAQ;IACR,WAAW;IACX,iBAAiB;IACjB,QAAQ;IACR,SAAS;IACT,WAAW;IACX,SAAS;IACT,UAAU;IACV,uBAAuB;IACvB,iBAAiB;CAClB,CAAC;AAEF,MAAM,WAAW,GAAsB;IACrC,+BAA+B;IAC/B,UAAU;IACV,kCAAkC;IAClC,gBAAgB;IAChB,QAAQ;IACR,UAAU;IACV,SAAS;IACT,WAAW;IACX,yCAAyC;IACzC,0BAA0B;IAC1B,uBAAuB;IACvB,wBAAwB;IACxB,kBAAkB;IAClB,mBAAmB;IACnB,QAAQ;IACR,6BAA6B;IAC7B,WAAW;IACX,6BAA6B;IAC7B,aAAa;IACb,sBAAsB;IACtB,cAAc;IACd,yBAAyB;CAC1B,CAAC;AAEF,MAAM,SAAS,GAGT;IACJ,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAC;IAC/C,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAC;IAC/C,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAC;CACpC,CAAC;AAEF,mDAAmD;AAEnD,MAAM,SAAS,GACb,IAAI,GAAG,EAAE,CAAC;AAEZ,KAAK,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,IAAI,SAAS,EAAE,CAAC;IACrC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AASD,gDAAgD;AAChD,MAAM,UAAU,WAAW,CACzB,GAAW;IAEX,OAAO,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,IAAI,CAAC;AAClD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,KAAK,MAAM,EAAC,IAAI,EAAE,IAAI,EAAC,IAAI,SAAS,EAAE,CAAC;QACrC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/hcas.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Browser-safe — no node:fs dependency.
|
|
6
6
|
*/
|
|
7
7
|
import type { TaxYear } from '@casomoltd/paye-calc';
|
|
8
|
-
import type { HcasZones } from './scales.js';
|
|
8
|
+
import type { HcasZone, HcasZones } from './scales.js';
|
|
9
9
|
import type { AfcRegionId } from './regions.js';
|
|
10
10
|
export declare const HCAS_ZONE_IDS: {
|
|
11
11
|
readonly INNER_LONDON: "inner-london";
|
|
@@ -19,10 +19,20 @@ export declare function isHcasZoneId(value: string): value is HcasZoneId;
|
|
|
19
19
|
* Calculate HCAS supplement for a base salary.
|
|
20
20
|
* Applies percentage rate clamped between min/max.
|
|
21
21
|
*/
|
|
22
|
-
export declare function calculateHcasSupplement(baseSalary: number, zone:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
export declare function calculateHcasSupplement(baseSalary: number, zone: HcasZone): number;
|
|
23
|
+
/**
|
|
24
|
+
* Produce a region's gross from a base salary: apply the Wales
|
|
25
|
+
* living-wage floor for Welsh regions, then the HCAS supplement
|
|
26
|
+
* for England high-cost zones.
|
|
27
|
+
*
|
|
28
|
+
* The floor is applied here — not only when building the Welsh
|
|
29
|
+
* scale table (`getScalesForYear`) — because callers regionalise
|
|
30
|
+
* an *England* base (e.g. the band pages, which render England
|
|
31
|
+
* scales for every region) and must still floor Welsh low bands.
|
|
32
|
+
* `applyWalesFloor` is idempotent, so a base already read from
|
|
33
|
+
* the floored Welsh table is unaffected. Do NOT drop the floor
|
|
34
|
+
* here: the table alone does not cover the regionalise path, and
|
|
35
|
+
* removing it silently underpays Welsh low bands (see the
|
|
36
|
+
* grossSalary↔table equivalence test).
|
|
37
|
+
*/
|
|
28
38
|
export declare function grossSalary(base: number, region: AfcRegionId, hcas: HcasZones, year: TaxYear): number;
|
package/dist/hcas.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Browser-safe — no node:fs dependency.
|
|
6
6
|
*/
|
|
7
|
-
import { resolveRegion } from './regions.js';
|
|
8
7
|
import { applyWalesFloor } from './scales.js';
|
|
8
|
+
import { resolveRegion } from './regions.js';
|
|
9
9
|
export const HCAS_ZONE_IDS = {
|
|
10
10
|
INNER_LONDON: 'inner-london',
|
|
11
11
|
OUTER_LONDON: 'outer-london',
|
|
@@ -24,16 +24,29 @@ export function calculateHcasSupplement(baseSalary, zone) {
|
|
|
24
24
|
const raw = baseSalary * (zone.rate / 100);
|
|
25
25
|
return Math.round(Math.min(Math.max(raw, zone.min), zone.max));
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Produce a region's gross from a base salary: apply the Wales
|
|
29
|
+
* living-wage floor for Welsh regions, then the HCAS supplement
|
|
30
|
+
* for England high-cost zones.
|
|
31
|
+
*
|
|
32
|
+
* The floor is applied here — not only when building the Welsh
|
|
33
|
+
* scale table (`getScalesForYear`) — because callers regionalise
|
|
34
|
+
* an *England* base (e.g. the band pages, which render England
|
|
35
|
+
* scales for every region) and must still floor Welsh low bands.
|
|
36
|
+
* `applyWalesFloor` is idempotent, so a base already read from
|
|
37
|
+
* the floored Welsh table is unaffected. Do NOT drop the floor
|
|
38
|
+
* here: the table alone does not cover the regionalise path, and
|
|
39
|
+
* removing it silently underpays Welsh low bands (see the
|
|
40
|
+
* grossSalary↔table equivalence test).
|
|
41
|
+
*/
|
|
28
42
|
export function grossSalary(base, region, hcas, year) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
salary += calculateHcasSupplement(salary, hcas[resolved.hcasProp]);
|
|
43
|
+
const { hcasProp, isWales } = resolveRegion(region);
|
|
44
|
+
const floored = isWales
|
|
45
|
+
? applyWalesFloor(base, year)
|
|
46
|
+
: base;
|
|
47
|
+
if (!hcasProp) {
|
|
48
|
+
return floored;
|
|
36
49
|
}
|
|
37
|
-
return
|
|
50
|
+
return floored + calculateHcasSupplement(floored, hcas[hcasProp]);
|
|
38
51
|
}
|
|
39
52
|
//# sourceMappingURL=hcas.js.map
|
package/dist/hcas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hcas.js","sourceRoot":"","sources":["../src/hcas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"hcas.js","sourceRoot":"","sources":["../src/hcas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAC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EAR, AFC_TAX_YEARS, NLW_HOURLY, WALES_LW_FLOOR, annualiseHourly, applyWalesFloor, } from './scales.js';
|
|
2
2
|
export type { AfcBandId, HcasZone, HcasZones, ScalePoint, } from './scales.js';
|
|
3
|
-
export { getEmployerPensionRate, getPensionTiers, lookupPensionTier, pensionTierRate, } from './pension.js';
|
|
3
|
+
export { PensionTiers, getEmployerPensionRate, getPensionTiers, getPensionTiersVO, lookupPensionTier, pensionTierRate, } from './pension.js';
|
|
4
4
|
export type { EmployerPensionRate, PensionTier, } from './pension.js';
|
|
5
|
+
export type { SalaryRange } from './values.js';
|
|
6
|
+
export { Post } from './post.js';
|
|
7
|
+
export type { PostIdentity } from './post.js';
|
|
8
|
+
export type { AfcRole, DentalRole, MedicalRole, Role, RoleKind, VsmRole, } from './role.js';
|
|
9
|
+
export { afcResolver, dentalResolver, medicalResolver } from './resolver.js';
|
|
10
|
+
export type { AfcResolver, DentalResolver, MedicalResolver, NationScaleResolver, PayScaleResolver, } from './resolver.js';
|
|
11
|
+
export { MEDICAL_GRADES, MEDICAL_GRADE_IDS, getMedicalScales, } from './medical-scales.js';
|
|
12
|
+
export type { MedicalGradeId, MedicalGradeMeta, } from './medical-scales.js';
|
|
13
|
+
export { DENTAL_GRADES, DENTAL_GRADE_IDS, getDentalScales, } from './dental-scales.js';
|
|
14
|
+
export type { DentalGradeId, DentalGradeMeta, } from './dental-scales.js';
|
|
15
|
+
export { AwardUnavailable, PensionTiersUnavailable, ScaleUnavailable, } from './errors.js';
|
|
16
|
+
export { afcAward } from './award.js';
|
|
5
17
|
export { ACCRUAL_RATE, COMMUTATION_FACTOR, commute, lookupErf1, lookupLrf1, maxLumpSum, npaDate, periodInYearsMonths, projectPension, retirementFactor, revalue, yearlyAccrual, } from './pension-projection.js';
|
|
6
18
|
export type { CommutationResult, PensionEstimationInput, PensionProjectionInput, PensionProjectionResult, PensionStatementInput, ProjectionPoint, } from './pension-projection.js';
|
|
7
19
|
export { HCAS_ZONE_IDS, calculateHcasSupplement, grossSalary, isHcasZoneId, } from './hcas.js';
|
|
8
20
|
export type { HcasZoneId } from './hcas.js';
|
|
9
21
|
export { getHcasPcts, getHcasZone, } from './hcas-pcts.js';
|
|
10
22
|
export type { HcasPct } from './hcas-pcts.js';
|
|
11
|
-
export { AFC_REGIONS,
|
|
23
|
+
export { AFC_REGIONS, ZONE_TO_REGION, afcRegionToHcasZone, afcRegionToNation, isAfcRegionId, isNation, resolveRegion, } from './regions.js';
|
|
12
24
|
export type { AfcRegionId, ResolvedRegion, } from './regions.js';
|
|
13
|
-
export {
|
|
14
|
-
export type {
|
|
25
|
+
export { AFC_CURRENT_YEAR, AFC_PREVIOUS_YEAR, getAfcScales, } from './bands.js';
|
|
26
|
+
export type { AfcBandMeta, AfcScaleData, } from './bands.js';
|
|
15
27
|
export { nhsTakeHome } from './take-home.js';
|
|
16
28
|
export { fmtMoney, fmtPct, fmtSalary, formatGBP, formatGBPPrecise, formatPct, yearLabel, } from './format.js';
|
|
17
29
|
export { TAX_REGIONS, TAX_YEARS, NATIONS, NATION_KEYS, TakeHomePay, GrossAnnual, PensionBasis, PensionPercent, StudentLoanPlan, nationToTaxRegion, getTaxYearConfig, hoursPerYear, } from '@casomoltd/paye-calc';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
// ── Scales ───────────────────────────────────────
|
|
2
2
|
export { AFC_BANDS, AFC_BAND_IDS, AFC_HOURS_PER_YEAR, AFC_TAX_YEARS, NLW_HOURLY, WALES_LW_FLOOR, annualiseHourly, applyWalesFloor, } from './scales.js';
|
|
3
3
|
// ── Pension ──────────────────────────────────────
|
|
4
|
-
export { getEmployerPensionRate, getPensionTiers, lookupPensionTier, pensionTierRate, } from './pension.js';
|
|
4
|
+
export { PensionTiers, getEmployerPensionRate, getPensionTiers, getPensionTiersVO, lookupPensionTier, pensionTierRate, } from './pension.js';
|
|
5
|
+
// ── Post & resolvers ─────────────────────────────
|
|
6
|
+
export { Post } from './post.js';
|
|
7
|
+
export { afcResolver, dentalResolver, medicalResolver } from './resolver.js';
|
|
8
|
+
// ── Medical & dental scales ──────────────────────
|
|
9
|
+
export { MEDICAL_GRADES, MEDICAL_GRADE_IDS, getMedicalScales, } from './medical-scales.js';
|
|
10
|
+
export { DENTAL_GRADES, DENTAL_GRADE_IDS, getDentalScales, } from './dental-scales.js';
|
|
11
|
+
export { AwardUnavailable, PensionTiersUnavailable, ScaleUnavailable, } from './errors.js';
|
|
12
|
+
// ── AfC pay award ────────────────────────────────
|
|
13
|
+
export { afcAward } from './award.js';
|
|
5
14
|
// ── Pension Projection ─────────────────────────────
|
|
6
15
|
export { ACCRUAL_RATE, COMMUTATION_FACTOR, commute, lookupErf1, lookupLrf1, maxLumpSum, npaDate, periodInYearsMonths, projectPension, retirementFactor, revalue, yearlyAccrual, } from './pension-projection.js';
|
|
7
16
|
// ── HCAS ─────────────────────────────────────────
|
|
@@ -9,9 +18,9 @@ export { HCAS_ZONE_IDS, calculateHcasSupplement, grossSalary, isHcasZoneId, } fr
|
|
|
9
18
|
// ── HCAS PCTs ────────────────────────────────────
|
|
10
19
|
export { getHcasPcts, getHcasZone, } from './hcas-pcts.js';
|
|
11
20
|
// ── Regions ──────────────────────────────────────
|
|
12
|
-
export { AFC_REGIONS,
|
|
21
|
+
export { AFC_REGIONS, ZONE_TO_REGION, afcRegionToHcasZone, afcRegionToNation, isAfcRegionId, isNation, resolveRegion, } from './regions.js';
|
|
13
22
|
// ── Bands ────────────────────────────────────────
|
|
14
|
-
export {
|
|
23
|
+
export { AFC_CURRENT_YEAR, AFC_PREVIOUS_YEAR, getAfcScales, } from './bands.js';
|
|
15
24
|
// ── Take-home ────────────────────────────────────
|
|
16
25
|
export { nhsTakeHome } from './take-home.js';
|
|
17
26
|
// ── Format ───────────────────────────────────────
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAQrB,oDAAoD;AACpD,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,cAAc,EACd,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAC;AAQrB,oDAAoD;AACpD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,cAAc,CAAC;AAStB,oDAAoD;AACpD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAU/B,OAAO,EAAC,WAAW,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAS3E,oDAAoD;AACpD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,oDAAoD;AACpD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,sDAAsD;AACtD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,UAAU,EACV,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,aAAa,GACd,MAAM,yBAAyB,CAAC;AAUjC,oDAAoD;AACpD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,WAAW,EACX,YAAY,GACb,MAAM,WAAW,CAAC;AAGnB,oDAAoD;AACpD,OAAO,EACL,WAAW,EACX,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAGxB,oDAAoD;AACpD,OAAO,EACL,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,QAAQ,EACR,aAAa,GACd,MAAM,cAAc,CAAC;AAMtB,oDAAoD;AACpD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAC;AAMpB,oDAAoD;AACpD,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAE3C,oDAAoD;AACpD,OAAO,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,oDAAoD;AACpD,mDAAmD;AACnD,qDAAqD;AACrD,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Medical (doctors) translation layer.
|
|
3
|
+
*
|
|
4
|
+
* Imports the verbatim circular files (src/circulars/*) and maps their
|
|
5
|
+
* pay tables into the canonical `getMedicalScales(year, nation)` view
|
|
6
|
+
* the resolver reads. This is where the *selection* lives — which
|
|
7
|
+
* scales feed the calculator domain — and the default is inclusive:
|
|
8
|
+
* every substantive salary scale a member could be on is wired,
|
|
9
|
+
* including the devolved training variants and the closed grades.
|
|
10
|
+
*
|
|
11
|
+
* Point granularity: one canonical point per source row, labelled by
|
|
12
|
+
* that row's own step identity (stage / years / pay-scale code /
|
|
13
|
+
* increment), so no pay step is collapsed away.
|
|
14
|
+
*
|
|
15
|
+
* Grades captured in the circulars but not yet wired here (add when a
|
|
16
|
+
* page needs them — they are one mapping line each): England's ultra-
|
|
17
|
+
* legacy closed grades SCMO (KB11), CMO (KB01), pre-2003 consultant
|
|
18
|
+
* (MC21), closed Specialist Registrar (MN25) and closed training
|
|
19
|
+
* variants (MN13/15/21/35/37/39); the second staff-grade scales
|
|
20
|
+
* (England MH03/05, NI M212).
|
|
21
|
+
*/
|
|
22
|
+
import type { Nation, TaxYear } from '@casomoltd/paye-calc';
|
|
23
|
+
import type { GradeMeta } from './scale-tables.js';
|
|
24
|
+
/** Doctor grade identifiers wired into the domain. */
|
|
25
|
+
export declare const MEDICAL_GRADES: {
|
|
26
|
+
readonly resident: "resident";
|
|
27
|
+
readonly consultant: "consultant";
|
|
28
|
+
readonly specialtyDoctor: "specialty-doctor";
|
|
29
|
+
readonly specialist: "specialist";
|
|
30
|
+
readonly salariedGp: "salaried-gp";
|
|
31
|
+
readonly gpEducator: "gp-educator";
|
|
32
|
+
readonly locallyEmployedDoctor: "locally-employed-doctor";
|
|
33
|
+
readonly fho1: "fho1";
|
|
34
|
+
readonly fho2: "fho2";
|
|
35
|
+
readonly sho: "sho";
|
|
36
|
+
readonly spr: "spr";
|
|
37
|
+
readonly str: "str";
|
|
38
|
+
readonly specialtyRegistrarCore: "specialty-registrar-core";
|
|
39
|
+
readonly specialtyRegistrarFixed: "specialty-registrar-fixed";
|
|
40
|
+
readonly gpRegistrarSho: "gp-registrar-sho";
|
|
41
|
+
readonly gpRegistrarSpr: "gp-registrar-spr";
|
|
42
|
+
readonly gpRegistrarStr: "gp-registrar-str";
|
|
43
|
+
readonly staffGrade: "staff-grade";
|
|
44
|
+
readonly associateSpecialist: "associate-specialist";
|
|
45
|
+
readonly specialtyDoctor2008: "specialty-doctor-2008";
|
|
46
|
+
readonly associateSpecialist2008: "associate-specialist-2008";
|
|
47
|
+
readonly hospitalPractitioner: "hospital-practitioner";
|
|
48
|
+
};
|
|
49
|
+
export type MedicalGradeId = (typeof MEDICAL_GRADES)[keyof typeof MEDICAL_GRADES];
|
|
50
|
+
/** Ordered grade IDs — stable iteration/enumeration. */
|
|
51
|
+
export declare const MEDICAL_GRADE_IDS: MedicalGradeId[];
|
|
52
|
+
/** A doctor grade's scale points in a nation/year, with its range. */
|
|
53
|
+
export type MedicalGradeMeta = GradeMeta<MedicalGradeId>;
|
|
54
|
+
/**
|
|
55
|
+
* Tax years this family publishes, newest first — derived from the
|
|
56
|
+
* data so a new pay round can't leave a hand-maintained list stale.
|
|
57
|
+
*/
|
|
58
|
+
export declare const MEDICAL_TAX_YEARS: readonly TaxYear[];
|
|
59
|
+
/**
|
|
60
|
+
* Published doctor grades for a nation and tax year, each with its
|
|
61
|
+
* scale points and salary range. Both args required — no default;
|
|
62
|
+
* an absent grade set throws `ScaleUnavailable`.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getMedicalScales(year: TaxYear, nation: Nation): MedicalGradeMeta[];
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Medical (doctors) translation layer.
|
|
3
|
+
*
|
|
4
|
+
* Imports the verbatim circular files (src/circulars/*) and maps their
|
|
5
|
+
* pay tables into the canonical `getMedicalScales(year, nation)` view
|
|
6
|
+
* the resolver reads. This is where the *selection* lives — which
|
|
7
|
+
* scales feed the calculator domain — and the default is inclusive:
|
|
8
|
+
* every substantive salary scale a member could be on is wired,
|
|
9
|
+
* including the devolved training variants and the closed grades.
|
|
10
|
+
*
|
|
11
|
+
* Point granularity: one canonical point per source row, labelled by
|
|
12
|
+
* that row's own step identity (stage / years / pay-scale code /
|
|
13
|
+
* increment), so no pay step is collapsed away.
|
|
14
|
+
*
|
|
15
|
+
* Grades captured in the circulars but not yet wired here (add when a
|
|
16
|
+
* page needs them — they are one mapping line each): England's ultra-
|
|
17
|
+
* legacy closed grades SCMO (KB11), CMO (KB01), pre-2003 consultant
|
|
18
|
+
* (MC21), closed Specialist Registrar (MN25) and closed training
|
|
19
|
+
* variants (MN13/15/21/35/37/39); the second staff-grade scales
|
|
20
|
+
* (England MH03/05, NI M212).
|
|
21
|
+
*/
|
|
22
|
+
import { NATION_KEYS, TAX_YEARS } from '@casomoltd/paye-calc';
|
|
23
|
+
import { byCode, byStage, numbered, range, resolveGradeMetas, scaleSalaries, stepped, } from './scale-tables.js';
|
|
24
|
+
import { ENGLAND_MD_1_2026R as ENG } from './circulars/england-md-1-2026r.js';
|
|
25
|
+
import { SCOTLAND_PCS_DD_2026_01 as SCO } from './circulars/scotland-pcs-dd-2026-01.js';
|
|
26
|
+
import { WALES_MDW_01_2025 as WAL } from './circulars/wales-mdw-01-2025.js';
|
|
27
|
+
import { NI_HSC_TC8_05_2025 as NI } from './circulars/ni-hsc-tc8-05-2025.js';
|
|
28
|
+
/** Doctor grade identifiers wired into the domain. */
|
|
29
|
+
export const MEDICAL_GRADES = {
|
|
30
|
+
resident: 'resident',
|
|
31
|
+
consultant: 'consultant',
|
|
32
|
+
specialtyDoctor: 'specialty-doctor',
|
|
33
|
+
specialist: 'specialist',
|
|
34
|
+
salariedGp: 'salaried-gp',
|
|
35
|
+
gpEducator: 'gp-educator',
|
|
36
|
+
locallyEmployedDoctor: 'locally-employed-doctor',
|
|
37
|
+
fho1: 'fho1',
|
|
38
|
+
fho2: 'fho2',
|
|
39
|
+
sho: 'sho',
|
|
40
|
+
spr: 'spr',
|
|
41
|
+
str: 'str',
|
|
42
|
+
specialtyRegistrarCore: 'specialty-registrar-core',
|
|
43
|
+
specialtyRegistrarFixed: 'specialty-registrar-fixed',
|
|
44
|
+
gpRegistrarSho: 'gp-registrar-sho',
|
|
45
|
+
gpRegistrarSpr: 'gp-registrar-spr',
|
|
46
|
+
gpRegistrarStr: 'gp-registrar-str',
|
|
47
|
+
staffGrade: 'staff-grade',
|
|
48
|
+
associateSpecialist: 'associate-specialist',
|
|
49
|
+
specialtyDoctor2008: 'specialty-doctor-2008',
|
|
50
|
+
associateSpecialist2008: 'associate-specialist-2008',
|
|
51
|
+
hospitalPractitioner: 'hospital-practitioner',
|
|
52
|
+
};
|
|
53
|
+
/** Ordered grade IDs — stable iteration/enumeration. */
|
|
54
|
+
export const MEDICAL_GRADE_IDS = Object.values(MEDICAL_GRADES);
|
|
55
|
+
// ── Mapping helpers ─────────────────────────────
|
|
56
|
+
/** Consultant year-point rows → points labelled "Threshold X · Ny". */
|
|
57
|
+
const consultantByYear = (rows) => rows.map((r) => ({
|
|
58
|
+
label: `Threshold ${r.threshold} · ${r.yearCompleted}y`,
|
|
59
|
+
salary: r.salary,
|
|
60
|
+
}));
|
|
61
|
+
const england = {
|
|
62
|
+
resident: byStage(ENG.doctorsInTraining),
|
|
63
|
+
consultant: consultantByYear(ENG.consultant),
|
|
64
|
+
'specialty-doctor': byCode(ENG.specialtyDoctor),
|
|
65
|
+
specialist: byCode(ENG.specialist),
|
|
66
|
+
'salaried-gp': range(ENG.salariedGpRange),
|
|
67
|
+
'gp-educator': byCode(ENG.gpEducators),
|
|
68
|
+
'locally-employed-doctor': byCode(ENG.locallyEmployedDoctors),
|
|
69
|
+
'staff-grade': stepped(scaleSalaries(ENG.closedGrades, (g) => g.code === 'MH01', 'MH01')),
|
|
70
|
+
'associate-specialist': stepped(scaleSalaries(ENG.closedGrades, (g) => g.code === 'MC01', 'MC01')),
|
|
71
|
+
'specialty-doctor-2008': byCode(ENG.specialtyDoctor2008),
|
|
72
|
+
'associate-specialist-2008': byCode(ENG.associateSpecialist2008),
|
|
73
|
+
};
|
|
74
|
+
const scotland = {
|
|
75
|
+
fho1: stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'Foundation House Officer 1', 'Sco FHO1')),
|
|
76
|
+
fho2: stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'Foundation House Officer 2', 'Sco FHO2')),
|
|
77
|
+
sho: stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade.startsWith('Senior House Officer'), 'Sco SHO')),
|
|
78
|
+
spr: stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'Specialist Registrar', 'Sco SpR')),
|
|
79
|
+
str: stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'Specialty Registrar (Full)', 'Sco StR')),
|
|
80
|
+
'specialty-registrar-core': stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'Specialty Registrar (Core Training)', 'Sco StR core')),
|
|
81
|
+
'specialty-registrar-fixed': stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'Specialty Registrar (Fixed Term)', 'Sco StR fixed')),
|
|
82
|
+
'gp-registrar-sho': stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'GP Specialty Registrar (SHO)', 'Sco GP SHO')),
|
|
83
|
+
'gp-registrar-spr': stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'GP Specialty Registrar (SpR)', 'Sco GP SpR')),
|
|
84
|
+
'gp-registrar-str': stepped(scaleSalaries(SCO.trainingGrades, (g) => g.grade === 'GP Specialty Registrar (StR)', 'Sco GP StR')),
|
|
85
|
+
};
|
|
86
|
+
const wales = {
|
|
87
|
+
consultant: consultantByYear(WAL.consultant),
|
|
88
|
+
str: stepped(scaleSalaries(WAL.trainingGrades, (g) => g.code === 'MN37', 'Wal MN37')),
|
|
89
|
+
'specialty-registrar-core': stepped(scaleSalaries(WAL.trainingGrades, (g) => g.code === 'MN39', 'Wal MN39')),
|
|
90
|
+
'specialty-registrar-fixed': stepped(scaleSalaries(WAL.trainingGrades, (g) => g.code === 'MN35', 'Wal MN35')),
|
|
91
|
+
fho1: stepped(scaleSalaries(WAL.trainingGrades, (g) => g.code === 'MN13', 'Wal MN13')),
|
|
92
|
+
fho2: stepped(scaleSalaries(WAL.trainingGrades, (g) => g.code === 'MN15', 'Wal MN15')),
|
|
93
|
+
'specialty-doctor': byCode(WAL.specialtyDoctor),
|
|
94
|
+
specialist: byCode(WAL.specialist),
|
|
95
|
+
'salaried-gp': stepped(WAL.salariedGp.salaries),
|
|
96
|
+
'staff-grade': stepped(scaleSalaries(WAL.closedGrades, (g) => g.code === 'MH01', 'Wal MH01')),
|
|
97
|
+
'associate-specialist': stepped(scaleSalaries(WAL.closedGrades, (g) => g.code === 'MC01', 'Wal MC01')),
|
|
98
|
+
'specialty-doctor-2008': byCode(WAL.specialtyDoctor2008),
|
|
99
|
+
'associate-specialist-2008': byCode(WAL.associateSpecialist2008),
|
|
100
|
+
'hospital-practitioner': stepped(scaleSalaries(WAL.closedGrades, (g) => g.code === 'MD01-41', 'Wal HP')),
|
|
101
|
+
};
|
|
102
|
+
const northernIreland = {
|
|
103
|
+
fho1: stepped(scaleSalaries(NI.residentGrades, (g) => g.code === 'M220', 'NI M220')),
|
|
104
|
+
fho2: stepped(scaleSalaries(NI.residentGrades, (g) => g.code === 'M230', 'NI M230')),
|
|
105
|
+
str: stepped(scaleSalaries(NI.residentGrades, (g) => g.code === 'M241', 'NI M241')),
|
|
106
|
+
'specialty-registrar-fixed': stepped(scaleSalaries(NI.residentGrades, (g) => g.code === 'M240', 'NI M240')),
|
|
107
|
+
'specialty-registrar-core': stepped(scaleSalaries(NI.residentGrades, (g) => g.code === 'M242', 'NI M242')),
|
|
108
|
+
'specialty-doctor': NI.specialtyDoctor.map((r) => ({
|
|
109
|
+
label: `${r.yearsExperience}y (pt ${r.payPoint})`, salary: r.salary,
|
|
110
|
+
})),
|
|
111
|
+
specialist: NI.specialist.map((r) => ({
|
|
112
|
+
label: `${r.yearsExperience}y (pt ${r.payPoint})`, salary: r.salary,
|
|
113
|
+
})),
|
|
114
|
+
consultant: NI.consultant.map((r) => ({
|
|
115
|
+
label: `Threshold ${r.threshold} · pt ${r.payPoint}`, salary: r.salary,
|
|
116
|
+
})),
|
|
117
|
+
'salaried-gp': range(NI.salariedGpRange),
|
|
118
|
+
'gp-educator': NI.gpEducators.map((r) => ({ label: r.point, salary: r.salary })),
|
|
119
|
+
'hospital-practitioner': numbered(NI.hospitalPractitioner),
|
|
120
|
+
'specialty-doctor-2008': byCode(NI.specialtyDoctor2008),
|
|
121
|
+
'associate-specialist-2008': byCode(NI.associateSpecialist2008),
|
|
122
|
+
'associate-specialist': stepped(scaleSalaries(NI.closedGrades, (g) => g.code === 'M080', 'NI M080')),
|
|
123
|
+
'staff-grade': stepped(scaleSalaries(NI.closedGrades, (g) => g.code === 'M211', 'NI M211')),
|
|
124
|
+
};
|
|
125
|
+
const MEDICAL_SCALES = {
|
|
126
|
+
[TAX_YEARS.Y2026_27]: {
|
|
127
|
+
[NATION_KEYS.england]: england,
|
|
128
|
+
[NATION_KEYS.scotland]: scotland,
|
|
129
|
+
},
|
|
130
|
+
[TAX_YEARS.Y2025_26]: {
|
|
131
|
+
[NATION_KEYS.wales]: wales,
|
|
132
|
+
[NATION_KEYS.northernIreland]: northernIreland,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Tax years this family publishes, newest first — derived from the
|
|
137
|
+
* data so a new pay round can't leave a hand-maintained list stale.
|
|
138
|
+
*/
|
|
139
|
+
export const MEDICAL_TAX_YEARS = Object.keys(MEDICAL_SCALES).sort().reverse();
|
|
140
|
+
/**
|
|
141
|
+
* Published doctor grades for a nation and tax year, each with its
|
|
142
|
+
* scale points and salary range. Both args required — no default;
|
|
143
|
+
* an absent grade set throws `ScaleUnavailable`.
|
|
144
|
+
*/
|
|
145
|
+
export function getMedicalScales(year, nation) {
|
|
146
|
+
return resolveGradeMetas(MEDICAL_SCALES, MEDICAL_GRADE_IDS, year, nation);
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=medical-scales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"medical-scales.js","sourceRoot":"","sources":["../src/medical-scales.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EACL,MAAM,EACN,OAAO,EACP,QAA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AI,KAAK,MAAM,EAAE,SAAS,CAAC,CAAC;IACpG,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE,SAAS,CAAC,CAAC;CAC5F,CAAC;AAEF,MAAM,cAAc,GAAqC;IACvD,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;QACpB,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO;QAC9B,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ;KACjC;IACD,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;QACpB,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,KAAK;QAC1B,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,eAAe;KAC/C;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAC5B,MAAM,CAAC,IAAI,CAAC,cAAc,CAC3B,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAEnB;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAa,EACb,MAAc;IAEd,OAAO,iBAAiB,CACtB,cAAc,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,CAChD,CAAC;AACJ,CAAC"}
|
package/dist/pension.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NHS pension tier types,
|
|
3
|
-
*
|
|
2
|
+
* NHS pension contributions: member tier types, the
|
|
3
|
+
* `PensionTiers` lookup value object, the per-scheme member
|
|
4
|
+
* tier tables (NHSBSA for England & Wales, SPPA for Scotland,
|
|
5
|
+
* HSC for Northern Ireland), and the per-nation employer
|
|
6
|
+
* contribution rates.
|
|
4
7
|
*
|
|
5
|
-
*
|
|
8
|
+
* Member-tier sources are cited per table below and pinned in
|
|
9
|
+
* tests/fixtures/pension-tiers.csv; employer rates carry their
|
|
10
|
+
* own `EmployerPensionRate.source` per nation.
|
|
6
11
|
*/
|
|
7
12
|
import type { Nation, TaxYear } from '@casomoltd/paye-calc';
|
|
8
|
-
|
|
13
|
+
import type { SalaryRange } from './values.js';
|
|
14
|
+
export interface PensionTier extends SalaryRange {
|
|
9
15
|
tier: number;
|
|
10
|
-
min: number;
|
|
11
|
-
/** Infinity for the top tier */
|
|
12
|
-
max: number;
|
|
13
16
|
rate: number;
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
@@ -39,6 +42,26 @@ export interface EmployerPensionRate {
|
|
|
39
42
|
}
|
|
40
43
|
/** Employer pension contribution for a nation's NHS scheme. */
|
|
41
44
|
export declare function getEmployerPensionRate(nation: Nation): EmployerPensionRate;
|
|
45
|
+
/**
|
|
46
|
+
* A member's pension contribution tier table, owning the
|
|
47
|
+
* salary → tier / rate lookup. Wrap a tax year's tiers
|
|
48
|
+
* (see {@link getPensionTiersVO}) and query it directly,
|
|
49
|
+
* rather than re-scanning the array at each call site.
|
|
50
|
+
*/
|
|
51
|
+
export declare class PensionTiers {
|
|
52
|
+
private readonly tiers;
|
|
53
|
+
constructor(tiers: readonly PensionTier[]);
|
|
54
|
+
/** Contribution rate (%) for a salary; 0 if unbanded. */
|
|
55
|
+
rateFor(salary: number): number;
|
|
56
|
+
/**
|
|
57
|
+
* Matching tier (1-based) and band for a salary, or
|
|
58
|
+
* null when no band contains it.
|
|
59
|
+
*/
|
|
60
|
+
tierFor(salary: number): {
|
|
61
|
+
tier: number;
|
|
62
|
+
band: PensionTier;
|
|
63
|
+
} | null;
|
|
64
|
+
}
|
|
42
65
|
/**
|
|
43
66
|
* Pension contribution rate (%) for a salary.
|
|
44
67
|
*/
|
|
@@ -53,12 +76,18 @@ export declare function lookupPensionTier(salary: number, tiers: PensionTier[]):
|
|
|
53
76
|
band: PensionTier;
|
|
54
77
|
} | null;
|
|
55
78
|
/**
|
|
56
|
-
*
|
|
79
|
+
* Member pension contribution tiers for a nation and tax year.
|
|
57
80
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
81
|
+
* The three schemes (NHSBSA for England & Wales, SPPA for Scotland,
|
|
82
|
+
* HSC for Northern Ireland) publish independent tier tables — their
|
|
83
|
+
* thresholds AND rates differ — so the nation is required; there is
|
|
84
|
+
* no UK-wide default. Throws {@link PensionTiersUnavailable} for an
|
|
85
|
+
* unpublished combination rather than substituting another scheme's
|
|
86
|
+
* or year's figures.
|
|
87
|
+
*/
|
|
88
|
+
export declare function getPensionTiers(year: TaxYear, nation: Nation): PensionTier[];
|
|
89
|
+
/**
|
|
90
|
+
* {@link PensionTiers} value object for a nation and tax year —
|
|
91
|
+
* the same data as {@link getPensionTiers}, ready to query.
|
|
63
92
|
*/
|
|
64
|
-
export declare function
|
|
93
|
+
export declare function getPensionTiersVO(year: TaxYear, nation: Nation): PensionTiers;
|