Repository navigation
feat(escrow): create settlement confirmation success screen with fund breakdown - #900
Merged
johdanike merged 3 commits intoSep 30, 2026
Conversation
…istribution
- Add escrowSettlementService to fetch GET /api/escrow/{id}/settlement
- Add SettlementBreakdown types for driver payout, fees, tax withholdings and held funds
- Poll while the release transaction is pending/finalizing and stop on confirmed/failed
- Expose formatted asset amounts, tax breakdown and Stellar explorer link
- Skip retries for client errors and surface readable API error messages
… breakdown - Add SettlementConfirmation component consuming useSettlementBreakdown - Show amount released to driver, total escrow, platform commission, tax withholdings, held amounts and remaining balance - Link the settlement transaction hash to stellar.expert for the matching network - Show delivery summary (tracking number, route, delivered time) - Handle loading, finalizing, failed and error-with-retry states - Add /escrow/[id]/settlement route rendering the screen
|
@BigManly4 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #781
Summary
Adds the settlement confirmation success screen. It shows how escrowed funds were distributed after a delivery completes.
This branch is stacked on #899 (the
useSettlementBreakdownhook for #782), which it depends on. The first commit here is that PR's commit. Once that PR merges, this diff only contains the screen.Changes
components/escrow/SettlementConfirmation.tsx:noopener noreferrer), plus the ledger and settled time.role="status"notice), failed, and error with retry.app/(dashboard)/escrow/[id]/settlement/page.tsx: route that renders the screen.lib/settlementFormatters.ts: adds hash truncation and UTC date formatting.Every amount on screen comes from the settlement API response, which mirrors the contract settlement event values. The component does no arithmetic of its own on payout values. The layout is mobile-first (single column,
sm:breakpoints) and uses light mode styling.Tests
components/escrow/__tests__/SettlementConfirmation.test.tsx(11 tests): mocks the service layer and exercises the real hook. Checks that the breakdown values match the fixture, the held row, the explorer link, the delivery summary, and the finalizing, pending, failed and error-with-retry states.Screenshots