-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4503 Update the budget to calculate totals for match rates #4606
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4606 +/- ##
==========================================
- Coverage 94.33% 94.29% -0.04%
==========================================
Files 274 276 +2
Lines 8704 8771 +67
Branches 1751 1749 -2
==========================================
+ Hits 8211 8271 +60
- Misses 469 476 +7
Partials 24 24
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
624aa72
to
8b4220a
Compare
See this pull request in action: https://ec2-3-215-45-51.compute-1.amazonaws.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for tackling this big ticket. And I'm very impressed that you were able to do it in 13 files, most of which are tests.
There is an issue though the format isn't exactly what we need. We need to separate everything by fed-state split too because the tables that we are working on next need them split up like that, see:
Proposed Budget
Executive Summary
I also wanted to make sure you were storing medicaid, federal, state, and total for all of these new fields.
Just need a little more work, but amazing job so far.
common/utils/budget-sums.test.js
Outdated
const fundingCategory = 'mando'; | ||
const year = '2023'; | ||
const expected = { | ||
mando: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment above, we need to be storing these values grouped by split type
common/utils/budget.js
Outdated
* }, | ||
* mando: { | ||
* statePersonnel: {...}, contractors: {...}, expenses: {...}, combined: {...} | ||
* // see getDefaultFundingSourceByCategoryObject for details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see message above about nesting under the fed-state split
common/utils/budget.js
Outdated
const stateShare = costCategoryShare.stateShare[costCategory]; | ||
|
||
// add to costCategory for the particular year (for particular funding category) | ||
updatedBudget[fundingCategory][costCategory][year].total += costTotal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is where we also need to store it under fed-state split, it should be
updatedBudget[fundingCategory][fedSplit][costCategory][year].total += costTotal;
all the way down, whenever there is [fundingCategory] it should be followed by [fedSplit]
// - key state personnel | ||
// - structure of activities key broken up by activity id | ||
// - funding source | ||
switch (apdType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks for resolving the previous comments so quickly! This was a big one and it's impressive that you were able to get it done in so few files.
total: { | ||
medicaid: 1010, | ||
federal: 909, | ||
state: 101 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is total being stored too? or is that calculated somewhere else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, total.total
(and the year.total
s) are being added via sumTotalCostsByCategory
. Do you think there's a better name for the function to help clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work
// - key state personnel | ||
// - structure of activities key broken up by activity id | ||
// - funding source | ||
switch (apdType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ agreed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, well done tackling the budget!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing much for me to review here - passes Dev/Quality/Automated Testing - good to go on my end.
Resolves #4503
Description
These backend changes update the budget for MMIS to include new fields in the MMIS budget (ddi and mando) and remove unused fields.
Significant changes or possible side effects
federalShareByFFYQuarter
andmmisByFFP
fieldsddi
andmando
fieldsactivities
in the default budget model to remove quarterlyFFP key, so it’s no longer part of the default budget or MMIS budgets, but is now unique to HITECHcostAllocation
FUNDING_CATEGORY_TYPE_KEY_LOOKUP
so we can find the key name of the funding source to save budget datacommon/untils/test-data
directory, which we may or may not want to continue doing. It shortens the file and makes the tests a little easier to navigate, however it visually separates the input data from the testcalculateBudget
code that pertains to specific APD typessumShareCostsForCombinedTotals
). This will make it easier when/if we end up removing themmis
key from MMIS in the future because then we can call this function from elsewhere (currently it’s getting called from the function calculatingmmis
).sumShareCostsForFundingCategory
to populate values inside the funding category keys (ddi
, &mando
)defaultQuarterlyFFPObject
todefaultActivitiesFFPObject
since it no longer contains thequarterlyFFP
data and addeddefaultHITECHActivitiesFFPObject
which still contains thequarterlyFFP
keyAutomated test cases written
defaultActivitiesFFPObject
defaultActivitiesFFPObject
sumShareCostsForCombinedTotals
sumShareCostsForCombinedTotals
sumShareCostsForFundingCategory
sumShareCostsForFundingCategory
sumShareCostsForFundingCategory
Steps to manually verify this change
budget
objectmmis
key should remain unchangedfederalShareByFFYQuarter
ormmisByFFP
keysddi
andmando
keys following the general structureactivities
key will be broken up by activity id and then should containcostsByFFY
, but NOT containquarterlyFFP
. When no activities, it's an empty object.This pull request is ready to code review when
tests, refactor
screenreader, text scaling) OR an exemption is documented
This pull request is ready to test when
This pull request is ready to review when QA has
This pull request can be merged when