@casomoltd/nhs-pay 0.9.1 → 0.10.1
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 +32 -112
- package/dist/pension-projection.d.ts +7 -1
- package/dist/pension-projection.js +77 -62
- package/dist/pension-projection.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -121,122 +121,42 @@ console.log(post.takeHome.net); // annual net after tax + NI + pension
|
|
|
121
121
|
dental grades. Both fail loud (`ScaleUnavailable`) for an
|
|
122
122
|
unpublished nation/year or grade rather than defaulting.
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
### Scales (`scales.ts`)
|
|
127
|
-
|
|
128
|
-
| Export | Description |
|
|
129
|
-
| ---------------------- | ------------------------------------ |
|
|
130
|
-
| `AFC_BANDS` | Band key-to-ID mapping |
|
|
131
|
-
| `AFC_BAND_IDS` | Ordered array of all band IDs |
|
|
132
|
-
| `AFC_TAX_YEARS` | Tax years with available scale data |
|
|
133
|
-
| `AFC_HOURS_PER_YEAR` | Standard AfC hours (1950) |
|
|
134
|
-
| `NLW_HOURLY` | National Living Wage by year |
|
|
135
|
-
| `WALES_LW_FLOOR` | Welsh Government living wage floor |
|
|
136
|
-
| `annualiseHourly` | Convert hourly rate to annual salary |
|
|
137
|
-
| `applyWalesFloor` | Apply Wales living wage floor |
|
|
138
|
-
|
|
139
|
-
**Types:** `AfcBandId`, `ScalePoint`, `HcasZone`,
|
|
140
|
-
`HcasZones`
|
|
141
|
-
|
|
142
|
-
### Pension (`pension.ts`)
|
|
143
|
-
|
|
144
|
-
| Export | Description |
|
|
145
|
-
| ------------------- | ---------------------------------- |
|
|
146
|
-
| `getPensionTiers` | Pension tiers for a tax year |
|
|
147
|
-
| `pensionTierRate` | Contribution rate (%) for a salary |
|
|
148
|
-
| `lookupPensionTier` | Full tier info for a salary |
|
|
149
|
-
|
|
150
|
-
**Types:** `PensionTier`
|
|
151
|
-
|
|
152
|
-
### HCAS (`hcas.ts`)
|
|
153
|
-
|
|
154
|
-
| Export | Description |
|
|
155
|
-
| ------------------------ | ------------------------------ |
|
|
156
|
-
| `HCAS_ZONE_IDS` | Zone key-to-ID mapping |
|
|
157
|
-
| `calculateHcasSupplement`| HCAS amount for base + zone |
|
|
158
|
-
| `grossSalary` | Base + Wales floor + HCAS |
|
|
159
|
-
| `isHcasZoneId` | Type guard for zone IDs |
|
|
160
|
-
|
|
161
|
-
**Types:** `HcasZoneId`
|
|
162
|
-
|
|
163
|
-
### HCAS PCTs (`hcas-pcts.ts`)
|
|
164
|
-
|
|
165
|
-
| Export | Description |
|
|
166
|
-
| ------------------- | ------------------------------------ |
|
|
167
|
-
| `getHcasZone` | PCT → HCAS zone lookup |
|
|
168
|
-
| `getHcasPcts` | All PCTs with zone, in order |
|
|
169
|
-
|
|
170
|
-
**Types:** `HcasPct`
|
|
171
|
-
|
|
172
|
-
### Regions (`regions.ts`)
|
|
173
|
-
|
|
174
|
-
| Export | Description |
|
|
175
|
-
| ------------------- | ------------------------------------ |
|
|
176
|
-
| `AFC_REGIONS` | Region key-to-ID mapping |
|
|
177
|
-
| `ZONE_TO_REGION` | HCAS zone → AFC region mapping |
|
|
178
|
-
| `ZONE_LABELS` | HCAS zone → display label |
|
|
179
|
-
| `resolveRegion` | Resolve region to tax/HCAS/label |
|
|
180
|
-
| `afcRegionToNation` | Map region to paye-calc Nation |
|
|
181
|
-
| `isAfcRegionId` | Type guard for region IDs |
|
|
182
|
-
| `isNation` | Type guard for Nation strings |
|
|
124
|
+
### Project a 2015-scheme pension
|
|
183
125
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
| Export | Description |
|
|
206
|
-
| ------------------ | --------------------------------------------- |
|
|
207
|
-
| `getMedicalScales` | Doctor grades for a nation/year, with points |
|
|
208
|
-
| `getDentalScales` | Salaried dental grades for a nation/year |
|
|
209
|
-
| `medicalResolver` | Build a `Post` from a doctor grade + point |
|
|
210
|
-
| `dentalResolver` | Build a `Post` from a dental grade + point |
|
|
211
|
-
|
|
212
|
-
Each resolver exposes `fromScalePoint(grade, pointLabel, nation,
|
|
213
|
-
year)`, `fromSalary`, `availableGrades(nation, year)` and
|
|
214
|
-
`latestYearFor(grade, nation)`. See
|
|
215
|
-
[Medical & dental pay scales](#medical--dental-pay-scales) for how
|
|
216
|
-
the data is sourced and modelled.
|
|
217
|
-
|
|
218
|
-
**Types:** `MedicalGradeId`, `DentalGradeId`, `MedicalGradeMeta`,
|
|
219
|
-
`DentalGradeMeta`, `MedicalRole`, `DentalRole`, `Role`, `Post`,
|
|
220
|
-
`GradeMeta`
|
|
221
|
-
|
|
222
|
-
### Format (`format.ts`)
|
|
126
|
+
```ts
|
|
127
|
+
import {projectPension, commute} from '@casomoltd/nhs-pay';
|
|
128
|
+
|
|
129
|
+
const projection = projectPension({
|
|
130
|
+
kind: 'statement',
|
|
131
|
+
accruedPension: 5000, // from the Annual Benefit Statement
|
|
132
|
+
currentSalary: 54000,
|
|
133
|
+
dateOfBirth: new Date(1990, 0, 1),
|
|
134
|
+
exitDate: new Date(2035, 0, 1),
|
|
135
|
+
retirementDate: new Date(2053, 0, 1), // before NPA → ERF
|
|
136
|
+
npa: 67,
|
|
137
|
+
assumedCpi: 0.02,
|
|
138
|
+
});
|
|
139
|
+
console.log(projection.annualPension); // after ERF/LRF
|
|
140
|
+
console.log(projection.factorType); // 'erf'
|
|
141
|
+
console.log(projection.curve); // chart-ready points
|
|
142
|
+
|
|
143
|
+
const {lumpSum, residualPension} = commute(
|
|
144
|
+
projection.annualPension, 1, // take the HMRC max
|
|
145
|
+
);
|
|
146
|
+
```
|
|
223
147
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
| `fmtMoney` | Format rounded money |
|
|
230
|
-
| `fmtPct` | Format percentage (e.g. 8.3%) |
|
|
231
|
-
| `formatPct` | Format percentage (Intl) |
|
|
232
|
-
| `yearLabel` | Convert '2025-26' to '2025/26' |
|
|
148
|
+
Without a statement figure, `kind: 'estimation'` accrues from a
|
|
149
|
+
`joinDate` instead. ERF/LRF factors are transcribed verbatim from
|
|
150
|
+
the GAD consolidated factor workbook (30 June 2023 issue) with
|
|
151
|
+
GAD's own rounding rules; a retirement date beyond the printed
|
|
152
|
+
tables throws `RetirementFactorOutOfRange`.
|
|
233
153
|
|
|
234
|
-
|
|
154
|
+
## API reference
|
|
235
155
|
|
|
236
|
-
`
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
156
|
+
[`docs/api.md`](docs/api.md) — every export, organised by
|
|
157
|
+
domain, with typed signatures and short notes. Kept in sync with
|
|
158
|
+
the code by a check-time drift gate. Agents may prefer the
|
|
159
|
+
shipped `dist/*.d.ts`, which carry the full JSDoc per module.
|
|
240
160
|
|
|
241
161
|
## Data sources
|
|
242
162
|
|
|
@@ -135,5 +135,11 @@ export declare function commute(adjustedPension: number, fraction: number): Comm
|
|
|
135
135
|
/**
|
|
136
136
|
* Generate a full pension projection including curve
|
|
137
137
|
* data for both nominal and real (CPI-deflated) views.
|
|
138
|
+
*
|
|
139
|
+
* `today` is the evaluation date — the anchor for the
|
|
140
|
+
* accrued/projected split and the real-terms deflator.
|
|
141
|
+
* Injectable so tests can pin exact curve values;
|
|
142
|
+
* captured exactly once and threaded (a second capture
|
|
143
|
+
* could flip the ms-precision accrued flag).
|
|
138
144
|
*/
|
|
139
|
-
export declare function projectPension(input: PensionProjectionInput): PensionProjectionResult;
|
|
145
|
+
export declare function projectPension(input: PensionProjectionInput, today?: Date): PensionProjectionResult;
|
|
@@ -111,34 +111,26 @@ export function commute(adjustedPension, fraction) {
|
|
|
111
111
|
/**
|
|
112
112
|
* Generate a full pension projection including curve
|
|
113
113
|
* data for both nominal and real (CPI-deflated) views.
|
|
114
|
+
*
|
|
115
|
+
* `today` is the evaluation date — the anchor for the
|
|
116
|
+
* accrued/projected split and the real-terms deflator.
|
|
117
|
+
* Injectable so tests can pin exact curve values;
|
|
118
|
+
* captured exactly once and threaded (a second capture
|
|
119
|
+
* could flip the ms-precision accrued flag).
|
|
114
120
|
*/
|
|
115
|
-
export function projectPension(input) {
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
const isEstimation = input.kind === 'estimation';
|
|
120
|
-
const accruedAtExit = computeAccruedAtExit(input, today);
|
|
121
|
-
// Revalue from exit to retirement (deferred = CPI only)
|
|
122
|
-
const exitToRetirement = yearsBetween(exitDate, retirementDate);
|
|
123
|
-
const revaluedAtRetirement = exitToRetirement > 0
|
|
124
|
-
? revalue(accruedAtExit, assumedCpi, exitToRetirement)
|
|
125
|
-
: accruedAtExit;
|
|
126
|
-
// Apply ERF/LRF
|
|
127
|
-
const { factor, type: factorType } = retirementFactor(retirementDate, npDateValue);
|
|
128
|
-
const annualPension = revaluedAtRetirement * factor;
|
|
129
|
-
const adjustmentAmount = revaluedAtRetirement
|
|
130
|
-
- annualPension;
|
|
131
|
-
// Generate curve
|
|
132
|
-
const curve = buildCurve(input, accruedAtExit, today);
|
|
121
|
+
export function projectPension(input, today = new Date()) {
|
|
122
|
+
const resolved = resolveProjection(input, today);
|
|
123
|
+
const adjustmentAmount = resolved.revaluedAtRetirement
|
|
124
|
+
- resolved.annualPension;
|
|
133
125
|
return {
|
|
134
|
-
accruedAtExit,
|
|
135
|
-
revaluedAtRetirement,
|
|
136
|
-
annualPension,
|
|
137
|
-
factor,
|
|
138
|
-
factorType,
|
|
126
|
+
accruedAtExit: resolved.accruedAtExit,
|
|
127
|
+
revaluedAtRetirement: resolved.revaluedAtRetirement,
|
|
128
|
+
annualPension: resolved.annualPension,
|
|
129
|
+
factor: resolved.factor,
|
|
130
|
+
factorType: resolved.factorType,
|
|
139
131
|
adjustmentAmount,
|
|
140
|
-
curve,
|
|
141
|
-
isEstimation,
|
|
132
|
+
curve: buildCurve(resolved),
|
|
133
|
+
isEstimation: resolved.isEstimation,
|
|
142
134
|
};
|
|
143
135
|
}
|
|
144
136
|
// ── Internal Helpers ────────────────────────────────
|
|
@@ -160,67 +152,90 @@ function simulateAccrual(startPension, salary, activeRate, years) {
|
|
|
160
152
|
}
|
|
161
153
|
return pension;
|
|
162
154
|
}
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
// Estimation: accrue from join to exit
|
|
174
|
-
const joinToExit = yearsBetween(input.joinDate, exitDate);
|
|
175
|
-
return simulateAccrual(0, currentSalary, activeRate, Math.max(0, joinToExit));
|
|
155
|
+
/**
|
|
156
|
+
* Nominal accrued pension at a date in the active phase.
|
|
157
|
+
* A date at or before the origin degrades to zero years,
|
|
158
|
+
* which simulateAccrual returns untouched — so the
|
|
159
|
+
* statement path's "already past exit" case needs no
|
|
160
|
+
* special branch.
|
|
161
|
+
*/
|
|
162
|
+
function accruedNominalAt(anchor, date) {
|
|
163
|
+
const years = Math.max(0, yearsBetween(anchor.accrualOrigin, date));
|
|
164
|
+
return simulateAccrual(anchor.accrualBase, anchor.currentSalary, anchor.activeRate, years);
|
|
176
165
|
}
|
|
177
|
-
/**
|
|
178
|
-
function
|
|
179
|
-
const { currentSalary } = input;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
166
|
+
/** The single place input.kind is read */
|
|
167
|
+
function resolveProjection(input, today) {
|
|
168
|
+
const { currentSalary, dateOfBirth, exitDate, retirementDate, npa, assumedCpi, } = input;
|
|
169
|
+
const isEstimation = input.kind === 'estimation';
|
|
170
|
+
// The accrual anchor is the only residue of kind:
|
|
171
|
+
// statement = (ABS figure, today);
|
|
172
|
+
// estimation = (nothing banked, scheme join date).
|
|
173
|
+
const anchor = {
|
|
174
|
+
accrualBase: isEstimation ? 0 : input.accruedPension,
|
|
175
|
+
accrualOrigin: isEstimation ? input.joinDate : today,
|
|
176
|
+
currentSalary,
|
|
177
|
+
activeRate: assumedCpi + ACTIVE_REVAL_BONUS,
|
|
178
|
+
};
|
|
179
|
+
const accruedAtExit = accruedNominalAt(anchor, exitDate);
|
|
180
|
+
// Revalue from exit to retirement (deferred = CPI
|
|
181
|
+
// only); revalue self-guards non-positive periods
|
|
182
|
+
const revaluedAtRetirement = revalue(accruedAtExit, assumedCpi, yearsBetween(exitDate, retirementDate));
|
|
183
|
+
// Apply ERF/LRF
|
|
184
|
+
const { factor, type: factorType } = retirementFactor(retirementDate, npaDate(dateOfBirth, npa));
|
|
185
|
+
const annualPension = revaluedAtRetirement * factor;
|
|
186
|
+
return {
|
|
187
|
+
...anchor,
|
|
188
|
+
today,
|
|
189
|
+
dateOfBirth,
|
|
190
|
+
exitDate,
|
|
191
|
+
retirementDate,
|
|
192
|
+
npa,
|
|
193
|
+
assumedCpi,
|
|
194
|
+
isEstimation,
|
|
195
|
+
accruedAtExit,
|
|
196
|
+
revaluedAtRetirement,
|
|
197
|
+
factor,
|
|
198
|
+
factorType,
|
|
199
|
+
annualPension,
|
|
200
|
+
};
|
|
186
201
|
}
|
|
187
202
|
/** Build the projection curve at yearly intervals */
|
|
188
|
-
function buildCurve(
|
|
189
|
-
const {
|
|
190
|
-
const npDateValue = npaDate(dateOfBirth, npa);
|
|
203
|
+
function buildCurve(resolved) {
|
|
204
|
+
const { today, dateOfBirth, retirementDate, npa, assumedCpi, } = resolved;
|
|
191
205
|
const points = [];
|
|
192
206
|
const currentAge = yearsBetween(dateOfBirth, today);
|
|
193
207
|
const endAge = Math.max(npa + 5, yearsBetween(dateOfBirth, retirementDate) + 5);
|
|
194
208
|
const startAge = Math.floor(currentAge);
|
|
195
|
-
const activeRate = assumedCpi + ACTIVE_REVAL_BONUS;
|
|
196
|
-
// Pre-compute pension at retirement for in-payment
|
|
197
|
-
const exitToRet = Math.max(0, yearsBetween(exitDate, retirementDate));
|
|
198
|
-
const { factor } = retirementFactor(retirementDate, npDateValue);
|
|
199
|
-
const atRetirement = revalue(accruedAtExit, assumedCpi, exitToRet) * factor;
|
|
200
209
|
for (let age = startAge; age <= Math.ceil(endAge); age++) {
|
|
201
210
|
const pointDate = new Date(dateOfBirth.getFullYear() + age, dateOfBirth.getMonth(), dateOfBirth.getDate());
|
|
202
211
|
const yearsFromToday = yearsBetween(today, pointDate);
|
|
203
|
-
const { nominal, accrued } = curvePointValue(
|
|
212
|
+
const { nominal, accrued } = curvePointValue(resolved, pointDate);
|
|
204
213
|
const deflator = Math.pow(1 + assumedCpi, Math.max(0, yearsFromToday));
|
|
205
214
|
const real = nominal / deflator;
|
|
206
215
|
points.push({ age, nominal, real, accrued });
|
|
207
216
|
}
|
|
208
217
|
return points;
|
|
209
218
|
}
|
|
210
|
-
/**
|
|
211
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Nominal value and accrued flag for one curve point —
|
|
221
|
+
* names the three lifecycle phases (active, deferred,
|
|
222
|
+
* in payment) and nothing else.
|
|
223
|
+
*/
|
|
224
|
+
function curvePointValue(resolved, pointDate) {
|
|
225
|
+
const { today, exitDate, retirementDate, assumedCpi, } = resolved;
|
|
212
226
|
if (pointDate <= exitDate) {
|
|
213
|
-
const nominal =
|
|
227
|
+
const nominal = accruedNominalAt(resolved, pointDate);
|
|
214
228
|
return { nominal, accrued: pointDate <= today };
|
|
215
229
|
}
|
|
216
230
|
if (pointDate <= retirementDate) {
|
|
217
231
|
const yrsDeferred = yearsBetween(exitDate, pointDate);
|
|
218
|
-
const nominal = revalue(accruedAtExit, assumedCpi, yrsDeferred);
|
|
232
|
+
const nominal = revalue(resolved.accruedAtExit, assumedCpi, yrsDeferred);
|
|
219
233
|
return { nominal, accrued: false };
|
|
220
234
|
}
|
|
221
|
-
// In payment
|
|
235
|
+
// In payment — grows from the annualPension the
|
|
236
|
+
// projection reports, never a re-derivation of it
|
|
222
237
|
const yrsInPayment = yearsBetween(retirementDate, pointDate);
|
|
223
|
-
const nominal = revalue(
|
|
238
|
+
const nominal = revalue(resolved.annualPension, assumedCpi, yrsInPayment);
|
|
224
239
|
return { nominal, accrued: false };
|
|
225
240
|
}
|
|
226
241
|
//# sourceMappingURL=pension-projection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pension-projection.js","sourceRoot":"","sources":["../src/pension-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAmFlD,uDAAuD;AAEvD,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,CAAC;AAEnC,+CAA+C;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,6CAA6C;AAC7C,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC,uDAAuD;AAEvD,+DAA+D;AAC/D,8DAA8D;AAC9D,8DAA8D;AAC9D,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;AACxC,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC,uDAAuD;AAEvD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,cAAoB,EACpB,MAAY;IAEZ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EAAE,KAAK,EAAC,CAAC;IACnC,CAAC;IACD,gDAAgD;IAChD,kDAAkD;IAClD,MAAM,YAAY,GAAG,YAAY,CAC/B,cAAc,EAAE,SAAS,CAC1B,CAAC;IACF,MAAM,OAAO,GAAG,OAAO,CACrB,QAAQ,CAAC,aAAa,EAAE,UAAU,EAAE,YAAY,CACjD,CAAC;IACF,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@casomoltd/nhs-pay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "NHS Agenda for Change pay scales, pension tiers, regions, and take-home calculator",
|
|
5
5
|
"homepage": "https://github.com/casomoltd/nhs-pay#readme",
|
|
6
6
|
"bugs": "https://github.com/casomoltd/nhs-pay/issues",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"test:watch": "vitest",
|
|
26
26
|
"knip": "knip",
|
|
27
27
|
"jscpd": "jscpd ./src",
|
|
28
|
-
"check": "
|
|
28
|
+
"check:docs": "node scripts/check-api-docs.mjs",
|
|
29
|
+
"check": "npm run lint && npm run typecheck && npm run knip && npm run jscpd && npm run check:docs && npm run test",
|
|
29
30
|
"prepare": "husky"
|
|
30
31
|
},
|
|
31
32
|
"repository": {
|