social-security-calculator 1.0.3 → 3.0.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/lib/constants.d.ts +6 -1
- package/lib/constants.js +12 -3
- package/lib/index.d.ts +12 -4
- package/lib/index.js +148 -61
- package/lib/model.d.ts +11 -5
- package/lib/wage-index.d.ts +3 -3
- package/lib/wage-index.js +0 -225
- package/package.json +3 -2
package/lib/constants.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export declare const EARLY_RETIREMENT_AGE = 62;
|
|
2
2
|
export declare const WAGE_INDEX_CUTOFF = 2023;
|
|
3
3
|
export declare const MAX_RETIREMENT_AGE = 70;
|
|
4
|
-
export declare const LOOKBACK_YEARS =
|
|
4
|
+
export declare const LOOKBACK_YEARS = 40;
|
|
5
|
+
export declare const MAX_DROP_OUT_YEARS = 5;
|
|
6
|
+
export declare const DROP_OUT_YEARS_DIVISOR = 5;
|
|
7
|
+
export declare const ELAPSED_YEARS_START_AGE = 22;
|
|
5
8
|
export declare const BEND_POINT_DIVISOR = 9779.44;
|
|
6
9
|
export declare const FIRST_BEND_POINT_MULTIPLIER = 180;
|
|
7
10
|
export declare const SECOND_BEND_POINT_MULTIPLIER = 1085;
|
|
11
|
+
export declare const FAM_MAX_BASES: number[];
|
|
12
|
+
export declare const CHILD_SURVIVOR_BENEFIT_PERCENTAGE = 0.75;
|
|
8
13
|
export declare const PIA_PERCENTAGES: {
|
|
9
14
|
readonly FIRST_BRACKET: 0.9;
|
|
10
15
|
readonly SECOND_BRACKET: 0.32;
|
package/lib/constants.js
CHANGED
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
export const EARLY_RETIREMENT_AGE = 62;
|
|
3
3
|
export const WAGE_INDEX_CUTOFF = 2023;
|
|
4
4
|
export const MAX_RETIREMENT_AGE = 70;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
// LOOKBACK_YEARS This represents the working years between 22 and 62,
|
|
6
|
+
// but it does not filter out the wages of years before and after that range.
|
|
7
|
+
// There is also a drop out of 5 years, to intentionally ignore the lowest 5 years of earnings.
|
|
8
|
+
// Therefore the effective lookback years for Reitirement AIME is 35 years (62 - 22 = 40, minus 5 drop out = 35).
|
|
9
|
+
export const LOOKBACK_YEARS = 40;
|
|
10
|
+
export const MAX_DROP_OUT_YEARS = 5; // Number of years to drop out for AIME calculation
|
|
11
|
+
export const DROP_OUT_YEARS_DIVISOR = 5; // Number of years to divide by for AIME calculation
|
|
12
|
+
export const ELAPSED_YEARS_START_AGE = 22;
|
|
13
|
+
export const BEND_POINT_DIVISOR = 9779.44; // 1977's AWI - used by dividing against current AWI
|
|
7
14
|
export const FIRST_BEND_POINT_MULTIPLIER = 180;
|
|
8
15
|
export const SECOND_BEND_POINT_MULTIPLIER = 1085;
|
|
16
|
+
export const FAM_MAX_BASES = [230, 332, 433];
|
|
17
|
+
export const CHILD_SURVIVOR_BENEFIT_PERCENTAGE = 0.75; // 75% of PIA for child survivor benefits
|
|
9
18
|
export const PIA_PERCENTAGES = {
|
|
10
19
|
FIRST_BRACKET: 0.9,
|
|
11
20
|
SECOND_BRACKET: 0.32,
|
|
@@ -13,6 +22,6 @@ export const PIA_PERCENTAGES = {
|
|
|
13
22
|
};
|
|
14
23
|
export const EARLY_RETIREMENT_REDUCTION = {
|
|
15
24
|
FIRST_MONTHS: 36,
|
|
16
|
-
FIRST_MONTHS_RATE: 5 / 9 * 0.01,
|
|
25
|
+
FIRST_MONTHS_RATE: 5 / 9 * 0.01, // 5/9 of 1%
|
|
17
26
|
ADDITIONAL_MONTHS_RATE: 5 / 12 * 0.01 // 5/12 of 1%
|
|
18
27
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { BenefitCalculationResult, Earnings } from './model';
|
|
1
|
+
import { BenefitCalculationResult, RetirementDates, Earnings } from './model';
|
|
2
2
|
export declare function calc(birthday: Date, retirementDate: Date, earnings: Earnings): BenefitCalculationResult;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function calcRetirement(birthday: Date, retirementDate: Date, earnings: Earnings): Partial<BenefitCalculationResult>;
|
|
4
|
+
export declare function calculateRetirementDates(birthday: Date, retirementDate: Date): RetirementDates;
|
|
5
|
+
export declare function retirementDateAdjustedPayment(dates: RetirementDates, colaAdjustedPIA: number): number;
|
|
4
6
|
export declare function calculatePIA(AIME: number, baseYear?: number): number;
|
|
5
|
-
export declare function calculateAIME(earnings: Earnings, baseYear?: number): number;
|
|
6
|
-
export declare function
|
|
7
|
+
export declare function calculateAIME(earnings: Earnings, lookbackYears: number, baseYear?: number): number;
|
|
8
|
+
export declare function getLookbackYears(elapsedYears: number): number;
|
|
9
|
+
export declare function getLookbackYearsDisability(elapsedYears: number): number;
|
|
7
10
|
export declare function getFullRetirementMonths(commonLawBirthDate: Date): number;
|
|
11
|
+
/** Compute Family-Max bend points for an eligibility year given AWI_{year-2}. */
|
|
12
|
+
export declare function getFamilyMaxBendPoints(baseYear: number): [number, number, number];
|
|
13
|
+
/** Apply the family-maximum formula to a PIA using already-computed bend points. */
|
|
14
|
+
export declare function calculateFamilyMaximum(pia: number, [bp1, bp2, bp3]: [number, number, number]): number;
|
|
15
|
+
export declare function getEnglishCommonLawDate(date: Date): Date;
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,73 @@
|
|
|
1
1
|
import { wageIndex } from './wage-index';
|
|
2
|
-
import { EARLY_RETIREMENT_AGE, WAGE_INDEX_CUTOFF, MAX_RETIREMENT_AGE,
|
|
3
|
-
// Main
|
|
2
|
+
import { EARLY_RETIREMENT_AGE, WAGE_INDEX_CUTOFF, MAX_RETIREMENT_AGE, MAX_DROP_OUT_YEARS, DROP_OUT_YEARS_DIVISOR, BEND_POINT_DIVISOR, FIRST_BEND_POINT_MULTIPLIER, SECOND_BEND_POINT_MULTIPLIER, PIA_PERCENTAGES, EARLY_RETIREMENT_REDUCTION, ELAPSED_YEARS_START_AGE, LOOKBACK_YEARS, CHILD_SURVIVOR_BENEFIT_PERCENTAGE, FAM_MAX_BASES } from './constants';
|
|
3
|
+
// Main entry point
|
|
4
4
|
export function calc(birthday, retirementDate, earnings) {
|
|
5
|
-
|
|
5
|
+
const retirementCalc = calcRetirement(birthday, retirementDate, earnings);
|
|
6
|
+
const survivorCalc = calcSurvivor(birthday, retirementDate, earnings);
|
|
7
|
+
retirementCalc.SurvivorBenefits = survivorCalc;
|
|
8
|
+
return retirementCalc;
|
|
9
|
+
}
|
|
10
|
+
// Core retirement calculation
|
|
11
|
+
export function calcRetirement(birthday, retirementDate, earnings) {
|
|
12
|
+
const context = createCalculationContext(birthday, retirementDate, earnings);
|
|
13
|
+
const regularBenefit = calculateBenefitPipeline(earnings, context.yearAge60, getLookbackYears(context.totalYears));
|
|
14
|
+
const disabilityBenefit = calculateBenefitPipeline(earnings, context.yearAge60, getLookbackYearsDisability(context.totalYears));
|
|
15
|
+
const monthlyBenefit = retirementDateAdjustedPayment(context.dates, regularBenefit.colaAdjustedPIA);
|
|
16
|
+
const disabilityPIAFloored = context.retirementDate > context.dates.fullRetirement ? 0 : Math.floor(disabilityBenefit.colaAdjustedPIA);
|
|
17
|
+
return {
|
|
18
|
+
AIME: regularBenefit.aime,
|
|
19
|
+
PIA: regularBenefit.pia,
|
|
20
|
+
NormalMonthlyBenefit: monthlyBenefit,
|
|
21
|
+
DisabilityEarnings: disabilityPIAFloored,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// Reusable benefit calculation pipeline
|
|
25
|
+
function calculateBenefitPipeline(earnings, yearAge60, lookbackYears) {
|
|
26
|
+
const aime = calculateAIME(earnings, lookbackYears, yearAge60);
|
|
27
|
+
const pia = calculatePIA(aime, yearAge60);
|
|
28
|
+
const colaAdjustedPIA = calculateCOLAAdjustments(pia, yearAge60 + 2);
|
|
29
|
+
return { aime, pia, colaAdjustedPIA };
|
|
30
|
+
}
|
|
31
|
+
// Survivor benefits calculation
|
|
32
|
+
function calcSurvivor(birthday, retirementDate, earnings) {
|
|
33
|
+
const context = createCalculationContext(birthday, retirementDate, earnings);
|
|
34
|
+
const benefit = calculateBenefitPipeline(earnings, context.yearAge60, getLookbackYears(context.totalYears));
|
|
35
|
+
const survivorPIA = Math.floor(benefit.colaAdjustedPIA * CHILD_SURVIVOR_BENEFIT_PERCENTAGE);
|
|
36
|
+
const effectiveYear = Math.min(context.yearAge60, WAGE_INDEX_CUTOFF);
|
|
37
|
+
const wageIndexEntry = getWageIndexEntry(effectiveYear);
|
|
38
|
+
const wageIndexLastYear = wageIndexEntry.awi;
|
|
39
|
+
const familyMax = calculateFamilyMaximum(benefit.pia, getFamilyMaxBendPoints(wageIndexLastYear));
|
|
40
|
+
const colaAdjustedFamMax = calculateCOLAAdjustments(familyMax, context.yearAge60 + 2);
|
|
41
|
+
return {
|
|
42
|
+
survivingChild: survivorPIA,
|
|
43
|
+
careGivingSpouse: survivorPIA,
|
|
44
|
+
normalRetirementSpouse: Math.floor(benefit.colaAdjustedPIA),
|
|
45
|
+
familyMaximum: colaAdjustedFamMax
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// Create shared calculation context to avoid duplication
|
|
49
|
+
function createCalculationContext(birthday, retirementDate, earnings) {
|
|
50
|
+
validateInputs(birthday, retirementDate, earnings);
|
|
51
|
+
const dates = calculateRetirementDates(birthday, retirementDate);
|
|
52
|
+
const yearAge60 = birthday.getFullYear() + 60;
|
|
53
|
+
const yearStartCounting = birthday.getFullYear() + ELAPSED_YEARS_START_AGE - 1;
|
|
54
|
+
const dateStartCounting = new Date(birthday);
|
|
55
|
+
dateStartCounting.setFullYear(yearStartCounting);
|
|
56
|
+
const monthsDiff = monthsDifference(retirementDate, dateStartCounting) / 12;
|
|
57
|
+
const totalYears = Math.min(LOOKBACK_YEARS, monthsDiff);
|
|
58
|
+
return {
|
|
59
|
+
birthday,
|
|
60
|
+
retirementDate,
|
|
61
|
+
earnings,
|
|
62
|
+
dates,
|
|
63
|
+
yearAge60,
|
|
64
|
+
yearStartCounting,
|
|
65
|
+
dateStartCounting,
|
|
66
|
+
totalYears
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
// Extracted validation logic
|
|
70
|
+
function validateInputs(birthday, retirementDate, earnings) {
|
|
6
71
|
if (!birthday || !retirementDate) {
|
|
7
72
|
throw new Error('Birthday and retirement date are required');
|
|
8
73
|
}
|
|
@@ -12,36 +77,9 @@ export function calc(birthday, retirementDate, earnings) {
|
|
|
12
77
|
if (retirementDate < birthday) {
|
|
13
78
|
throw new Error('Retirement date cannot be before birthday');
|
|
14
79
|
}
|
|
15
|
-
const yearAge60 = birthday.getFullYear() + 60;
|
|
16
|
-
const averageIndexedMonthlyEarnings = calculateAIME(earnings, yearAge60);
|
|
17
|
-
const results = calcRetirementBenefit(birthday, retirementDate, averageIndexedMonthlyEarnings);
|
|
18
|
-
return results;
|
|
19
|
-
}
|
|
20
|
-
export function calcRetirementBenefit(birthday, retirementDate, AIME) {
|
|
21
|
-
const dates = calculateRetirementDates(birthday, retirementDate);
|
|
22
|
-
const age60Year = dates.eclBirthDate.getFullYear() + 60;
|
|
23
|
-
const primaryInsuranceAmount = calculatePIA(AIME, age60Year);
|
|
24
|
-
// Calculate COLA adjustments
|
|
25
|
-
const colaAdjustedPIA = calculateCOLAAdjustments(primaryInsuranceAmount, age60Year + 2);
|
|
26
|
-
// Calculate early/delayed retirement adjustments
|
|
27
|
-
const earlyRetireMonths = monthsDifference(dates.adjusted, dates.fullRetirement);
|
|
28
|
-
let adjustedBenefits = colaAdjustedPIA;
|
|
29
|
-
if (retirementDate < dates.earliestRetirement) {
|
|
30
|
-
adjustedBenefits = 0;
|
|
31
|
-
}
|
|
32
|
-
else if (earlyRetireMonths < 0) {
|
|
33
|
-
adjustedBenefits = calculateEarlyRetirementReduction(colaAdjustedPIA, Math.abs(earlyRetireMonths));
|
|
34
|
-
}
|
|
35
|
-
else if (earlyRetireMonths > 0) {
|
|
36
|
-
adjustedBenefits = calculateDelayedRetirementIncrease(dates.eclBirthDate, colaAdjustedPIA, earlyRetireMonths);
|
|
37
|
-
}
|
|
38
|
-
const monthlyBenefit = Math.floor(adjustedBenefits);
|
|
39
|
-
return {
|
|
40
|
-
AIME: AIME,
|
|
41
|
-
NormalMonthlyBenefit: monthlyBenefit,
|
|
42
|
-
};
|
|
43
80
|
}
|
|
44
|
-
|
|
81
|
+
// Retirement date calculations
|
|
82
|
+
export function calculateRetirementDates(birthday, retirementDate) {
|
|
45
83
|
const eclBirthDate = getEnglishCommonLawDate(birthday);
|
|
46
84
|
const fraMonths = getFullRetirementMonths(eclBirthDate);
|
|
47
85
|
const earliestRetirement = new Date(eclBirthDate.getFullYear() + EARLY_RETIREMENT_AGE, eclBirthDate.getMonth(), eclBirthDate.getDate());
|
|
@@ -53,9 +91,26 @@ function calculateRetirementDates(birthday, retirementDate) {
|
|
|
53
91
|
fullRetirement,
|
|
54
92
|
maxRetirement,
|
|
55
93
|
adjusted,
|
|
56
|
-
eclBirthDate
|
|
94
|
+
eclBirthDate,
|
|
95
|
+
retirementDate
|
|
57
96
|
};
|
|
58
97
|
}
|
|
98
|
+
// Benefit amount calculations
|
|
99
|
+
export function retirementDateAdjustedPayment(dates, colaAdjustedPIA) {
|
|
100
|
+
const earlyRetireMonths = monthsDifference(dates.adjusted, dates.fullRetirement);
|
|
101
|
+
let adjustedBenefits = colaAdjustedPIA;
|
|
102
|
+
if (dates.retirementDate < dates.earliestRetirement) {
|
|
103
|
+
adjustedBenefits = 0;
|
|
104
|
+
}
|
|
105
|
+
else if (earlyRetireMonths < 0) {
|
|
106
|
+
adjustedBenefits = calculateEarlyRetirementReduction(colaAdjustedPIA, Math.abs(earlyRetireMonths));
|
|
107
|
+
}
|
|
108
|
+
else if (earlyRetireMonths > 0) {
|
|
109
|
+
adjustedBenefits = calculateDelayedRetirementIncrease(dates.eclBirthDate, colaAdjustedPIA, earlyRetireMonths);
|
|
110
|
+
}
|
|
111
|
+
return Math.floor(adjustedBenefits);
|
|
112
|
+
}
|
|
113
|
+
// COLA adjustments
|
|
59
114
|
function calculateCOLAAdjustments(PIA, startYear) {
|
|
60
115
|
const currentYear = new Date().getFullYear();
|
|
61
116
|
const colaRates = wageIndex
|
|
@@ -66,12 +121,10 @@ function calculateCOLAAdjustments(PIA, startYear) {
|
|
|
66
121
|
return roundToFloorTenCents(adjustedAmount * multiplier);
|
|
67
122
|
}, PIA);
|
|
68
123
|
}
|
|
124
|
+
// PIA calculation
|
|
69
125
|
export function calculatePIA(AIME, baseYear) {
|
|
70
126
|
const effectiveYear = baseYear ? Math.min(baseYear, WAGE_INDEX_CUTOFF) : WAGE_INDEX_CUTOFF;
|
|
71
|
-
const wageIndexEntry =
|
|
72
|
-
if (!wageIndexEntry) {
|
|
73
|
-
throw new Error(`No wage index data found for year ${effectiveYear}`);
|
|
74
|
-
}
|
|
127
|
+
const wageIndexEntry = getWageIndexEntry(effectiveYear);
|
|
75
128
|
const wageIndexLastYear = wageIndexEntry.awi;
|
|
76
129
|
// Calculate bend points (rounded to nearest dollar per SSA rules)
|
|
77
130
|
const firstBendPoint = Math.round(FIRST_BEND_POINT_MULTIPLIER * wageIndexLastYear / BEND_POINT_DIVISOR);
|
|
@@ -93,15 +146,13 @@ export function calculatePIA(AIME, baseYear) {
|
|
|
93
146
|
}
|
|
94
147
|
return roundToFloorTenCents(monthlyBenefit);
|
|
95
148
|
}
|
|
96
|
-
|
|
149
|
+
// AIME calculation
|
|
150
|
+
export function calculateAIME(earnings, lookbackYears, baseYear) {
|
|
97
151
|
if (!earnings || earnings.length === 0) {
|
|
98
152
|
return 0;
|
|
99
153
|
}
|
|
100
154
|
const effectiveYear = baseYear ? Math.min(baseYear, WAGE_INDEX_CUTOFF) : WAGE_INDEX_CUTOFF;
|
|
101
|
-
const wageIndexEntry =
|
|
102
|
-
if (!wageIndexEntry) {
|
|
103
|
-
throw new Error(`No wage index data found for year ${effectiveYear}`);
|
|
104
|
-
}
|
|
155
|
+
const wageIndexEntry = getWageIndexEntry(effectiveYear);
|
|
105
156
|
const wageIndexLastYear = wageIndexEntry.awi;
|
|
106
157
|
const futureYearsFactor = 1;
|
|
107
158
|
// Calculate wage index factors
|
|
@@ -114,15 +165,27 @@ export function calculateAIME(earnings, baseYear) {
|
|
|
114
165
|
acc[year] = earnings * (wageIndexFactors[year] || futureYearsFactor);
|
|
115
166
|
return acc;
|
|
116
167
|
}, {});
|
|
117
|
-
// Get top
|
|
118
|
-
const
|
|
168
|
+
// Get top years of earnings based on lookback period
|
|
169
|
+
const topYearsEarningsArr = Object.values(adjustedEarnings)
|
|
119
170
|
.sort((a, b) => b - a)
|
|
120
|
-
.slice(0,
|
|
121
|
-
const totalEarnings =
|
|
171
|
+
.slice(0, lookbackYears);
|
|
172
|
+
const totalEarnings = topYearsEarningsArr.reduce((sum, earnings) => sum + earnings, 0);
|
|
122
173
|
// Calculate AIME (rounded down to next lower dollar)
|
|
123
|
-
|
|
124
|
-
|
|
174
|
+
return Math.floor(totalEarnings / (12 * lookbackYears));
|
|
175
|
+
}
|
|
176
|
+
// Lookback year calculations
|
|
177
|
+
export function getLookbackYears(elapsedYears) {
|
|
178
|
+
const minComputationYears = 2;
|
|
179
|
+
const adjustedLookbackYears = Math.floor(elapsedYears) - 5;
|
|
180
|
+
return Math.max(minComputationYears, adjustedLookbackYears);
|
|
125
181
|
}
|
|
182
|
+
export function getLookbackYearsDisability(elapsedYears) {
|
|
183
|
+
const minComputationYears = 2;
|
|
184
|
+
const dropOutYears = Math.min(Math.floor(elapsedYears / DROP_OUT_YEARS_DIVISOR), MAX_DROP_OUT_YEARS);
|
|
185
|
+
const adjustedLookbackYears = elapsedYears - dropOutYears;
|
|
186
|
+
return Math.max(minComputationYears, adjustedLookbackYears);
|
|
187
|
+
}
|
|
188
|
+
// Early retirement reduction
|
|
126
189
|
function calculateEarlyRetirementReduction(amount, months) {
|
|
127
190
|
if (months <= 0)
|
|
128
191
|
return amount;
|
|
@@ -137,6 +200,7 @@ function calculateEarlyRetirementReduction(amount, months) {
|
|
|
137
200
|
}
|
|
138
201
|
return amount * (1 - reduction);
|
|
139
202
|
}
|
|
203
|
+
// Delayed retirement increase
|
|
140
204
|
function calculateDelayedRetirementIncrease(birthday, initialAmount, numberOfMonths) {
|
|
141
205
|
if (numberOfMonths <= 0)
|
|
142
206
|
return initialAmount;
|
|
@@ -145,11 +209,11 @@ function calculateDelayedRetirementIncrease(birthday, initialAmount, numberOfMon
|
|
|
145
209
|
const totalIncrease = monthlyRate * numberOfMonths;
|
|
146
210
|
return initialAmount * (1 + totalIncrease);
|
|
147
211
|
}
|
|
212
|
+
// Delayed retirement rate lookup
|
|
148
213
|
function getDelayedRetirementRate(birthYear) {
|
|
149
214
|
if (birthYear < 1933) {
|
|
150
215
|
throw new Error(`Invalid birth year for delayed retirement: ${birthYear}`);
|
|
151
216
|
}
|
|
152
|
-
// Rates based on SSA rules
|
|
153
217
|
if (birthYear <= 1934)
|
|
154
218
|
return 11 / 24 / 100; // 11/24 of 1%
|
|
155
219
|
if (birthYear <= 1936)
|
|
@@ -162,30 +226,19 @@ function getDelayedRetirementRate(birthYear) {
|
|
|
162
226
|
return 5 / 8 / 100; // 5/8 of 1%
|
|
163
227
|
return 2 / 3 / 100; // 2/3 of 1%
|
|
164
228
|
}
|
|
165
|
-
|
|
166
|
-
// Convert to dimes, floor, then convert back to dollars
|
|
167
|
-
return Math.floor(amount * 10) / 10;
|
|
168
|
-
}
|
|
169
|
-
export function getEnglishCommonLawDate(date) {
|
|
170
|
-
// Create a new date to avoid mutating the original
|
|
171
|
-
const eclDate = new Date(date);
|
|
172
|
-
eclDate.setDate(eclDate.getDate() - 1);
|
|
173
|
-
return eclDate;
|
|
174
|
-
}
|
|
229
|
+
// Full retirement age calculation
|
|
175
230
|
export function getFullRetirementMonths(commonLawBirthDate) {
|
|
176
231
|
const year = commonLawBirthDate.getFullYear();
|
|
177
232
|
if (year <= 1937) {
|
|
178
233
|
return 65 * 12;
|
|
179
234
|
}
|
|
180
235
|
else if (year <= 1942) {
|
|
181
|
-
// Gradual increase from 65 years to 65 years 10 months
|
|
182
236
|
return ((year - 1937) * 2) + (65 * 12);
|
|
183
237
|
}
|
|
184
238
|
else if (year <= 1954) {
|
|
185
239
|
return 66 * 12;
|
|
186
240
|
}
|
|
187
241
|
else if (year <= 1959) {
|
|
188
|
-
// Gradual increase from 66 years to 66 years 10 months
|
|
189
242
|
return ((year - 1954) * 2) + (66 * 12);
|
|
190
243
|
}
|
|
191
244
|
else if (year >= 1960) {
|
|
@@ -195,8 +248,42 @@ export function getFullRetirementMonths(commonLawBirthDate) {
|
|
|
195
248
|
throw new Error(`Invalid birth year: ${year}`);
|
|
196
249
|
}
|
|
197
250
|
}
|
|
251
|
+
/** Compute Family-Max bend points for an eligibility year given AWI_{year-2}. */
|
|
252
|
+
export function getFamilyMaxBendPoints(baseYear) {
|
|
253
|
+
const [f1, f2, f3] = FAM_MAX_BASES.map(b => Math.round((b * baseYear / BEND_POINT_DIVISOR)));
|
|
254
|
+
return [f1, f2, f3];
|
|
255
|
+
}
|
|
256
|
+
/** Apply the family-maximum formula to a PIA using already-computed bend points. */
|
|
257
|
+
export function calculateFamilyMaximum(pia, [bp1, bp2, bp3]) {
|
|
258
|
+
let max = 0;
|
|
259
|
+
max += 1.50 * Math.min(pia, bp1);
|
|
260
|
+
if (pia > bp1)
|
|
261
|
+
max += 2.72 * (Math.min(pia, bp2) - bp1);
|
|
262
|
+
if (pia > bp2)
|
|
263
|
+
max += 1.34 * (Math.min(pia, bp3) - bp2);
|
|
264
|
+
if (pia > bp3)
|
|
265
|
+
max += 1.75 * (pia - bp3);
|
|
266
|
+
// SSA: round total down to next lower $0.10
|
|
267
|
+
return Math.floor(max * 10) / 10;
|
|
268
|
+
}
|
|
269
|
+
// Utility functions
|
|
270
|
+
export function getEnglishCommonLawDate(date) {
|
|
271
|
+
const eclDate = new Date(date);
|
|
272
|
+
eclDate.setDate(eclDate.getDate() - 1);
|
|
273
|
+
return eclDate;
|
|
274
|
+
}
|
|
198
275
|
function monthsDifference(date1, date2) {
|
|
199
276
|
const months1 = date1.getFullYear() * 12 + date1.getMonth();
|
|
200
277
|
const months2 = date2.getFullYear() * 12 + date2.getMonth();
|
|
201
278
|
return months1 - months2;
|
|
202
279
|
}
|
|
280
|
+
function roundToFloorTenCents(amount) {
|
|
281
|
+
return Math.floor(amount * 10) / 10;
|
|
282
|
+
}
|
|
283
|
+
function getWageIndexEntry(effectiveYear) {
|
|
284
|
+
const wageIndexEntry = wageIndex.find(val => val.year === effectiveYear);
|
|
285
|
+
if (!wageIndexEntry) {
|
|
286
|
+
throw new Error(`No wage index data found for year ${effectiveYear}`);
|
|
287
|
+
}
|
|
288
|
+
return wageIndexEntry;
|
|
289
|
+
}
|
package/lib/model.d.ts
CHANGED
|
@@ -2,23 +2,29 @@ export type Earnings = {
|
|
|
2
2
|
year: number;
|
|
3
3
|
earnings: number;
|
|
4
4
|
}[];
|
|
5
|
-
export type
|
|
5
|
+
export type WageIndex = {
|
|
6
6
|
year: number;
|
|
7
|
-
retirement: number;
|
|
8
|
-
disability: number;
|
|
9
|
-
survivors: number;
|
|
10
7
|
taxMax: number;
|
|
11
8
|
cola: number;
|
|
12
9
|
awi: number;
|
|
13
10
|
};
|
|
14
|
-
export type Wages = Wage[];
|
|
15
11
|
export interface BenefitCalculationResult {
|
|
16
12
|
AIME: number;
|
|
13
|
+
PIA: number;
|
|
17
14
|
NormalMonthlyBenefit: number;
|
|
15
|
+
DisabilityEarnings: number;
|
|
16
|
+
SurvivorBenefits: {
|
|
17
|
+
survivingChild: number;
|
|
18
|
+
careGivingSpouse: number;
|
|
19
|
+
normalRetirementSpouse: number;
|
|
20
|
+
familyMaximum: number;
|
|
21
|
+
};
|
|
18
22
|
}
|
|
19
23
|
export interface RetirementDates {
|
|
20
24
|
earliestRetirement: Date;
|
|
21
25
|
fullRetirement: Date;
|
|
22
26
|
maxRetirement: Date;
|
|
23
27
|
adjusted: Date;
|
|
28
|
+
eclBirthDate: Date;
|
|
29
|
+
retirementDate: Date;
|
|
24
30
|
}
|
package/lib/wage-index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const wageIndex:
|
|
3
|
-
export declare const wageIndexFuture: Partial<
|
|
1
|
+
import { WageIndex } from './model';
|
|
2
|
+
export declare const wageIndex: WageIndex[];
|
|
3
|
+
export declare const wageIndexFuture: Partial<WageIndex>[];
|
package/lib/wage-index.js
CHANGED
|
@@ -2,675 +2,450 @@
|
|
|
2
2
|
export const wageIndex = [
|
|
3
3
|
{
|
|
4
4
|
"year": 1951,
|
|
5
|
-
"retirement": 1802.95,
|
|
6
|
-
"disability": 1802.95,
|
|
7
|
-
"survivors": 1802.95,
|
|
8
5
|
"taxMax": 3600,
|
|
9
6
|
"cola": 0,
|
|
10
7
|
"awi": 2799.16
|
|
11
8
|
},
|
|
12
9
|
{
|
|
13
10
|
"year": 1952,
|
|
14
|
-
"retirement": 1697.35,
|
|
15
|
-
"disability": 1697.35,
|
|
16
|
-
"survivors": 1697.35,
|
|
17
11
|
"taxMax": 3600,
|
|
18
12
|
"cola": 0,
|
|
19
13
|
"awi": 2973.32
|
|
20
14
|
},
|
|
21
15
|
{
|
|
22
16
|
"year": 1953,
|
|
23
|
-
"retirement": 1607.53,
|
|
24
|
-
"disability": 1607.53,
|
|
25
|
-
"survivors": 1607.53,
|
|
26
17
|
"taxMax": 3600,
|
|
27
18
|
"cola": 0,
|
|
28
19
|
"awi": 3139.44
|
|
29
20
|
},
|
|
30
21
|
{
|
|
31
22
|
"year": 1954,
|
|
32
|
-
"retirement": 1599.28,
|
|
33
|
-
"disability": 1599.28,
|
|
34
|
-
"survivors": 1599.28,
|
|
35
23
|
"taxMax": 3600,
|
|
36
24
|
"cola": 0,
|
|
37
25
|
"awi": 3155.64
|
|
38
26
|
},
|
|
39
27
|
{
|
|
40
28
|
"year": 1955,
|
|
41
|
-
"retirement": 13757.87,
|
|
42
|
-
"disability": 13757.87,
|
|
43
|
-
"survivors": 13757.87,
|
|
44
29
|
"taxMax": 4200,
|
|
45
30
|
"cola": 0,
|
|
46
31
|
"awi": 3301.44
|
|
47
32
|
},
|
|
48
33
|
{
|
|
49
34
|
"year": 1956,
|
|
50
|
-
"retirement": 13810.96,
|
|
51
|
-
"disability": 13810.96,
|
|
52
|
-
"survivors": 13810.96,
|
|
53
35
|
"taxMax": 4200,
|
|
54
36
|
"cola": 0,
|
|
55
37
|
"awi": 3532.36
|
|
56
38
|
},
|
|
57
39
|
{
|
|
58
40
|
"year": 1957,
|
|
59
|
-
"retirement": 14320.1,
|
|
60
|
-
"disability": 14320.1,
|
|
61
|
-
"survivors": 14320.1,
|
|
62
41
|
"taxMax": 4200,
|
|
63
42
|
"cola": 0,
|
|
64
43
|
"awi": 3641.72
|
|
65
44
|
},
|
|
66
45
|
{
|
|
67
46
|
"year": 1958,
|
|
68
|
-
"retirement": 14195.05,
|
|
69
|
-
"disability": 14195.05,
|
|
70
|
-
"survivors": 14195.05,
|
|
71
47
|
"taxMax": 4200,
|
|
72
48
|
"cola": 0,
|
|
73
49
|
"awi": 3673.8
|
|
74
50
|
},
|
|
75
51
|
{
|
|
76
52
|
"year": 1959,
|
|
77
|
-
"retirement": 14833.9,
|
|
78
|
-
"disability": 14833.9,
|
|
79
|
-
"survivors": 14833.9,
|
|
80
53
|
"taxMax": 4800,
|
|
81
54
|
"cola": 0,
|
|
82
55
|
"awi": 3855.8
|
|
83
56
|
},
|
|
84
57
|
{
|
|
85
58
|
"year": 1960,
|
|
86
|
-
"retirement": 15113.36,
|
|
87
|
-
"disability": 15113.36,
|
|
88
|
-
"survivors": 15113.36,
|
|
89
59
|
"taxMax": 4800,
|
|
90
60
|
"cola": 0,
|
|
91
61
|
"awi": 4007.12
|
|
92
62
|
},
|
|
93
63
|
{
|
|
94
64
|
"year": 1961,
|
|
95
|
-
"retirement": 15230.47,
|
|
96
|
-
"disability": 15230.47,
|
|
97
|
-
"survivors": 15230.47,
|
|
98
65
|
"taxMax": 4800,
|
|
99
66
|
"cola": 0,
|
|
100
67
|
"awi": 4086.76
|
|
101
68
|
},
|
|
102
69
|
{
|
|
103
70
|
"year": 1962,
|
|
104
|
-
"retirement": 15680.21,
|
|
105
|
-
"disability": 15680.21,
|
|
106
|
-
"survivors": 15680.21,
|
|
107
71
|
"taxMax": 4800,
|
|
108
72
|
"cola": 0,
|
|
109
73
|
"awi": 4291.4
|
|
110
74
|
},
|
|
111
75
|
{
|
|
112
76
|
"year": 1963,
|
|
113
|
-
"retirement": 16070.12,
|
|
114
|
-
"disability": 16070.12,
|
|
115
|
-
"survivors": 16070.12,
|
|
116
77
|
"taxMax": 4800,
|
|
117
78
|
"cola": 0,
|
|
118
79
|
"awi": 4396.64
|
|
119
80
|
},
|
|
120
81
|
{
|
|
121
82
|
"year": 1964,
|
|
122
|
-
"retirement": 16174.36,
|
|
123
|
-
"disability": 16174.36,
|
|
124
|
-
"survivors": 16174.36,
|
|
125
83
|
"taxMax": 4800,
|
|
126
84
|
"cola": 0,
|
|
127
85
|
"awi": 4576.32
|
|
128
86
|
},
|
|
129
87
|
{
|
|
130
88
|
"year": 1965,
|
|
131
|
-
"retirement": 16610.47,
|
|
132
|
-
"disability": 16610.47,
|
|
133
|
-
"survivors": 16610.47,
|
|
134
89
|
"taxMax": 4800,
|
|
135
90
|
"cola": 0,
|
|
136
91
|
"awi": 4658.72
|
|
137
92
|
},
|
|
138
93
|
{
|
|
139
94
|
"year": 1966,
|
|
140
|
-
"retirement": 17032.49,
|
|
141
|
-
"disability": 17032.49,
|
|
142
|
-
"survivors": 17032.49,
|
|
143
95
|
"taxMax": 6600,
|
|
144
96
|
"cola": 0,
|
|
145
97
|
"awi": 4938.36
|
|
146
98
|
},
|
|
147
99
|
{
|
|
148
100
|
"year": 1967,
|
|
149
|
-
"retirement": 17101.82,
|
|
150
|
-
"disability": 17101.82,
|
|
151
|
-
"survivors": 17101.82,
|
|
152
101
|
"taxMax": 6600,
|
|
153
102
|
"cola": 0,
|
|
154
103
|
"awi": 5213.44
|
|
155
104
|
},
|
|
156
105
|
{
|
|
157
106
|
"year": 1968,
|
|
158
|
-
"retirement": 17511.62,
|
|
159
|
-
"disability": 17511.62,
|
|
160
|
-
"survivors": 17511.62,
|
|
161
107
|
"taxMax": 7800,
|
|
162
108
|
"cola": 0,
|
|
163
109
|
"awi": 5571.76
|
|
164
110
|
},
|
|
165
111
|
{
|
|
166
112
|
"year": 1969,
|
|
167
|
-
"retirement": 17982.04,
|
|
168
|
-
"disability": 17982.04,
|
|
169
|
-
"survivors": 17982.04,
|
|
170
113
|
"taxMax": 7800,
|
|
171
114
|
"cola": 0,
|
|
172
115
|
"awi": 5893.76
|
|
173
116
|
},
|
|
174
117
|
{
|
|
175
118
|
"year": 1970,
|
|
176
|
-
"retirement": 18219.6,
|
|
177
|
-
"disability": 18219.6,
|
|
178
|
-
"survivors": 18219.6,
|
|
179
119
|
"taxMax": 7800,
|
|
180
120
|
"cola": 0,
|
|
181
121
|
"awi": 6186.24
|
|
182
122
|
},
|
|
183
123
|
{
|
|
184
124
|
"year": 1971,
|
|
185
|
-
"retirement": 18642.54,
|
|
186
|
-
"disability": 18642.54,
|
|
187
|
-
"survivors": 18642.54,
|
|
188
125
|
"taxMax": 7800,
|
|
189
126
|
"cola": 0,
|
|
190
127
|
"awi": 6497.08
|
|
191
128
|
},
|
|
192
129
|
{
|
|
193
130
|
"year": 1972,
|
|
194
|
-
"retirement": 19100.95,
|
|
195
|
-
"disability": 19100.95,
|
|
196
|
-
"survivors": 19100.95,
|
|
197
131
|
"taxMax": 9000,
|
|
198
132
|
"cola": 0,
|
|
199
133
|
"awi": 7133.8
|
|
200
134
|
},
|
|
201
135
|
{
|
|
202
136
|
"year": 1973,
|
|
203
|
-
"retirement": 19307.75,
|
|
204
|
-
"disability": 19307.75,
|
|
205
|
-
"survivors": 19307.75,
|
|
206
137
|
"taxMax": 10800,
|
|
207
138
|
"cola": 0,
|
|
208
139
|
"awi": 7580.16
|
|
209
140
|
},
|
|
210
141
|
{
|
|
211
142
|
"year": 1974,
|
|
212
|
-
"retirement": 19690.74,
|
|
213
|
-
"disability": 19690.74,
|
|
214
|
-
"survivors": 19690.74,
|
|
215
143
|
"taxMax": 13200,
|
|
216
144
|
"cola": 0,
|
|
217
145
|
"awi": 8030.76
|
|
218
146
|
},
|
|
219
147
|
{
|
|
220
148
|
"year": 1975,
|
|
221
|
-
"retirement": 20270.62,
|
|
222
|
-
"disability": 20270.62,
|
|
223
|
-
"survivors": 20270.62,
|
|
224
149
|
"taxMax": 14100,
|
|
225
150
|
"cola": 8,
|
|
226
151
|
"awi": 8630.92
|
|
227
152
|
},
|
|
228
153
|
{
|
|
229
154
|
"year": 1976,
|
|
230
|
-
"retirement": 20603.13,
|
|
231
|
-
"disability": 20603.13,
|
|
232
|
-
"survivors": 20603.13,
|
|
233
155
|
"taxMax": 15300,
|
|
234
156
|
"cola": 6.4,
|
|
235
157
|
"awi": 9226.48
|
|
236
158
|
},
|
|
237
159
|
{
|
|
238
160
|
"year": 1977,
|
|
239
|
-
"retirement": 20986.34,
|
|
240
|
-
"disability": 20986.34,
|
|
241
|
-
"survivors": 20986.34,
|
|
242
161
|
"taxMax": 16500,
|
|
243
162
|
"cola": 5.9,
|
|
244
163
|
"awi": 9779.44
|
|
245
164
|
},
|
|
246
165
|
{
|
|
247
166
|
"year": 1978,
|
|
248
|
-
"retirement": 21354.77,
|
|
249
|
-
"disability": 21354.77,
|
|
250
|
-
"survivors": 21354.77,
|
|
251
167
|
"taxMax": 17700,
|
|
252
168
|
"cola": 6.5,
|
|
253
169
|
"awi": 10556.03
|
|
254
170
|
},
|
|
255
171
|
{
|
|
256
172
|
"year": 1979,
|
|
257
|
-
"retirement": 21835.12,
|
|
258
|
-
"disability": 21835.12,
|
|
259
|
-
"survivors": 21835.12,
|
|
260
173
|
"taxMax": 22900,
|
|
261
174
|
"cola": 9.9,
|
|
262
175
|
"awi": 11479.46
|
|
263
176
|
},
|
|
264
177
|
{
|
|
265
178
|
"year": 1980,
|
|
266
|
-
"retirement": 22316.26,
|
|
267
|
-
"disability": 22316.26,
|
|
268
|
-
"survivors": 22316.26,
|
|
269
179
|
"taxMax": 25900,
|
|
270
180
|
"cola": 14.3,
|
|
271
181
|
"awi": 12513.46
|
|
272
182
|
},
|
|
273
183
|
{
|
|
274
184
|
"year": 1981,
|
|
275
|
-
"retirement": 22718.1,
|
|
276
|
-
"disability": 22718.1,
|
|
277
|
-
"survivors": 22718.1,
|
|
278
185
|
"taxMax": 29700,
|
|
279
186
|
"cola": 11.2,
|
|
280
187
|
"awi": 13773.1
|
|
281
188
|
},
|
|
282
189
|
{
|
|
283
190
|
"year": 1982,
|
|
284
|
-
"retirement": 23153.42,
|
|
285
|
-
"disability": 23153.42,
|
|
286
|
-
"survivors": 23153.42,
|
|
287
191
|
"taxMax": 32400,
|
|
288
192
|
"cola": 7.4,
|
|
289
193
|
"awi": 14531.34
|
|
290
194
|
},
|
|
291
195
|
{
|
|
292
196
|
"year": 1983,
|
|
293
|
-
"retirement": 23623.34,
|
|
294
|
-
"disability": 23623.34,
|
|
295
|
-
"survivors": 23623.34,
|
|
296
197
|
"taxMax": 35700,
|
|
297
198
|
"cola": 3.5,
|
|
298
199
|
"awi": 15239.24
|
|
299
200
|
},
|
|
300
201
|
{
|
|
301
202
|
"year": 1984,
|
|
302
|
-
"retirement": 24084.18,
|
|
303
|
-
"disability": 24084.18,
|
|
304
|
-
"survivors": 24084.18,
|
|
305
203
|
"taxMax": 37800,
|
|
306
204
|
"cola": 3.5,
|
|
307
205
|
"awi": 16135.07
|
|
308
206
|
},
|
|
309
207
|
{
|
|
310
208
|
"year": 1985,
|
|
311
|
-
"retirement": 24600,
|
|
312
|
-
"disability": 24600,
|
|
313
|
-
"survivors": 24600,
|
|
314
209
|
"taxMax": 39600,
|
|
315
210
|
"cola": 3.1,
|
|
316
211
|
"awi": 16822.51
|
|
317
212
|
},
|
|
318
213
|
{
|
|
319
214
|
"year": 1986,
|
|
320
|
-
"retirement": 25800,
|
|
321
|
-
"disability": 25800,
|
|
322
|
-
"survivors": 25800,
|
|
323
215
|
"taxMax": 42000,
|
|
324
216
|
"cola": 1.3,
|
|
325
217
|
"awi": 17321.82
|
|
326
218
|
},
|
|
327
219
|
{
|
|
328
220
|
"year": 1987,
|
|
329
|
-
"retirement": 28000,
|
|
330
|
-
"disability": 28000,
|
|
331
|
-
"survivors": 28000,
|
|
332
221
|
"taxMax": 43800,
|
|
333
222
|
"cola": 4.2,
|
|
334
223
|
"awi": 18426.51
|
|
335
224
|
},
|
|
336
225
|
{
|
|
337
226
|
"year": 1988,
|
|
338
|
-
"retirement": 30000,
|
|
339
|
-
"disability": 30000,
|
|
340
|
-
"survivors": 30000,
|
|
341
227
|
"taxMax": 45000,
|
|
342
228
|
"cola": 4,
|
|
343
229
|
"awi": 19334.04
|
|
344
230
|
},
|
|
345
231
|
{
|
|
346
232
|
"year": 1989,
|
|
347
|
-
"retirement": 31800,
|
|
348
|
-
"disability": 31800,
|
|
349
|
-
"survivors": 31800,
|
|
350
233
|
"taxMax": 48000,
|
|
351
234
|
"cola": 4.7,
|
|
352
235
|
"awi": 20099.55
|
|
353
236
|
},
|
|
354
237
|
{
|
|
355
238
|
"year": 1990,
|
|
356
|
-
"retirement": 34000,
|
|
357
|
-
"disability": 34000,
|
|
358
|
-
"survivors": 34000,
|
|
359
239
|
"taxMax": 51300,
|
|
360
240
|
"cola": 5.4,
|
|
361
241
|
"awi": 21027.98
|
|
362
242
|
},
|
|
363
243
|
{
|
|
364
244
|
"year": 1991,
|
|
365
|
-
"retirement": 35900,
|
|
366
|
-
"disability": 35900,
|
|
367
|
-
"survivors": 35900,
|
|
368
245
|
"taxMax": 53400,
|
|
369
246
|
"cola": 3.7,
|
|
370
247
|
"awi": 21811.6
|
|
371
248
|
},
|
|
372
249
|
{
|
|
373
250
|
"year": 1992,
|
|
374
|
-
"retirement": 38500,
|
|
375
|
-
"disability": 38500,
|
|
376
|
-
"survivors": 38500,
|
|
377
251
|
"taxMax": 55500,
|
|
378
252
|
"cola": 3,
|
|
379
253
|
"awi": 22935.42
|
|
380
254
|
},
|
|
381
255
|
{
|
|
382
256
|
"year": 1993,
|
|
383
|
-
"retirement": 39600,
|
|
384
|
-
"disability": 39600,
|
|
385
|
-
"survivors": 39600,
|
|
386
257
|
"taxMax": 57600,
|
|
387
258
|
"cola": 2.6,
|
|
388
259
|
"awi": 23132.67
|
|
389
260
|
},
|
|
390
261
|
{
|
|
391
262
|
"year": 1994,
|
|
392
|
-
"retirement": 41500,
|
|
393
|
-
"disability": 41500,
|
|
394
|
-
"survivors": 41500,
|
|
395
263
|
"taxMax": 60600,
|
|
396
264
|
"cola": 2.8,
|
|
397
265
|
"awi": 23753.53
|
|
398
266
|
},
|
|
399
267
|
{
|
|
400
268
|
"year": 1995,
|
|
401
|
-
"retirement": 44000,
|
|
402
|
-
"disability": 44000,
|
|
403
|
-
"survivors": 44000,
|
|
404
269
|
"taxMax": 61200,
|
|
405
270
|
"cola": 2.6,
|
|
406
271
|
"awi": 24705.66
|
|
407
272
|
},
|
|
408
273
|
{
|
|
409
274
|
"year": 1996,
|
|
410
|
-
"retirement": 47100,
|
|
411
|
-
"disability": 47100,
|
|
412
|
-
"survivors": 47100,
|
|
413
275
|
"taxMax": 62700,
|
|
414
276
|
"cola": 2.9,
|
|
415
277
|
"awi": 25913.9
|
|
416
278
|
},
|
|
417
279
|
{
|
|
418
280
|
"year": 1997,
|
|
419
|
-
"retirement": 50900,
|
|
420
|
-
"disability": 50900,
|
|
421
|
-
"survivors": 50900,
|
|
422
281
|
"taxMax": 65400,
|
|
423
282
|
"cola": 2.1,
|
|
424
283
|
"awi": 27426
|
|
425
284
|
},
|
|
426
285
|
{
|
|
427
286
|
"year": 1998,
|
|
428
|
-
"retirement": 54600,
|
|
429
|
-
"disability": 54600,
|
|
430
|
-
"survivors": 54600,
|
|
431
287
|
"taxMax": 68400,
|
|
432
288
|
"cola": 1.3,
|
|
433
289
|
"awi": 28861.44
|
|
434
290
|
},
|
|
435
291
|
{
|
|
436
292
|
"year": 1999,
|
|
437
|
-
"retirement": 58800,
|
|
438
|
-
"disability": 58800,
|
|
439
|
-
"survivors": 58800,
|
|
440
293
|
"taxMax": 72600,
|
|
441
294
|
"cola": 2.5,
|
|
442
295
|
"awi": 30469.84
|
|
443
296
|
},
|
|
444
297
|
{
|
|
445
298
|
"year": 2000,
|
|
446
|
-
"retirement": 63300,
|
|
447
|
-
"disability": 63300,
|
|
448
|
-
"survivors": 63300,
|
|
449
299
|
"taxMax": 76200,
|
|
450
300
|
"cola": 3.5,
|
|
451
301
|
"awi": 32154.82
|
|
452
302
|
},
|
|
453
303
|
{
|
|
454
304
|
"year": 2001,
|
|
455
|
-
"retirement": 66100,
|
|
456
|
-
"disability": 66100,
|
|
457
|
-
"survivors": 66100,
|
|
458
305
|
"taxMax": 80400,
|
|
459
306
|
"cola": 2.6,
|
|
460
307
|
"awi": 32921.92
|
|
461
308
|
},
|
|
462
309
|
{
|
|
463
310
|
"year": 2002,
|
|
464
|
-
"retirement": 68100,
|
|
465
|
-
"disability": 68100,
|
|
466
|
-
"survivors": 68100,
|
|
467
311
|
"taxMax": 84900,
|
|
468
312
|
"cola": 1.4,
|
|
469
313
|
"awi": 33252.09
|
|
470
314
|
},
|
|
471
315
|
{
|
|
472
316
|
"year": 2003,
|
|
473
|
-
"retirement": 71200,
|
|
474
|
-
"disability": 71200,
|
|
475
|
-
"survivors": 71200,
|
|
476
317
|
"taxMax": 87000,
|
|
477
318
|
"cola": 2.1,
|
|
478
319
|
"awi": 34064.95
|
|
479
320
|
},
|
|
480
321
|
{
|
|
481
322
|
"year": 2004,
|
|
482
|
-
"retirement": 76000,
|
|
483
|
-
"disability": 76000,
|
|
484
|
-
"survivors": 76000,
|
|
485
323
|
"taxMax": 87900,
|
|
486
324
|
"cola": 2.7,
|
|
487
325
|
"awi": 35648.55
|
|
488
326
|
},
|
|
489
327
|
{
|
|
490
328
|
"year": 2005,
|
|
491
|
-
"retirement": 80300,
|
|
492
|
-
"disability": 80300,
|
|
493
|
-
"survivors": 80300,
|
|
494
329
|
"taxMax": 90000,
|
|
495
330
|
"cola": 4.1,
|
|
496
331
|
"awi": 36952.94
|
|
497
332
|
},
|
|
498
333
|
{
|
|
499
334
|
"year": 2006,
|
|
500
|
-
"retirement": 85700,
|
|
501
|
-
"disability": 85700,
|
|
502
|
-
"survivors": 85700,
|
|
503
335
|
"taxMax": 94200,
|
|
504
336
|
"cola": 3.3,
|
|
505
337
|
"awi": 38651.41
|
|
506
338
|
},
|
|
507
339
|
{
|
|
508
340
|
"year": 2007,
|
|
509
|
-
"retirement": 91400,
|
|
510
|
-
"disability": 91400,
|
|
511
|
-
"survivors": 91400,
|
|
512
341
|
"taxMax": 97500,
|
|
513
342
|
"cola": 2.3,
|
|
514
343
|
"awi": 40405.48
|
|
515
344
|
},
|
|
516
345
|
{
|
|
517
346
|
"year": 2008,
|
|
518
|
-
"retirement": 95300,
|
|
519
|
-
"disability": 95300,
|
|
520
|
-
"survivors": 95300,
|
|
521
347
|
"taxMax": 102000,
|
|
522
348
|
"cola": 5.8,
|
|
523
349
|
"awi": 41334.97
|
|
524
350
|
},
|
|
525
351
|
{
|
|
526
352
|
"year": 2009,
|
|
527
|
-
"retirement": 95800,
|
|
528
|
-
"disability": 95800,
|
|
529
|
-
"survivors": 95800,
|
|
530
353
|
"taxMax": 106800,
|
|
531
354
|
"cola": 0,
|
|
532
355
|
"awi": 40711.61
|
|
533
356
|
},
|
|
534
357
|
{
|
|
535
358
|
"year": 2010,
|
|
536
|
-
"retirement": 100000,
|
|
537
|
-
"disability": 100000,
|
|
538
|
-
"survivors": 100000,
|
|
539
359
|
"taxMax": 106800,
|
|
540
360
|
"cola": 0,
|
|
541
361
|
"awi": 41673.83
|
|
542
362
|
},
|
|
543
363
|
{
|
|
544
364
|
"year": 2011,
|
|
545
|
-
"retirement": 0,
|
|
546
|
-
"disability": 0,
|
|
547
|
-
"survivors": 0,
|
|
548
365
|
"taxMax": 106800,
|
|
549
366
|
"cola": 3.6,
|
|
550
367
|
"awi": 42979.61
|
|
551
368
|
},
|
|
552
369
|
{
|
|
553
370
|
"year": 2012,
|
|
554
|
-
"retirement": 0,
|
|
555
|
-
"disability": 0,
|
|
556
|
-
"survivors": 0,
|
|
557
371
|
"taxMax": 110100,
|
|
558
372
|
"cola": 1.7,
|
|
559
373
|
"awi": 44321.67
|
|
560
374
|
},
|
|
561
375
|
{
|
|
562
376
|
"year": 2013,
|
|
563
|
-
"retirement": 0,
|
|
564
|
-
"disability": 0,
|
|
565
|
-
"survivors": 0,
|
|
566
377
|
"taxMax": 113700,
|
|
567
378
|
"cola": 1.5,
|
|
568
379
|
"awi": 44888.16
|
|
569
380
|
},
|
|
570
381
|
{
|
|
571
382
|
"year": 2014,
|
|
572
|
-
"retirement": 0,
|
|
573
|
-
"disability": 0,
|
|
574
|
-
"survivors": 0,
|
|
575
383
|
"taxMax": 117000,
|
|
576
384
|
"cola": 1.7,
|
|
577
385
|
"awi": 46481.52
|
|
578
386
|
},
|
|
579
387
|
{
|
|
580
388
|
"year": 2015,
|
|
581
|
-
"retirement": 0,
|
|
582
|
-
"disability": 0,
|
|
583
|
-
"survivors": 0,
|
|
584
389
|
"taxMax": 118500,
|
|
585
390
|
"cola": 0,
|
|
586
391
|
"awi": 48098.63
|
|
587
392
|
},
|
|
588
393
|
{
|
|
589
394
|
"year": 2016,
|
|
590
|
-
"retirement": 0,
|
|
591
|
-
"disability": 0,
|
|
592
|
-
"survivors": 0,
|
|
593
395
|
"taxMax": 118500,
|
|
594
396
|
"cola": 0.3,
|
|
595
397
|
"awi": 48642.15
|
|
596
398
|
},
|
|
597
399
|
{
|
|
598
400
|
"year": 2017,
|
|
599
|
-
"retirement": 0,
|
|
600
|
-
"disability": 0,
|
|
601
|
-
"survivors": 0,
|
|
602
401
|
"taxMax": 127200,
|
|
603
402
|
"cola": 2,
|
|
604
403
|
"awi": 50321.89
|
|
605
404
|
},
|
|
606
405
|
{
|
|
607
406
|
"year": 2018,
|
|
608
|
-
"retirement": 0,
|
|
609
|
-
"disability": 0,
|
|
610
|
-
"survivors": 0,
|
|
611
407
|
"taxMax": 128400,
|
|
612
408
|
"cola": 2.8,
|
|
613
409
|
"awi": 52145.8
|
|
614
410
|
},
|
|
615
411
|
{
|
|
616
412
|
"year": 2019,
|
|
617
|
-
"retirement": 0,
|
|
618
|
-
"disability": 0,
|
|
619
|
-
"survivors": 0,
|
|
620
413
|
"taxMax": 132900,
|
|
621
414
|
"cola": 1.6,
|
|
622
415
|
"awi": 54099.99
|
|
623
416
|
},
|
|
624
417
|
{
|
|
625
418
|
"year": 2020,
|
|
626
|
-
"retirement": 0,
|
|
627
|
-
"disability": 0,
|
|
628
|
-
"survivors": 0,
|
|
629
419
|
"taxMax": 137700,
|
|
630
420
|
"cola": 1.3,
|
|
631
421
|
"awi": 55628.6
|
|
632
422
|
},
|
|
633
423
|
{
|
|
634
424
|
"year": 2021,
|
|
635
|
-
"retirement": 0,
|
|
636
|
-
"disability": 0,
|
|
637
|
-
"survivors": 0,
|
|
638
425
|
"taxMax": 142800,
|
|
639
426
|
"cola": 5.9,
|
|
640
427
|
"awi": 60575.07
|
|
641
428
|
},
|
|
642
429
|
{
|
|
643
430
|
"year": 2022,
|
|
644
|
-
"retirement": 0,
|
|
645
|
-
"disability": 0,
|
|
646
|
-
"survivors": 0,
|
|
647
431
|
"taxMax": 147000,
|
|
648
432
|
"cola": 8.7,
|
|
649
433
|
"awi": 63795.13
|
|
650
434
|
},
|
|
651
435
|
{
|
|
652
436
|
"year": 2023,
|
|
653
|
-
"retirement": 0,
|
|
654
|
-
"disability": 0,
|
|
655
|
-
"survivors": 0,
|
|
656
437
|
"taxMax": 160200,
|
|
657
438
|
"cola": 3.2,
|
|
658
439
|
"awi": 66621.8
|
|
659
440
|
},
|
|
660
441
|
{
|
|
661
442
|
"year": 2024,
|
|
662
|
-
"retirement": 0,
|
|
663
|
-
"disability": 0,
|
|
664
|
-
"survivors": 0,
|
|
665
443
|
"taxMax": 168600,
|
|
666
444
|
"cola": 2.5,
|
|
667
445
|
"awi": 69472.44
|
|
668
446
|
},
|
|
669
447
|
{
|
|
670
448
|
"year": 2025,
|
|
671
|
-
"retirement": 0,
|
|
672
|
-
"disability": 0,
|
|
673
|
-
"survivors": 0,
|
|
674
449
|
"taxMax": 176100,
|
|
675
450
|
"cola": 2.7,
|
|
676
451
|
"awi": 72255.52
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "social-security-calculator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Calculate estimated Social Security Benefits",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -44,9 +44,10 @@
|
|
|
44
44
|
"compound-calc": "^4.0.3",
|
|
45
45
|
"csvtojson": "^2.0.10",
|
|
46
46
|
"jest": "^29.7.0",
|
|
47
|
+
"minimist": "^1.2.8",
|
|
47
48
|
"playwright": "^1.54.1",
|
|
48
49
|
"ts-jest": "^29.1.1",
|
|
49
|
-
"typescript": "^
|
|
50
|
+
"typescript": "^5.9.2"
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
|
52
53
|
"xml2js": "^0.6.2"
|