PHEE-399: wire Payment Hub, Transfers to real Gazelle API, add Batch Detail page and update Reporting Dashboard - #12
Merged
Conversation
…tail page, update Reporting Dashboard
There was a problem hiding this comment.
Pull request overview
This PR connects the Payment Hub and Reporting UI modules to the live Gazelle backend via React Query, adds a new Batch Detail route/page, and updates dashboard/reporting widgets to render real batch/transfer data with loading states and mock fallbacks.
Changes:
- Wired Payment Hub batches/transfers/sub-batches tabs and dashboards to
fetchMainBatches,fetchTransfers, andfetchSubBatcheswith skeleton loading and export updates. - Added
/payment-hub/batch/:batchIdBatch Detail page and navigation from Main Batches rows. - Updated domain types and mocks to match the backend response shape, and extended
StatusBadgeto handle new status variants.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/Dashboard.tsx | Loads real batches for KPI cards + recent batches table and adds skeleton loading. |
| src/pages/BatchDetail.tsx | Exposes the new Batch Detail module as a page entrypoint. |
| src/modules/reporting/Reporting.tsx | Replaces mock KPIs/charts/tables with live batch + transfer data where available. |
| src/modules/payment-hub/types.ts | Updates Payment Hub data contracts to the Gazelle API shapes (MainBatch/SubBatch/Transfer). |
| src/modules/payment-hub/TransfersTab.tsx | Uses real transfers (content shape), updates filtering/export/table rendering. |
| src/modules/payment-hub/SubBatchesTab.tsx | Adds batch selector and loads sub-batches per selected batch from API. |
| src/modules/payment-hub/mocks/transfers.mock.ts | Updates transfer mocks to match new Transfer interface. |
| src/modules/payment-hub/mocks/subBatches.mock.ts | Updates sub-batch mocks to match new SubBatch interface. |
| src/modules/payment-hub/mocks/mainBatches.mock.ts | Updates main batch mocks to match new MainBatch interface. |
| src/modules/payment-hub/MainBatchesTab.tsx | Loads real main batches, updates filtering/export/table, adds row navigation to Batch Detail. |
| src/modules/payment-hub/BatchDetail.tsx | Implements the new Batch Detail page with batch info and sub-batches table. |
| src/main.tsx | Registers the new Batch Detail route. |
| src/lib/api/paymentHub.ts | Adjusts API wrappers for the new backend response shapes and adds sub-batch fetch. |
| src/components/shared/StatusBadge.tsx | Adds support for new uppercase status variants and null/unknown fallback. |
Suppressed comments (2)
src/pages/Dashboard.tsx:18
formatAmountis formatting rawtotalAmountvalues as if they were whole currency units, but elsewhere on this pagetotalAmountis treated as cents (divided by 100). This causes the Recent Batches “Amount” column to be off by 100× and can mislabel K/M thresholds.
function formatAmount(n: number) {
if (n >= 1_000_000) return `$${(n / 1_000_000).toFixed(1)}M`
if (n >= 1_000) return `$${(n / 1_000).toFixed(0)}K`
return `$${n}`
}
src/modules/payment-hub/TransfersTab.tsx:52
- Pagination controls are computed from
filtered.length, but the UI range string usestotalCount(fromtotalElements). When the API is paged, this can show e.g. “1–10 of 500” while only the first page is actually loaded, and the Next button may be disabled even though more server data exists.
const totalPages = Math.max(1, Math.ceil(filtered.length / perPage))
const paginated = filtered.slice((page - 1) * perPage, page * perPage)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DavidH-1
approved these changes
Aug 7, 2026
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.
Related
Epic: PHEE-363
Closes: PHEE-399
Summary
Connects Payment Hub modules to the live Mifos Gazelle backend and adds Batch Detail page with real data.
Changes
API Integration
paymentHub.ts— fetchMainBatches, fetchTransfers, fetchSubBatcheswired to real Gazelle API (https://ops.mifos.gazelle.test/api/v1)
MainBatchesTab— real batch data with loading skeleton and mock fallbackTransfersTab— real transfers data usingcontentresponse shape,page=0&size=50
SubBatchesTab— batch selector dropdown, fetches sub batches per batchIdBatch Detail Page
/payment-hub/batch/:batchIdReporting Dashboard
Dashboard
Type Updates
MainBatchinterface updated to match real API response fieldsTransferinterface updated with real API fieldsSubBatchinterface addedStatusBadge
Screenshots
[attach Payment Hub real data screenshot]
[attach Batch Detail screenshot]
[attach Reporting Dashboard screenshot]
Notes