Skip to content

Commit

Permalink
Cleans code style of '/src/data'. codeforboston#1018
Browse files Browse the repository at this point in the history
  • Loading branch information
knod committed Nov 25, 2018
1 parent 5839c90 commit cb6de6d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 28 deletions.
14 changes: 12 additions & 2 deletions src/data/federal/2017/SNAPData.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
/*
* RESOURCES
/** Data tables for MA SNAP calculations.
* @namespace
*
* RESOURCES:
* Derived from https://www.masslegalservices.org/content/online-snap-calculator
* http://www.mass.gov/eohhs/consumer/basic-needs/financial/program-eligibility-charts-and-tables.html
* http://www.mass.gov/eohhs/gov/departments/dta/program-eligibility-charts-and-tables.html
* Standard deductions: http://www.mass.gov/eohhs/docs/dta/eligibility-charts/c-snap-364-400.pdf
* Utility allowance categories: http://www.mass.gov/eohhs/docs/dta/eligibility-charts/c-snap-364-945.pdf
* Net income limits: http://www.mass.gov/eohhs/docs/dta/eligibility-charts/c-snap-364-970.pdf
* SNAP allowance maximums: http://www.mass.gov/eohhs/docs/dta/eligibility-charts/c-snap-364-980-hh-1-10.pdf
*/
const SNAPData = {
// Code-style note: Properties have to use quotes

// in monthly values, because that is what 106 CMR 364.400 leads to: http://www.mass.gov/eohhs/docs/dta/eligibility-charts/c-snap-364-400.pdf
STANDARD_DEDUCTIONS: { 0: 0, 1: 160, 2: 160, 3: 160, 4: 170, 5: 199, 6: 228, 'eachAdditional': 0 },
PERCENT_GROSS_MONTHLY_EARNED: 0.20,
Expand All @@ -25,5 +33,7 @@ const SNAPData = {
SMALL_HOUSEHOLD_SIZE: 2,
SMALL_HOUSEHOLD_MIN_GRANT: 15,
};
// @todo: Make class for 'money amount by number of items'-type object


export { SNAPData };
11 changes: 8 additions & 3 deletions src/data/federal/federalPovertyGuidelines.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/** Data tables for Federal poverty guildelines/income limits.
* @namespace
*
* RESOURCES:
* http://www.mass.gov/eohhs/docs/masshealth/deskguides/fpl-deskguide.pdf
* https://aspe.hhs.gov/poverty-guidelines
*/
const federalPovertyGuidelines = { 0: 0, 1: 12060, 2: 16240, 3: 20420, 4: 24600, 5: 28780, 6: 32960, 7: 37140, 8: 41320, 'eachAdditional': 4180 };

export { federalPovertyGuidelines };

//http://www.mass.gov/eohhs/docs/masshealth/deskguides/fpl-deskguide.pdf
//https://aspe.hhs.gov/poverty-guidelines
export { federalPovertyGuidelines };
54 changes: 31 additions & 23 deletions src/data/massachusetts/name-cores.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
/** Arrays of names which can act as a base off of which
* to build client property keys
/** Collections of names that fall under common MA categories.
* Right now they're meant to be used to make sums of
* client property values. This has been useful when
* property names have changed.
* @module
*
* @example var gross = client[ timeframe + base + 'Monthly' ];
* @example
* import { sumProps } from './someUtilityFolder';
* let client = { disabledMedical: 1, otherMedical: 10, disabledAssistance: 100 };
* var allMedicalExpenses = sumProps(ALL_MEDICAL_EXPENSES);
* console.log(allMedicalExpenses);
* // 111
*/

const UNEARNED_INCOME_SOURCES = [
'TAFDC',
'SSI',
'SSDI',
'childSupportIn',
'unemployment',
'workersComp',
'pension',
'socialSecurity',
'alimony',
'otherIncome',
`TAFDC`,
`SSI`,
`SSDI`,
`childSupportIn`,
`unemployment`,
`workersComp`,
`pension`,
`socialSecurity`,
`alimony`,
`otherIncome`,
];

const UNDER13_CARE_EXPENSES = [
'childDirectCare',
'childBeforeAndAfterSchoolCare',
'childTransportation',
'childOtherCare',
`childDirectCare`,
`childBeforeAndAfterSchoolCare`,
`childTransportation`,
`childOtherCare`,
];

const OVER12_CARE_EXPENSES = [
'adultDirectCare',
'adultTransportation',
'adultOtherCare',
`adultDirectCare`,
`adultTransportation`,
`adultOtherCare`,
];

/** @todo Convert all to this later, but will have
/* @todo Convert all to this later, but will have
* to generate new SNAP test cases because the
* strings they check against have the array
* elements in a different order.
Expand All @@ -40,14 +48,14 @@ const UNDER13_NON_TRANSPORT_CARE = [
`childBeforeAndAfterSchoolCare`,
`childOtherCare`,
];
const UNDER13_TRANSPORT = [ `childTransportation` ];
const UNDER13_TRANSPORT = [ `childTransportation` ];
// const UNDER13_CARE_EXPENSES = UNDER13_NON_TRANSPORT_CARE.concat(UNDER13_TRANSPORT);

const OVER12_NON_TRANSPORT_CARE = [
`adultDirectCare`,
`adultOtherCare`,
];
const OVER12_TRANSPORT = [ `adultTransportation` ];
const OVER12_TRANSPORT = [ `adultTransportation` ];
// const OVER12_CARE_EXPENSES = OVER12_NON_TRANSPORT_CARE.concat(OVER12_TRANSPORT);

const NON_TRANSPORT_DEPENDENT_COSTS = UNDER13_NON_TRANSPORT_CARE.concat(OVER12_NON_TRANSPORT_CARE);
Expand Down

0 comments on commit cb6de6d

Please sign in to comment.