@casomoltd/nhs-pay 0.32.0 → 0.34.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 +24 -22
- package/dist/afc-band.d.ts +4 -4
- package/dist/afc-band.js +4 -4
- package/dist/afc-scales.d.ts +89 -60
- package/dist/afc-scales.js +166 -182
- package/dist/afc-scales.js.map +1 -1
- package/dist/allowances.js +11 -11
- package/dist/allowances.js.map +1 -1
- package/dist/award.d.ts +3 -3
- package/dist/award.js +21 -21
- package/dist/award.js.map +1 -1
- package/dist/circulars/afc-shapes.d.ts +41 -21
- package/dist/circulars/afc-shapes.js +9 -8
- package/dist/circulars/afc-shapes.js.map +1 -1
- package/dist/circulars/england-md-1-2026-r2.d.ts +13 -0
- package/dist/circulars/england-md-1-2026-r2.js +13 -0
- package/dist/circulars/england-md-1-2026-r2.js.map +1 -1
- package/dist/circulars/ni-hsc-afc-06-2025.d.ts +3 -2
- package/dist/circulars/ni-hsc-afc-06-2025.js +3 -2
- package/dist/circulars/ni-hsc-afc-06-2025.js.map +1 -1
- package/dist/circulars/ni-hsc-tc8-05-2025.d.ts +22 -0
- package/dist/circulars/ni-hsc-tc8-05-2025.js +22 -0
- package/dist/circulars/ni-hsc-tc8-05-2025.js.map +1 -1
- package/dist/circulars/scotland-pcs-dd-2025-01.d.ts +20 -0
- package/dist/circulars/scotland-pcs-dd-2025-01.js +20 -0
- package/dist/circulars/scotland-pcs-dd-2025-01.js.map +1 -1
- package/dist/circulars/scotland-pcs-dd-2026-01.d.ts +19 -0
- package/dist/circulars/scotland-pcs-dd-2026-01.js +30 -10
- package/dist/circulars/scotland-pcs-dd-2026-01.js.map +1 -1
- package/dist/circulars/scotland-pcs-dd-2026-02.d.ts +10 -0
- package/dist/circulars/scotland-pcs-dd-2026-02.js +10 -0
- package/dist/circulars/scotland-pcs-dd-2026-02.js.map +1 -1
- package/dist/circulars/wales-mdw-01-2025.d.ts +17 -0
- package/dist/circulars/wales-mdw-01-2025.js +17 -0
- package/dist/circulars/wales-mdw-01-2025.js.map +1 -1
- package/dist/circulars/wales-mdw-01-2026.d.ts +20 -0
- package/dist/circulars/wales-mdw-01-2026.js +20 -0
- package/dist/circulars/wales-mdw-01-2026.js.map +1 -1
- package/dist/commutation.js +3 -2
- package/dist/commutation.js.map +1 -1
- package/dist/dental-grades.d.ts +25 -0
- package/dist/dental-grades.js +25 -0
- package/dist/dental-grades.js.map +1 -0
- package/dist/dental-scales.d.ts +5 -21
- package/dist/dental-scales.js +73 -72
- package/dist/dental-scales.js.map +1 -1
- package/dist/format.js +3 -2
- package/dist/format.js.map +1 -1
- package/dist/hcas-pcts.d.ts +1 -1
- package/dist/hcas-pcts.js +1 -1
- package/dist/hcas-pcts.js.map +1 -1
- package/dist/hcas-zone.d.ts +23 -0
- package/dist/hcas-zone.js +17 -0
- package/dist/hcas-zone.js.map +1 -0
- package/dist/hcas.d.ts +26 -18
- package/dist/hcas.js +45 -24
- package/dist/hcas.js.map +1 -1
- package/dist/index.d.ts +25 -16
- package/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/dist/medical-grades.d.ts +33 -0
- package/dist/medical-grades.js +33 -0
- package/dist/medical-grades.js.map +1 -0
- package/dist/medical-scales.d.ts +10 -33
- package/dist/medical-scales.js +104 -158
- package/dist/medical-scales.js.map +1 -1
- package/dist/member/input-period.d.ts +18 -5
- package/dist/member/input-period.js +24 -13
- package/dist/member/input-period.js.map +1 -1
- package/dist/pay-round.js +3 -3
- package/dist/pay-round.js.map +1 -1
- package/dist/pay-year.d.ts +17 -0
- package/dist/pay-year.js +20 -0
- package/dist/pay-year.js.map +1 -0
- package/dist/pension/ledger.d.ts +7 -0
- package/dist/pension/ledger.js +18 -11
- package/dist/pension/ledger.js.map +1 -1
- package/dist/pension.js +2 -1
- package/dist/pension.js.map +1 -1
- package/dist/post.d.ts +20 -21
- package/dist/post.js +54 -53
- package/dist/post.js.map +1 -1
- package/dist/published/england-afc.d.ts +72 -0
- package/dist/published/england-afc.js +86 -0
- package/dist/published/england-afc.js.map +1 -0
- package/dist/published/hcas-zones.d.ts +18 -0
- package/dist/published/hcas-zones.js +46 -0
- package/dist/published/hcas-zones.js.map +1 -0
- package/dist/published/wales-living-wage.d.ts +36 -0
- package/dist/published/wales-living-wage.js +30 -0
- package/dist/published/wales-living-wage.js.map +1 -0
- package/dist/regions.d.ts +25 -14
- package/dist/regions.js +61 -71
- package/dist/regions.js.map +1 -1
- package/dist/resolver.d.ts +46 -41
- package/dist/resolver.js +70 -142
- package/dist/resolver.js.map +1 -1
- package/dist/role.d.ts +3 -3
- package/dist/scale-point.d.ts +11 -7
- package/dist/scale-point.js +29 -1
- package/dist/scale-point.js.map +1 -1
- package/dist/scale-tables.d.ts +42 -60
- package/dist/scale-tables.js +65 -105
- package/dist/scale-tables.js.map +1 -1
- package/dist/scale-translators.d.ts +90 -0
- package/dist/scale-translators.js +97 -0
- package/dist/scale-translators.js.map +1 -0
- package/dist/scales.d.ts +164 -102
- package/dist/scales.js +242 -462
- package/dist/scales.js.map +1 -1
- package/dist/sources.d.ts +8 -12
- package/dist/sources.js +9 -15
- package/dist/sources.js.map +1 -1
- package/dist/take-home.js +1 -2
- package/dist/take-home.js.map +1 -1
- package/dist/values.d.ts +10 -3
- package/dist/values.js +11 -4
- package/dist/values.js.map +1 -1
- package/dist/working-week.d.ts +23 -8
- package/dist/working-week.js +55 -25
- package/dist/working-week.js.map +1 -1
- package/package.json +3 -3
- package/dist/bands.d.ts +0 -63
- package/dist/bands.js +0 -78
- package/dist/bands.js.map +0 -1
package/dist/dental-scales.js
CHANGED
|
@@ -11,121 +11,122 @@
|
|
|
11
11
|
*
|
|
12
12
|
* One canonical point per source row; no pay step collapsed.
|
|
13
13
|
*/
|
|
14
|
-
import { NATION_KEYS,
|
|
14
|
+
import { NATION_KEYS, YEAR_LABELS } from '@casomoltd/paye-calc';
|
|
15
15
|
import { 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';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { combineScales, fromDocument, gradeFamily, } from './scale-tables.js';
|
|
17
|
+
import { byCode, byStage, bySpine, numbered, salariesOfCode, scaleSalaries, stepped, } from './scale-translators.js';
|
|
18
|
+
import { invariant } from './errors.js';
|
|
19
|
+
import { DENTAL_GRADE_IDS } from './dental-grades.js';
|
|
20
|
+
import { ENGLAND_MD_1_2026_R2 as ENG, ENGLAND_MD_1_2026_R2_CODES as ENG_CODES, } from './circulars/england-md-1-2026-r2.js';
|
|
18
21
|
import { SCOTLAND_PCS_DD_2026_01 as SCO } from './circulars/scotland-pcs-dd-2026-01.js';
|
|
19
22
|
import { SCOTLAND_PCS_DD_2025_01 as SCO25 } from './circulars/scotland-pcs-dd-2025-01.js';
|
|
20
23
|
import { SCOTLAND_PCS_DD_2026_02 as SCO2 } from './circulars/scotland-pcs-dd-2026-02.js';
|
|
21
|
-
import { WALES_MDW_01_2025 as WAL } from './circulars/wales-mdw-01-2025.js';
|
|
22
|
-
import { WALES_MDW_01_2026 as WAL26 } from './circulars/wales-mdw-01-2026.js';
|
|
23
|
-
import { NI_HSC_TC8_05_2025 as NI } from './circulars/ni-hsc-tc8-05-2025.js';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
salariedDental: 'salaried-dental',
|
|
27
|
-
dentalCoreTraining: 'dental-core-training',
|
|
28
|
-
dentalSpecialtyTraining: 'dental-specialty-training',
|
|
29
|
-
dentalEducator: 'dental-educator',
|
|
30
|
-
salariedDentist: 'salaried-dentist',
|
|
31
|
-
seniorSalariedDentist: 'senior-salaried-dentist',
|
|
32
|
-
assistantClinicalDirectorDentist: 'assistant-clinical-director-dentist',
|
|
33
|
-
clinicalDirectorDentist: 'clinical-director-dentist',
|
|
34
|
-
communityDentalOfficer: 'community-dental-officer',
|
|
35
|
-
seniorCommunityDentalOfficer: 'senior-community-dental-officer',
|
|
36
|
-
assistantCommunityDentalClinicalDirector: 'assistant-community-dental-clinical-director',
|
|
37
|
-
specialistCommunityDentist: 'specialist-community-dentist',
|
|
38
|
-
communityDentalClinicalDirector: 'community-dental-clinical-director',
|
|
39
|
-
};
|
|
40
|
-
/** Ordered grade IDs — stable iteration/enumeration. */
|
|
41
|
-
export const DENTAL_GRADE_IDS = Object.values(DENTAL_GRADES);
|
|
42
|
-
// England §1 dentists in training: CT1-3 = core, ST1-8 = specialty.
|
|
24
|
+
import { WALES_MDW_01_2025 as WAL, WALES_MDW_01_2025_CODES as WAL_CODES, } from './circulars/wales-mdw-01-2025.js';
|
|
25
|
+
import { WALES_MDW_01_2026 as WAL26, WALES_MDW_01_2026_CODES as WAL26_CODES, } from './circulars/wales-mdw-01-2026.js';
|
|
26
|
+
import { NI_HSC_TC8_05_2025 as NI, NI_HSC_TC8_05_2025_CODES as NI_CODES, } from './circulars/ni-hsc-tc8-05-2025.js';
|
|
27
|
+
// England §1 dentists in training: CT1-3 = core, ST1-8 = specialty, told
|
|
28
|
+
// apart by the stage each row prints.
|
|
43
29
|
const engDentists = ENG.dentistsInTraining;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
/** The printed stage prefixes of the two kinds of dental training row. */
|
|
31
|
+
const TRAINING_STAGE = { core: 'CT', specialty: 'ST' };
|
|
32
|
+
const trainingRows = (prefix) => engDentists.filter((r) => r.stage.startsWith(prefix));
|
|
33
|
+
/** The bands Northern Ireland's salaried dental table numbers. */
|
|
34
|
+
const NI_DENTAL_BANDS = {
|
|
35
|
+
salaried: 1, senior: 2, assistantDirector: 3, clinicalDirector: 4,
|
|
36
|
+
};
|
|
37
|
+
/** The bands England's salaried dental spine is printed in. */
|
|
38
|
+
const SPINE_BANDS = { a: 'A', b: 'B', c: 'C' };
|
|
47
39
|
const LD_BAND = {
|
|
48
|
-
|
|
40
|
+
[ENG_CODES.salariedDentalBandA]: SPINE_BANDS.a,
|
|
41
|
+
[ENG_CODES.salariedDentalBandB]: SPINE_BANDS.b,
|
|
42
|
+
[ENG_CODES.salariedDentalBandC]: SPINE_BANDS.c,
|
|
49
43
|
};
|
|
44
|
+
const isSpineCode = (code) => Object.hasOwn(LD_BAND, code);
|
|
50
45
|
const ldBand = (code) => {
|
|
51
|
-
|
|
52
|
-
if (!band) {
|
|
46
|
+
if (!isSpineCode(code)) {
|
|
53
47
|
throw new Error(`dental-scales: unknown spine code "${code}"`);
|
|
54
48
|
}
|
|
55
|
-
return
|
|
49
|
+
return LD_BAND[code];
|
|
56
50
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
// Every training row is core or specialty training by its printed stage,
|
|
52
|
+
// so a row with another stage fails at load rather than going unread.
|
|
53
|
+
invariant(engDentists.every((r) => Object.values(TRAINING_STAGE)
|
|
54
|
+
.some((prefix) => r.stage.startsWith(prefix))), 'dental-scales: a dentists-in-training stage is neither core nor specialty');
|
|
55
|
+
// Both ways: every row's code is a band (`ldBand`), and every band's code
|
|
56
|
+
// is printed on some row, so a code the circular drops fails at load.
|
|
57
|
+
for (const code of Object.keys(LD_BAND)) {
|
|
58
|
+
invariant(ENG.salariedDentalSpine.some((r) => r.code === code), `dental-scales: England's dental spine prints no ${code} row`);
|
|
59
|
+
}
|
|
60
|
+
const england2026 = fromDocument(PC_MD_1_2026_R2, {
|
|
61
|
+
'salaried-dental': bySpine(ENG.salariedDentalSpine.map((r) => ({
|
|
62
|
+
band: ldBand(r.code), point: r.point, salary: r.salary,
|
|
63
|
+
}))),
|
|
64
|
+
'dental-core-training': byStage(trainingRows(TRAINING_STAGE.core)),
|
|
65
|
+
'dental-specialty-training': byStage(trainingRows(TRAINING_STAGE.specialty)),
|
|
64
66
|
'dental-educator': byCode(ENG.dentalEducators),
|
|
65
67
|
});
|
|
66
68
|
// The Public Dental Service spine comes from PCS(DD)2026/02 Annex G,
|
|
67
69
|
// uplifted 3.75% (its para 3) rather than the 3.5% the rest of that
|
|
68
70
|
// circular carries; dental core training from PCS(DD)2026/01.
|
|
69
|
-
const
|
|
71
|
+
const scotland2026 = combineScales(fromDocument(PCS_DD_2026_02, {
|
|
70
72
|
'salaried-dental': bySpine(SCO2.salariedDentalSpine),
|
|
71
73
|
}), fromDocument(PCS_DD_2026_01, {
|
|
72
|
-
'dental-core-training': [
|
|
73
|
-
{
|
|
74
|
-
label: SCO.dentalCoreTraining.stage,
|
|
75
|
-
salary: SCO.dentalCoreTraining.salary,
|
|
76
|
-
},
|
|
77
|
-
],
|
|
74
|
+
'dental-core-training': byStage([SCO.dentalCoreTraining]),
|
|
78
75
|
}));
|
|
79
|
-
const
|
|
76
|
+
const wales2025 = fromDocument(MD_W_01_2025, {
|
|
80
77
|
'salaried-dental': bySpine(WAL.salariedDentalSpine),
|
|
81
|
-
'dental-core-training': stepped(
|
|
78
|
+
'dental-core-training': stepped(salariesOfCode(WAL.trainingGrades, WAL_CODES.dentalCoreTraining)),
|
|
82
79
|
});
|
|
83
|
-
const
|
|
84
|
-
'salaried-dentist':
|
|
85
|
-
'senior-salaried-dentist':
|
|
86
|
-
'assistant-clinical-director-dentist':
|
|
87
|
-
'clinical-director-dentist':
|
|
88
|
-
'dental-core-training': stepped(
|
|
89
|
-
'community-dental-officer': numbered(
|
|
90
|
-
'senior-community-dental-officer': numbered(
|
|
91
|
-
'assistant-community-dental-clinical-director': numbered(
|
|
92
|
-
'specialist-community-dentist': numbered(
|
|
93
|
-
'community-dental-clinical-director': numbered(
|
|
80
|
+
const northernIreland2025 = fromDocument(HSC_TC8_05_2025, {
|
|
81
|
+
'salaried-dentist': niDentalBand(NI_DENTAL_BANDS.salaried),
|
|
82
|
+
'senior-salaried-dentist': niDentalBand(NI_DENTAL_BANDS.senior),
|
|
83
|
+
'assistant-clinical-director-dentist': niDentalBand(NI_DENTAL_BANDS.assistantDirector),
|
|
84
|
+
'clinical-director-dentist': niDentalBand(NI_DENTAL_BANDS.clinicalDirector),
|
|
85
|
+
'dental-core-training': stepped(salariesOfCode(NI.residentGrades, NI_CODES.coreTraining)),
|
|
86
|
+
'community-dental-officer': numbered(salariesOfCode(NI.communityDentalService, NI_CODES.communityDentalOfficer)),
|
|
87
|
+
'senior-community-dental-officer': numbered(salariesOfCode(NI.communityDentalService, NI_CODES.seniorCommunityDentalOfficer)),
|
|
88
|
+
'assistant-community-dental-clinical-director': numbered(salariesOfCode(NI.communityDentalService, NI_CODES.assistantCommunityDentalClinicalDirector)),
|
|
89
|
+
'specialist-community-dentist': numbered(salariesOfCode(NI.communityDentalService, NI_CODES.specialistCommunityDentist)),
|
|
90
|
+
'community-dental-clinical-director': numbered(salariesOfCode(NI.communityDentalService, NI_CODES.communityDentalClinicalDirector)),
|
|
94
91
|
});
|
|
95
92
|
// Wales 2026/27 — salaried dental spine + dental core training, uplifted.
|
|
96
93
|
const wales2026 = fromDocument(MD_W_01_2026, {
|
|
97
94
|
'salaried-dental': bySpine(WAL26.salariedDentalSpine),
|
|
98
|
-
'dental-core-training': stepped(
|
|
95
|
+
'dental-core-training': stepped(salariesOfCode(WAL26.trainingGrades, WAL26_CODES.dentalCoreTraining)),
|
|
99
96
|
});
|
|
100
97
|
// Scotland 2025/26 — the Public Dental Service spine (Annex G) and dental
|
|
101
98
|
// core training (addendum).
|
|
102
99
|
const scotland2025 = combineScales(fromDocument(PCS_DD_2025_01, {
|
|
103
100
|
'salaried-dental': bySpine(SCO25.salariedDentalSpine),
|
|
104
101
|
}), fromDocument(PCS_DD_2025_01_ADDENDUM, {
|
|
105
|
-
'dental-core-training': [
|
|
106
|
-
{ label: SCO25.dentalCoreTraining.stage, salary: SCO25.dentalCoreTraining.salary },
|
|
107
|
-
],
|
|
102
|
+
'dental-core-training': byStage([SCO25.dentalCoreTraining]),
|
|
108
103
|
}));
|
|
109
104
|
const DENTAL_SCALES = {
|
|
110
|
-
[
|
|
111
|
-
[NATION_KEYS.england]:
|
|
112
|
-
[NATION_KEYS.scotland]:
|
|
105
|
+
[YEAR_LABELS.Y2026_27]: {
|
|
106
|
+
[NATION_KEYS.england]: england2026,
|
|
107
|
+
[NATION_KEYS.scotland]: scotland2026,
|
|
113
108
|
[NATION_KEYS.wales]: wales2026,
|
|
114
109
|
},
|
|
115
|
-
[
|
|
116
|
-
[NATION_KEYS.wales]:
|
|
117
|
-
[NATION_KEYS.northernIreland]:
|
|
110
|
+
[YEAR_LABELS.Y2025_26]: {
|
|
111
|
+
[NATION_KEYS.wales]: wales2025,
|
|
112
|
+
[NATION_KEYS.northernIreland]: northernIreland2025,
|
|
118
113
|
[NATION_KEYS.scotland]: scotland2025,
|
|
119
114
|
},
|
|
120
115
|
};
|
|
116
|
+
/** Every read over the dental tables. */
|
|
117
|
+
export const DENTAL_FAMILY = gradeFamily(DENTAL_SCALES, DENTAL_GRADE_IDS);
|
|
121
118
|
/** Pay years this family publishes, newest first (derived from data). */
|
|
122
|
-
export const DENTAL_PAY_YEARS =
|
|
119
|
+
export const DENTAL_PAY_YEARS = DENTAL_FAMILY.years;
|
|
123
120
|
/**
|
|
124
|
-
* Published salaried dental grades for a nation and
|
|
121
|
+
* Published salaried dental grades for a nation and pay year, each with
|
|
125
122
|
* its scale points and salary range. Both args required; an absent
|
|
126
123
|
* combination throws `ScaleUnavailable`.
|
|
127
124
|
*/
|
|
128
125
|
export function getDentalScales(year, nation) {
|
|
129
|
-
return
|
|
126
|
+
return DENTAL_FAMILY.scalesFor(year, nation);
|
|
127
|
+
}
|
|
128
|
+
/** One band of Northern Ireland's salaried dental table, by number. */
|
|
129
|
+
function niDentalBand(band) {
|
|
130
|
+
return numbered(scaleSalaries(NI.salariedDental, (g) => g.band === band, `NI dental band ${band}`));
|
|
130
131
|
}
|
|
131
132
|
//# sourceMappingURL=dental-scales.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dental-scales.js","sourceRoot":"","sources":["../src/dental-scales.ts"],"names":[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,CAC7B,IAAa,EACb,MAAc;IAEd,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,uEAAuE;AACvE,SAAS,YAAY,CAAC,IAAkB;IACtC,OAAO,QAAQ,CAAC,aAAa,CAC3B,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,kBAAkB,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/format.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* GBP and percentage formatting helpers for NHS
|
|
3
3
|
* pay data.
|
|
4
4
|
*/
|
|
5
|
+
import { PER_CENT } from './values.js';
|
|
5
6
|
// ── Intl formatters (reused across calls) ───────
|
|
6
7
|
const gbpFormat = new Intl.NumberFormat('en-GB', {
|
|
7
8
|
style: 'currency',
|
|
@@ -49,7 +50,7 @@ export function fmtPct(n) {
|
|
|
49
50
|
}
|
|
50
51
|
/** Format as 8.3% (Intl, input is whole %). */
|
|
51
52
|
export function formatPct(n) {
|
|
52
|
-
return pctFormat.format(n /
|
|
53
|
+
return pctFormat.format(n / PER_CENT);
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* Format to two decimal places where they carry signal,
|
|
@@ -59,7 +60,7 @@ export function formatPct(n) {
|
|
|
59
60
|
* rate; small rates format through this one.
|
|
60
61
|
*/
|
|
61
62
|
export function formatPctPrecise(n) {
|
|
62
|
-
return pctPreciseFormat.format(n /
|
|
63
|
+
return pctPreciseFormat.format(n / PER_CENT);
|
|
63
64
|
}
|
|
64
65
|
// ── Tax year labels ─────────────────────────────
|
|
65
66
|
/** '2025-26' → '2025/26' */
|
package/dist/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version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AO,CACL,QAAQ;UACN,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CACxC,CAAC;AACJ,CAAC;AAED,mDAAmD;AAEnD,sCAAsC;AACtC,MAAM,UAAU,MAAM,CAAC,CAAS;IAC9B,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAC5B,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAS;IACxC,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;AAC/C,CAAC;AAED,mDAAmD;AAEnD,4BAA4B;AAC5B,MAAM,UAAU,SAAS,CAAC,IAAe;IACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/hcas-pcts.d.ts
CHANGED
package/dist/hcas-pcts.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Browser-safe — no node:fs dependency.
|
|
10
10
|
*/
|
|
11
|
-
// ── PCT data — Annex 8, HCAS payment zones ──
|
|
11
|
+
// ── PCT data — Annex 8, HCAS payment zones, Tables 12 to 14 ──
|
|
12
12
|
// Source: "NHS Terms and Conditions of Service Handbook,
|
|
13
13
|
// amendment 62" (#sa-41) — see docs/source-archive.md.
|
|
14
14
|
const INNER_LONDON_PCTS = [
|
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","sourceRo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AAS,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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HCAS zones' ids and the shape of one zone's rate, in a module that
|
|
3
|
+
* imports nothing, so `regions.ts`, the published zone table and `hcas.ts`
|
|
4
|
+
* can all name a zone without an import cycle (as `afc-band.ts` does for
|
|
5
|
+
* the bands).
|
|
6
|
+
*/
|
|
7
|
+
/** One zone: its rate as a percentage of basic pay, and the cash floor
|
|
8
|
+
* and ceiling it is held between. */
|
|
9
|
+
export interface HcasZone {
|
|
10
|
+
readonly rate: number;
|
|
11
|
+
readonly min: number;
|
|
12
|
+
readonly max: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const HCAS_ZONE_IDS: {
|
|
15
|
+
readonly INNER_LONDON: "inner-london";
|
|
16
|
+
readonly OUTER_LONDON: "outer-london";
|
|
17
|
+
readonly FRINGE: "fringe";
|
|
18
|
+
};
|
|
19
|
+
export type HcasZoneId = (typeof HCAS_ZONE_IDS)[keyof typeof HCAS_ZONE_IDS];
|
|
20
|
+
/** The three London zones, keyed by the zone id a region resolves to. */
|
|
21
|
+
export type HcasZones = Readonly<Record<HcasZoneId, HcasZone>>;
|
|
22
|
+
/** Type guard — is this string a valid zone ID? */
|
|
23
|
+
export declare function isHcasZoneId(value: string): value is HcasZoneId;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HCAS zones' ids and the shape of one zone's rate, in a module that
|
|
3
|
+
* imports nothing, so `regions.ts`, the published zone table and `hcas.ts`
|
|
4
|
+
* can all name a zone without an import cycle (as `afc-band.ts` does for
|
|
5
|
+
* the bands).
|
|
6
|
+
*/
|
|
7
|
+
export const HCAS_ZONE_IDS = {
|
|
8
|
+
INNER_LONDON: 'inner-london',
|
|
9
|
+
OUTER_LONDON: 'outer-london',
|
|
10
|
+
FRINGE: 'fringe',
|
|
11
|
+
};
|
|
12
|
+
const ZONE_ID_LIST = Object.values(HCAS_ZONE_IDS);
|
|
13
|
+
/** Type guard — is this string a valid zone ID? */
|
|
14
|
+
export function isHcasZoneId(value) {
|
|
15
|
+
return ZONE_ID_LIST.includes(value);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=hcas-zone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hcas-zone.js","sourceRoot":"","sources":["../src/hcas-zone.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,QAAQ;CACR,CAAC;AAUX,MAAM,YAAY,GAChB,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAE/B,mDAAmD;AACnD,MAAM,UAAU,YAAY,CAC1B,KAAa;IAEb,OACE,YACD,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC"}
|
package/dist/hcas.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HCAS (High Cost Area Supplement)
|
|
3
|
-
*
|
|
2
|
+
* HCAS (High Cost Area Supplement): England's zones by pay year (HCAS is
|
|
3
|
+
* England's only), the supplement, and gross salary. The zone ids and
|
|
4
|
+
* types are in `hcas-zone.ts`.
|
|
4
5
|
*
|
|
5
6
|
* Browser-safe — no node:fs dependency.
|
|
6
7
|
*/
|
|
7
|
-
import type {
|
|
8
|
+
import type { PayYear } from '@casomoltd/paye-calc';
|
|
8
9
|
import type { AfcRegionId } from './regions.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
readonly OUTER_LONDON: "outer-london";
|
|
12
|
-
readonly FRINGE: "fringe";
|
|
13
|
-
};
|
|
14
|
-
export type HcasZoneId = (typeof HCAS_ZONE_IDS)[keyof typeof HCAS_ZONE_IDS];
|
|
15
|
-
/** Type guard — is this string a valid zone ID? */
|
|
16
|
-
export declare function isHcasZoneId(value: string): value is HcasZoneId;
|
|
10
|
+
import type { HcasZone, HcasZones } from './hcas-zone.js';
|
|
11
|
+
import type { SalaryRange } from './values.js';
|
|
17
12
|
/**
|
|
18
13
|
* Calculate HCAS supplement for a base salary.
|
|
19
14
|
* Applies percentage rate clamped between min/max.
|
|
@@ -21,14 +16,27 @@ export declare function isHcasZoneId(value: string): value is HcasZoneId;
|
|
|
21
16
|
export declare function calculateHcasSupplement(baseSalary: number, zone: HcasZone): number;
|
|
22
17
|
/**
|
|
23
18
|
* Produce a region's gross from a base salary: the HCAS
|
|
24
|
-
* supplement for England's high-cost zones, and nothing else.
|
|
19
|
+
* supplement for England's high-cost zones, and nothing else. The zones
|
|
20
|
+
* are England's for `year`, read here, so a caller cannot pass another
|
|
21
|
+
* year's or another nation's; a region outside them is paid its base.
|
|
25
22
|
*
|
|
26
23
|
* No nation adjustment happens here. Every nation's ladder is
|
|
27
|
-
*
|
|
28
|
-
* `
|
|
24
|
+
* held in `scales.ts` and reached through
|
|
25
|
+
* `getAfcScales`, so a caller wanting Welsh pay asks for
|
|
29
26
|
* the Welsh table rather than passing another nation's figure
|
|
30
|
-
* to be adjusted.
|
|
31
|
-
* a number that was neither nation's once Wales's own scales
|
|
32
|
-
* were read from its circular.
|
|
27
|
+
* to be adjusted.
|
|
33
28
|
*/
|
|
34
|
-
export declare function grossSalary(base: number, region: AfcRegionId,
|
|
29
|
+
export declare function grossSalary(base: number, region: AfcRegionId, year: PayYear): number;
|
|
30
|
+
/**
|
|
31
|
+
* The basic salaries between which a zone pays its percentage: below
|
|
32
|
+
* `min` its cash floor applies, above `max` its cash cap. Exact, not
|
|
33
|
+
* rounded: a consumer rounds as it prints.
|
|
34
|
+
*/
|
|
35
|
+
export declare function hcasRateBand(zone: HcasZone): SalaryRange;
|
|
36
|
+
/**
|
|
37
|
+
* England's HCAS zones for a pay year, from the handbook's table for that
|
|
38
|
+
* year: the zones a London supplement is read from, whatever nation the
|
|
39
|
+
* reader is in. Throws {@link ScaleUnavailable} for a year the table does
|
|
40
|
+
* not hold, rather than lending another year's ceilings.
|
|
41
|
+
*/
|
|
42
|
+
export declare function englandHcasZones(year: PayYear): HcasZones;
|
package/dist/hcas.js
CHANGED
|
@@ -1,45 +1,66 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* HCAS (High Cost Area Supplement)
|
|
3
|
-
*
|
|
2
|
+
* HCAS (High Cost Area Supplement): England's zones by pay year (HCAS is
|
|
3
|
+
* England's only), the supplement, and gross salary. The zone ids and
|
|
4
|
+
* types are in `hcas-zone.ts`.
|
|
4
5
|
*
|
|
5
6
|
* Browser-safe — no node:fs dependency.
|
|
6
7
|
*/
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
const ZONE_ID_LIST = Object.values(HCAS_ZONE_IDS);
|
|
14
|
-
/** Type guard — is this string a valid zone ID? */
|
|
15
|
-
export function isHcasZoneId(value) {
|
|
16
|
-
return ZONE_ID_LIST.includes(value);
|
|
17
|
-
}
|
|
8
|
+
import { NATION_KEYS } from '@casomoltd/paye-calc';
|
|
9
|
+
import { ScaleUnavailable } from './errors.js';
|
|
10
|
+
import { HCAS_ZONES } from './published/hcas-zones.js';
|
|
11
|
+
import { afcRegionToHcasZone } from './regions.js';
|
|
12
|
+
import { PER_CENT } from './values.js';
|
|
18
13
|
/**
|
|
19
14
|
* Calculate HCAS supplement for a base salary.
|
|
20
15
|
* Applies percentage rate clamped between min/max.
|
|
21
16
|
*/
|
|
22
17
|
export function calculateHcasSupplement(baseSalary, zone) {
|
|
23
|
-
const raw = baseSalary * (zone
|
|
18
|
+
const raw = baseSalary * rateOf(zone);
|
|
24
19
|
return Math.round(Math.min(Math.max(raw, zone.min), zone.max));
|
|
25
20
|
}
|
|
26
21
|
/**
|
|
27
22
|
* Produce a region's gross from a base salary: the HCAS
|
|
28
|
-
* supplement for England's high-cost zones, and nothing else.
|
|
23
|
+
* supplement for England's high-cost zones, and nothing else. The zones
|
|
24
|
+
* are England's for `year`, read here, so a caller cannot pass another
|
|
25
|
+
* year's or another nation's; a region outside them is paid its base.
|
|
29
26
|
*
|
|
30
27
|
* No nation adjustment happens here. Every nation's ladder is
|
|
31
|
-
*
|
|
32
|
-
* `
|
|
28
|
+
* held in `scales.ts` and reached through
|
|
29
|
+
* `getAfcScales`, so a caller wanting Welsh pay asks for
|
|
33
30
|
* the Welsh table rather than passing another nation's figure
|
|
34
|
-
* to be adjusted.
|
|
35
|
-
* a number that was neither nation's once Wales's own scales
|
|
36
|
-
* were read from its circular.
|
|
31
|
+
* to be adjusted.
|
|
37
32
|
*/
|
|
38
|
-
export function grossSalary(base, region,
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
33
|
+
export function grossSalary(base, region, year) {
|
|
34
|
+
const zone = afcRegionToHcasZone(region);
|
|
35
|
+
if (zone === null) {
|
|
41
36
|
return base;
|
|
42
37
|
}
|
|
43
|
-
return base + calculateHcasSupplement(base,
|
|
38
|
+
return base + calculateHcasSupplement(base, englandHcasZones(year)[zone]);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The basic salaries between which a zone pays its percentage: below
|
|
42
|
+
* `min` its cash floor applies, above `max` its cash cap. Exact, not
|
|
43
|
+
* rounded: a consumer rounds as it prints.
|
|
44
|
+
*/
|
|
45
|
+
export function hcasRateBand(zone) {
|
|
46
|
+
const rate = rateOf(zone);
|
|
47
|
+
return { min: zone.min / rate, max: zone.max / rate };
|
|
48
|
+
}
|
|
49
|
+
/** A zone's rate as a fraction of basic pay. */
|
|
50
|
+
function rateOf(zone) {
|
|
51
|
+
return zone.rate / PER_CENT;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* England's HCAS zones for a pay year, from the handbook's table for that
|
|
55
|
+
* year: the zones a London supplement is read from, whatever nation the
|
|
56
|
+
* reader is in. Throws {@link ScaleUnavailable} for a year the table does
|
|
57
|
+
* not hold, rather than lending another year's ceilings.
|
|
58
|
+
*/
|
|
59
|
+
export function englandHcasZones(year) {
|
|
60
|
+
const key = year;
|
|
61
|
+
const zones = HCAS_ZONES[key];
|
|
62
|
+
if (zones === undefined)
|
|
63
|
+
throw new ScaleUnavailable(NATION_KEYS.england, year);
|
|
64
|
+
return zones;
|
|
44
65
|
}
|
|
45
66
|
//# 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
|
|
1
|
+
{"version":3,"file":"hcas.js","sourceRoot":"","sources":["../src/hcas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAC,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAC,mBAAmB,EAAC,MAAM,cAAc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IAAI,gBAAgB,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export { afcBand1 } from './
|
|
2
|
-
export type { AfcBand1, AfcBand1Published } from './
|
|
3
|
-
export { AFC_BANDS, AFC_BAND_IDS
|
|
4
|
-
export type { AfcBandId
|
|
1
|
+
export { afcBand1 } from './scales.js';
|
|
2
|
+
export type { AfcBand1, AfcBand1Published } from './scales.js';
|
|
3
|
+
export { AFC_BANDS, AFC_BAND_IDS } from './afc-band.js';
|
|
4
|
+
export type { AfcBandId } from './afc-band.js';
|
|
5
|
+
export { WALES_LIVING_WAGE } from './published/wales-living-wage.js';
|
|
6
|
+
export type { WalesLivingWage } from './published/wales-living-wage.js';
|
|
7
|
+
export { AFC_CURRENT_YEAR, AFC_PREVIOUS_YEAR, afcPointOf, getAfcScales, afcScaleSource, latestAfcYear, latestRoundLag, payRoundLag, isPayRoundInReach, isAwaitingPayAward, assertLatestRoundsInReach, afcPayYears, afcPayYearFor, AFC_PAY_YEAR_KINDS, } from './scales.js';
|
|
8
|
+
export type { AfcBandMeta, AfcPayYearLookup } from './scales.js';
|
|
5
9
|
export type { PayLadder, ScalePoint } from './scale-point.js';
|
|
10
|
+
export { schemeYearOfPayYear } from './pay-year.js';
|
|
6
11
|
export { PensionTiers, getEmployerPensionRate, getPensionScheme, getPensionTiers, getPensionTiersVO, lookupPensionTier, pensionTierRate, } from './pension.js';
|
|
7
12
|
export type { EmployerPensionRate, NhsPensionScheme, PensionTier, } from './pension.js';
|
|
8
13
|
export type { SalaryRange } from './values.js';
|
|
@@ -10,11 +15,16 @@ export { Post, NO_ADJUSTMENTS } from './post.js';
|
|
|
10
15
|
export type { PostIdentity, PostAdjustments } from './post.js';
|
|
11
16
|
export type { AfcRole, DentalRole, MedicalRole, Role, RoleKind, VsmRole, } from './role.js';
|
|
12
17
|
export { afcResolver, dentalResolver, medicalResolver } from './resolver.js';
|
|
13
|
-
export type { AfcResolver, DentalResolver, MedicalResolver, NationScaleResolver, PayScaleResolver, } from './resolver.js';
|
|
14
|
-
export { MEDICAL_GRADES, MEDICAL_GRADE_IDS
|
|
15
|
-
export type { MedicalGradeId
|
|
16
|
-
export {
|
|
17
|
-
export type {
|
|
18
|
+
export type { AfcResolver, DentalResolver, MedicalResolver, NationScaleResolver, PayScaleResolver, ScaleYears, AfcPointQuery, AfcLabelQuery, GradePointQuery, GradeLabelQuery, } from './resolver.js';
|
|
19
|
+
export { MEDICAL_GRADES, MEDICAL_GRADE_IDS } from './medical-grades.js';
|
|
20
|
+
export type { MedicalGradeId } from './medical-grades.js';
|
|
21
|
+
export { MEDICAL_FAMILY, MEDICAL_PAY_YEARS, getMedicalScales, latestMedicalSource, } from './medical-scales.js';
|
|
22
|
+
export type { MedicalGradeMeta } from './medical-scales.js';
|
|
23
|
+
export { DENTAL_GRADES, DENTAL_GRADE_IDS } from './dental-grades.js';
|
|
24
|
+
export type { DentalGradeId } from './dental-grades.js';
|
|
25
|
+
export { DENTAL_FAMILY, DENTAL_PAY_YEARS, getDentalScales } from './dental-scales.js';
|
|
26
|
+
export type { GradeFamily } from './scale-tables.js';
|
|
27
|
+
export type { DentalGradeMeta } from './dental-scales.js';
|
|
18
28
|
export { ADDITIONAL_PENSION_LIMIT, ADDITIONAL_PENSION_PAYMENTS, ADDITIONAL_PENSION_UNIT, additionalPensionCost, additionalPensionToBuy, } from './additional-pension.js';
|
|
19
29
|
export type { AdditionalPensionPayment, AdditionalPensionPurchase, } from './additional-pension.js';
|
|
20
30
|
export { ADDITIONAL_PENSION_COVERS } from './gad/additional-pension-table.js';
|
|
@@ -66,17 +76,16 @@ export type { LedgerSeed, SeedBasis } from './pension/seed.js';
|
|
|
66
76
|
export { buildLedger } from './pension/ledger.js';
|
|
67
77
|
export type { AppliedDrawing, AppliedLeaverAdjustment, LedgerRequest, LedgerYear, MemberLedger, } from './pension/ledger.js';
|
|
68
78
|
export type { EstimatedHistory } from './pension/history.js';
|
|
69
|
-
export { HCAS_ZONE_IDS,
|
|
70
|
-
export type { HcasZoneId } from './hcas.js';
|
|
79
|
+
export { HCAS_ZONE_IDS, isHcasZoneId } from './hcas-zone.js';
|
|
80
|
+
export type { HcasZone, HcasZoneId, HcasZones } from './hcas-zone.js';
|
|
81
|
+
export { calculateHcasSupplement, englandHcasZones, grossSalary, hcasRateBand, } from './hcas.js';
|
|
71
82
|
export { getHcasPcts, getHcasZone, } from './hcas-pcts.js';
|
|
72
83
|
export type { HcasPct } from './hcas-pcts.js';
|
|
73
|
-
export { AFC_REGIONS, ZONE_TO_REGION, afcRegionToHcasZone, afcRegionToNation,
|
|
84
|
+
export { AFC_REGIONS, ZONE_TO_REGION, afcRegionToHcasZone, afcRegionToNation, afcRegionOf, baseAfcRegion, isAfcRegionId, resolveRegion, } from './regions.js';
|
|
74
85
|
export type { AfcRegionId, ResolvedRegion, } from './regions.js';
|
|
75
|
-
export { AFC_CURRENT_YEAR, AFC_PREVIOUS_YEAR, afcPointOf, getAfcScales, } from './bands.js';
|
|
76
|
-
export type { AfcBandMeta, AfcScaleData, } from './bands.js';
|
|
77
86
|
export { nhsTakeHome } from './take-home.js';
|
|
78
|
-
export { afcWeekInForce, afcWeeklyHours, hoursPerYear } from './working-week.js';
|
|
87
|
+
export { afcWeekInForce, afcWeeklyHours, annualiseHourly, hoursPerYear, } from './working-week.js';
|
|
79
88
|
export type { NhsTakeHomeOptions } from './take-home.js';
|
|
80
89
|
export { fmtMoney, fmtPct, fmtSalary, formatGBP, formatGBPPrecise, formatPct, formatPctPrecise, yearLabel, } from './format.js';
|
|
81
|
-
export { TAX_REGIONS, TAX_YEARS, NATIONS, NATION_KEYS, TakeHomePay, GrossAnnual, PensionBasis, PensionPercent, StudentLoanPlan, nationToTaxRegion, getTaxYearConfig, } from '@casomoltd/paye-calc';
|
|
90
|
+
export { TAX_REGIONS, TAX_YEARS, YEAR_LABELS, NATIONS, NATION_KEYS, TakeHomePay, GrossAnnual, PensionBasis, PensionPercent, StudentLoanPlan, nationToTaxRegion, getTaxYearConfig, } from '@casomoltd/paye-calc';
|
|
82
91
|
export type { Nation, TaxRegion, TaxYear, PayYear, YearLabel, } from '@casomoltd/paye-calc';
|