Skip to content

Commit 8c90f49

Browse files
thadkDaniel Meeganchangangus
committed
2021 table fixes for windfall calc
Co-authored-by: Daniel Meegan <[email protected]> Co-authored-by: changangus <[email protected]>
1 parent e6bc46c commit 8c90f49

File tree

6 files changed

+22
-240
lines changed

6 files changed

+22
-240
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Code for Boston
3+
Copyright (c) 2021 Code for Boston
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/library/wep-cache.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ const cachedSocialSecTables = {
4444
{ year: 2016, Cola: 0.3 },
4545
{ year: 2017, Cola: 2 },
4646
{ year: 2018, Cola: 2.8 },
47-
{ year: 2019, Cola: 1.6 }
47+
{ year: 2019, Cola: 1.6 },
48+
{ year: 2020, Cola: 1.3}
4849
],
4950
benefitReductionTable: [
5051
{
@@ -1827,7 +1828,8 @@ const cachedSocialSecTables = {
18271828
{ year: 2017, SubstantialEarnings: 23625 },
18281829
{ year: 2018, SubstantialEarnings: 23850 },
18291830
{ year: 2019, SubstantialEarnings: 24675 },
1830-
{ year: 2020, SubstantialEarnings: 25575 }
1831+
{ year: 2020, SubstantialEarnings: 25575 },
1832+
{ year: 2021, SubstantialEarnings: 26550 }
18311833
],
18321834
bendPoints: [
18331835
{
@@ -2126,10 +2128,10 @@ const cachedSocialSecTables = {
21262128
},
21272129
{
21282130
year: 2021,
2129-
FirstDollarAmtPIA: 985,
2130-
SecondDollarAmtPIA: 5935,
2131-
DollarAmtInMaxFamilyBenefitFormula: 1258,
2132-
isActualValue: false
2131+
FirstDollarAmtPIA: 996,
2132+
SecondDollarAmtPIA: 6002,
2133+
DollarAmtInMaxFamilyBenefitFormula: 1272,
2134+
isActualValue: true
21332135
},
21342136
{
21352137
year: 2022,
@@ -2420,7 +2422,7 @@ const cachedSocialSecTables = {
24202422
{ year: 2016, averageWageIndex: 48642.15, isActualValue: true },
24212423
{ year: 2017, averageWageIndex: 50321.89, isActualValue: true },
24222424
{ year: 2018, averageWageIndex: 52145.8, isActualValue: true },
2423-
{ year: 2019, averageWageIndex: 53562.23, isActualValue: false },
2425+
{ year: 2019, averageWageIndex: 54099.99, isActualValue: true },
24242426
{ year: 2020, averageWageIndex: 54141.23, isActualValue: false },
24252427
{ year: 2021, averageWageIndex: 55654.07, isActualValue: false },
24262428
{ year: 2022, averageWageIndex: 57630.79, isActualValue: false },

src/pages/data.tsx

-19
This file was deleted.

src/pages/screen-2.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,18 @@ export class Screen2 extends React.Component<Screen2Props, Screen2State> {
149149
if (preferPiaUserCalcValue) {
150150
return await finalCalculation(userDOB, userDOR, userPension, earnings);
151151
} else {
152-
const userAIME = ObsFuncs.getAIMEFromEarnings(earnings, year62);
152+
153+
function fromEntriesPonyfill (iterable: any) {
154+
return [...iterable].reduce((obj, [key, val]) => {
155+
obj[key] = val
156+
return obj
157+
}, {})
158+
}
159+
//Windfall Calculator cannot handle years in the future
160+
//truncate away future earnings before passing it in.
161+
// Do not include the current year, because it will not be in maximum earnings table.
162+
const truncatedEarnings = fromEntriesPonyfill(Object.entries(earnings).filter(a => parseInt(a[0], 10) < dayjs().year()));
163+
const userAIME = ObsFuncs.getAIMEFromEarnings(truncatedEarnings, year62);
153164
//be aware: this userDOR may be accepting a string: ambiguous.
154165
return await ObsFuncs.finalCalculation(
155166
userDOB,

src/static/json/bendpoints.json

-207
This file was deleted.

src/static/json/index.ts

-5
This file was deleted.

0 commit comments

Comments
 (0)