No-Jira - Refactor PDS Goal Calculator to remove hardcoded values#1738
Draft
zweatshirt wants to merge 1 commit intomainfrom
Draft
No-Jira - Refactor PDS Goal Calculator to remove hardcoded values#1738zweatshirt wants to merge 1 commit intomainfrom
zweatshirt wants to merge 1 commit intomainfrom
Conversation
… dynamic calculations for reimbursable expenses and monthly support goals
6dcf5e8 to
4ae0786
Compare
Contributor
Author
|
@wjames111 Here is the PR. Sorry for leaving it midway. No worries if you can't get to it. I'll try to get back to this PR after I finish the UAT request if you can't get to this PR, just might be a while until I'm able to get back to it. |
Contributor
Bundle sizes [mpdx-react]Compared against 39994f6 No significant changes found |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We'll probably want to delete existing
DesignationSupportCalculations in the staging console (causing an error since one of these fields is non-nullableDrops the hardcoded REIMBURSABLE_FLOOR = 300 from calculateReimbursableTotals; the floor now comes from the MINIMUM_REIMBURSABLE API constant, and an EMPLOYER_FICA_RATE lookup feeds the salary subtotal.
Centralizes derived totals in useSaveField: every save automatically recomputes and persists totalReimbursableExpenses (floor-clamped) and totalMonthlySupportGoal (salary subtotal) when the relevant constants are loaded. This lets SalarySection drop its useMemo + useEffect drift-reconciliation, and ReimbursableExpensesGrid.processRowUpdate stop doing its own local floor math.
Exposes a flat constants object on PdsGoalCalculatorContext (reimbursableFloor, employerFicaRate, phoneMax, internetMax, geographicMultipliers) so consumers stop repeating goalMiscConstants.ADDITIONAL_RATES?.…?.fee lookups.
Fixes a regression in OtherSection (the Support Item breakdown): with the hardcoded floor removed, its display was showing $0 for empty reimbursable expenses instead of the floor — now reads the floor from context.
Merged Backend PR: https://github.com/CruGlobal/mpdx_api/pull/3279
Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions