-
Notifications
You must be signed in to change notification settings - Fork 4
feat: implement recovery case redebit functionality #997
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
Conversation
- Wire up RecoveryCasesList to fetch data from API - Implement redebit mutation in RecoveryCasesResubmit - Add useRecoveryCaseErrorCode hook for error code content mapping - Add i18n strings for R01, R02, R16, R29 error codes with fallback - Add tests for resubmit flow and error code rendering - Add MSW handlers for recovery cases API mocking SDK-228 Co-Authored-By: Claude Opus 4.5 <[email protected]>
jeffredodd
left a comment
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.
- Use Trans component for rich text formatting - Add <medium> tags to error codes and "Resubmit payment" in i18n strings - Return ReactNode from useRecoveryCaseErrorCode hook Co-Authored-By: Claude Opus 4.5 <[email protected]>
| recoveryCase?.latestErrorCode, | ||
| ) | ||
|
|
||
| const redebitMutation = useRecoveryCasesRedebitMutation() |
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.
do we need isPending here?
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.
Not on this one since we are managing the loading state by using the query key in the footer
| }) | ||
| onEvent(recoveryCasesEvents.RECOVERY_CASE_RESUBMIT_DONE, { | ||
| recoveryCaseId, | ||
| httpMeta: response.httpMeta, |
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.
I assume httpMeta is used somewhere?
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.
That actually ends up being the response type for the received data. good callout tho, going to flatten this for consistency
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.
Actually i assumed this included something about the recovery case entity, but endpoint just returns a 202 so this wouldn't be super helpful https://docs.gusto.com/embedded-payroll/reference/redebit-recovery-case
updated to only pass the recovery case id that was redebited
| const { t } = useTranslation('Payroll.RecoveryCasesResubmit') | ||
| const { Button } = useComponentContext() | ||
|
|
||
| const isMutating = useIsMutating({ |
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.
I think this answers my previous question, is this needed to handle multiple mutations? reason I ask is this is a new pattern for us
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.
It's def suboptimal resulting from keeping the modal footer content separate. i think aspirationally we would update to think about how we might deal with these modal flows in a way that we can have footers access the query state
- Extract ACH codes into i18n array for proper list rendering - Add compactList styles for bulleted list - Simplify hook API to return description array Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>

Summary
Implements the recovery case redebit functionality, allowing users to resubmit failed payments from the recovery cases flow.
Changes
RecoveryCasesList
useRecoveryCasesGethook to fetch recovery cases from APIcompanyIdprop for API callsitemMenupattern with actualuuidRecoveryCasesResubmit
useRecoveryCasesRedebitMutationfor payment resubmissionRECOVERY_CASE_RESUBMIT_DONEevent with response datauseRecoveryCaseErrorCode hook
Related
Demo
Screen.Recording.2026-01-28.at.6.24.58.PM.mov
🤖 Generated with Claude Code