Conversation
Bundle sizes [mpdx-react]Compared against f7ae0e1 No significant changes found |
🤖 Multi-Agent Code Review ReportPR: #1682 — Add spouseCalculations to ASR context 📊 RISK ASSESSMENTRisk Score: 7/15 — MEDIUM Risk Factors: Custom hooks with business logic, financial calculations (salary caps, balances) 🚫 CRITICAL BLOCKERS (Severity 9-10)None. All 5 agents confirmed no blocking issues. All financial calculations are preserved exactly through this refactor.
|
| Calculation | Status |
|---|---|
totalAnnualSalary = grossAnnualSalary + pendingAsrAmount + total |
✅ Preserved |
spouseTotalAnnualSalary = spouseGrossAnnualSalary + spousePendingAsrAmount |
✅ Preserved |
exceedsCap, spouseExceedsCap, splitAsr logic |
✅ Preserved |
AT_CAP_TOLERANCE boundary logic |
✅ Preserved |
| 403b deduction calculations | ✅ Not touched |
staffAccountBalance / primaryAccountBalance flow |
✅ Preserved |
No arithmetic was changed. Only the data source was moved from requestData?.latestAdditionalSalaryRequest?.calculations to context shortcuts.
📋 STANDARDS COMPLIANCE
| Standard | Status |
|---|---|
| File Naming | ✅ |
| Named Exports | ✅ |
| GraphQL | ✅ N/A (no new operations) |
| Localization | ✅ |
| Testing | ✅ |
| Code Quality | ✅ |
📝 REVIEW SUMMARY
| Agent | Critical | Important | Suggestions | Confidence |
|---|---|---|---|---|
| 🏗️ Architecture | 0 | 3 | 3 | High |
| 🧪 Testing | 0 | 4 | 2 | High |
| 👤 UX | 0 | 1 | 0 | High |
| 💰 Financial | 0 | 2 | 2 | High |
| 📋 Standards | 0 | 0 | 1 | High |
| Total | 0 | 5 unique | 4 unique | High |
🎯 VERDICT
✅ APPROVE — Clean refactoring PR. No critical or high-priority blockers. All financial calculations verified preserved. The important issues noted are incremental improvement opportunities, not merge blockers.
🤖 Generated by MPDX Multi-Agent Review System v3.0 — 5 agents, standard mode
| const individualCap = | ||
| requestData?.latestAdditionalSalaryRequest?.calculations.currentSalaryCap ?? | ||
| 0; | ||
| const individualCap = calculations?.currentSalaryCap ?? 0; |
There was a problem hiding this comment.
We are doing this in the context, which is why we don't need to call useAdditionalSalaryRequestQuery here
|
Preview branch generated at https://MPDX-9425-spouse-calculations.d3dytjb8adxkk5.amplifyapp.com |
wjames111
left a comment
There was a problem hiding this comment.
Looks great thanks for the refactor! Sorry I didn't realize how many test files would need to change. I did notice there's a few mocks with requestData in them that I don't think are needed anymore.
| @@ -400,6 +404,9 @@ describe('RequestPage', () => { | |||
| currentIndex: 1, | |||
| currentStep: AdditionalSalaryRequestSectionEnum.CompleteForm, | |||
| pageType: PageEnum.New, | |||
| calculations: { | |||
| currentSalaryCap: 50, | |||
| }, | |||
| requestData: { | |||
| latestAdditionalSalaryRequest: { | |||
| calculations: { | |||
| @@ -451,6 +458,14 @@ describe('RequestPage', () => { | |||
| lastName: 'Doe', | |||
| }, | |||
| }, | |||
| requestData: { | ||
| latestAdditionalSalaryRequest: { | ||
| calculations: { | ||
| currentSalaryCap: 100000, | ||
| staffAccountBalance: 40000, | ||
| }, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Could we remove this now too?
Summary
This PR is a follow-up for #1680 to address Will's comments
Changes
spouseCalculationstoAdditionalSalaryRequestContext(mirroring existingcalculations)requestData?.latestAdditionalSalaryRequest?.calculationsandrequestData?.latestAdditionalSalaryRequest?.spouseCalculationsaccess with context valuesTest plan