MPDX-9374 - Display effective approved salary instead of current salary#1815
Conversation
… request handling
Bundle sizes [mpdx-react]Compared against 351639a
|
zweatshirt
left a comment
There was a problem hiding this comment.
Multi-Agent Code Review — MPDX-9374
Verdict: ✅ APPROVED_WITH_SUGGESTIONS · Risk: LOW (2/10) · Agents: Architecture, Testing, Standards, UX, Financial Reporting (standard mode)
Small, well-tested display change that swaps the step-3 "Requested Salary" card's first row from current gross salary to the latest effective (approved) salary request, with a dash fallback. Closely mirrors the established SalarySummaryCard pattern. No blockers — lint:ts clean, 13/13 tests pass.
Findings (all non-blocking)
| # | Severity | Where | Item |
|---|---|---|---|
| 1 | Medium 5.5 | RequestedSalaryCard.tsx:144 |
Empty-state shows – while every other cell here (and SalarySummaryCard) shows $0.00. Defensible/arguably an improvement — confirm it's intentional. |
| 2 | Suggestion 4.0 | RequestedSalaryCard.tsx:144,147 |
Truthiness salary ? … : '–' renders – for a legitimate $0. Low risk (minimum-salary floor). Use salary != null if $0 should show as $0.00. |
| 3 | Suggestion 3.0 | RequestedSalaryCard.tsx:42 |
loading/error not handled — transient – during load. Matches sibling; query is cache-warm. |
| 4 | Suggestion 3.5 | RequestedSalaryCard.tsx:44 |
The useEffectiveSalaryCalculationQuery + orientSalaryRequest idiom is now in two cards — optional shared hook. (Do NOT lift into context — query is variable-free, cards render in different steps.) |
| 5 | Suggestion 3.0 | test file | New cell assertions use waitFor(getAllByRole) rather than findBy*. Matches existing convention in this file; defer. |
Financial checklist: arithmetic safe ✅ · rounding at display boundary ✅ · null/undefined handled ✅ (with the 0-truthiness caveat) · currency mixing / Luxon / server aggregations N/A. Orientation argument (hcmUser.staffInfo.personNumber) is consistent with SalarySummaryCard — no perspective-swap bug.
Four of five agents independently converged on item 2; none is a blocker. No debate round was needed (no finding ≥7, strong consensus).
| {formatCurrency(hcmUser?.currentSalary.grossSalaryAmount)} | ||
| {t('Current Requested Salary')} | ||
| </TableCell> | ||
| <TableCell>{salary ? formatCurrency(salary) : '–'}</TableCell> |
There was a problem hiding this comment.
There was a problem hiding this comment.
The '-' aligns with the ticket description, but I can change that.
| {hcmSpouse && ( | ||
| <TableCell> | ||
| {formatCurrency(hcmSpouse.currentSalary.grossSalaryAmount)} | ||
| {spouseSalary ? formatCurrency(spouseSalary) : '–'} |
There was a problem hiding this comment.
| const { isUserSosa, blockOnCap } = useSosaBlockOverCap(); | ||
| const { markValid, markInvalid } = useAutosaveForm(); | ||
|
|
||
| const { data: effectiveData } = useEffectiveSalaryCalculationQuery(); |
There was a problem hiding this comment.
|
|
||
| const { data: effectiveData } = useEffectiveSalaryCalculationQuery(); | ||
| const { salary, spouseSalary } = | ||
| orientSalaryRequest( |
There was a problem hiding this comment.
|
Preview branch generated at https://MPDX-9374.d3dytjb8adxkk5.amplifyapp.com |
| {t('Current Salary')} | ||
| </TableCell> | ||
| <TableCell> | ||
| {formatCurrency(hcmUser?.currentSalary.grossSalaryAmount)} |
There was a problem hiding this comment.
@canac By the ticket description, I wasn't sure if we wanted to include both the Current Salary and the effective Current Requested Salary, or replace the Current Salary. I chose the latter but let me know if I should include both rows.
There was a problem hiding this comment.
Probably not both. I think we wanted to show the current requested (not gross) so they can easily compare it with their new requested salary.
There was a problem hiding this comment.
AI Review Auto-Approval
Risk Level: LOW (2/10)
Verdict: APPROVED_WITH_SUGGESTIONS (suggestions posted, no blockers)
This PR was auto-approved because:
- The multi-agent AI review determined it is low risk
- No blocking issues were found
- All suggestions have been posted as review comments for the developer to consider
If you believe this PR needs human review, dismiss this approval and request a review manually.
Description
This ticket slipped through the cracks: https://jira.cru.org/browse/MPDX-9374
Sorry about that!
This displays the user and user spouse's current requested salary from their latest approved request.
I took the ticket description to mean we want to remove the current gross salary from the display and replace it with this value. Do we instead want to display both?
Testing
Checklist:
/pr-reviewcommand locally and fixed any relevant suggestions