fix(web): drive the sandbox overview metrics from the api#339
Merged
Conversation
read the transaction, payment and account totals and the open-case count from the live sandbox api instead of hardcoded sample numbers. fall back to clearly labelled sample values with an offline notice when the api is unreachable, and drop the fabricated sparkline trend from live counts. rename the demo tenant to a neutral placeholder.
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.
What
The sandbox Overview landing page showed fabricated headline KPIs. This wires them to the live API with an honest fallback.
useOverviewMetricshook reads transaction/payment/account totals (viatotalElements) and the open-case count from the real endpoints.liveKpisbuilds the four headline cards from those counts. Metrics that have no public endpoint (decision latency, "today" windows) are intentionally not surfaced.KpiDatum.sparkis optional: live counts omit the sparkline because a single count has no time series, so a trend line would be fabricated.Verification
npm run typecheck: clean.npm run test: 64 passed (Overview test now covers both the offline fallback and the live path).npm run lint: 0 errors (2 pre-existing warnings).