Skip to content

No-Jira - Refactor PDS Goal Calculator to remove hardcoded values#1738

Draft
zweatshirt wants to merge 1 commit intomainfrom
pds-calc-rm-hardcoded-values
Draft

No-Jira - Refactor PDS Goal Calculator to remove hardcoded values#1738
zweatshirt wants to merge 1 commit intomainfrom
pds-calc-rm-hardcoded-values

Conversation

@zweatshirt
Copy link
Copy Markdown
Contributor

@zweatshirt zweatshirt commented Apr 21, 2026

Description

  • We'll probably want to delete existing DesignationSupportCalculations in the staging console (causing an error since one of these fields is non-nullable

  • Drops 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

  • Go to ...
  • Do ...
  • Check that ...

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels (Add the label "Preview" to automatically create a preview environment)
  • I have run the Claude Code /pr-review command locally and fixed any relevant suggestions
  • I have requested a review from another person on the project
  • I have tested my changes in preview or in staging
  • I have cleaned up my commit history

… dynamic calculations for reimbursable expenses and monthly support goals
@zweatshirt zweatshirt force-pushed the pds-calc-rm-hardcoded-values branch from 6dcf5e8 to 4ae0786 Compare April 21, 2026 18:32
@zweatshirt
Copy link
Copy Markdown
Contributor Author

zweatshirt commented Apr 21, 2026

@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.

@github-actions
Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against 39994f6

No significant changes found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants