Skip to content

[P2] Make dashboard metrics match backend data #26

Description

@samithreddychinni

Problem

The dashboard shows numbers and labels that do not match the backend data closely enough.

One concrete bug is in dashboard/src/pages/Overview/index.jsx:74: it reads mismatchStats?.total_7d, while internal/adminapi/mismatches.go:75 returns last_7_days. That card will show 0 even when the API has data.

There are also labels that overstate what the code measures. False signals caught is based on a simple webhook/final-state contradiction query. Gateway degraded in dashboard/src/pages/Overview/index.jsx:80 is inferred from exhausted merchant deliveries or rejected webhooks. Those are useful signals, but they do not prove the gateway is degraded.

Scope

  • Fix the mismatch stats field name used by the overview page.
  • Rename dashboard labels so they describe the underlying query exactly.
  • Replace False signals caught with a label tied to the mismatch query, for example Webhook contradictions.
  • Replace Gateway degraded with a local system or action banner based on the actual condition, such as callback delivery failures or webhook rejection rate.
  • Remove unsupported gateways from mock data in dashboard/src/lib/mockData.js:23 unless those gateways are backed by real adapters.
  • Make every overview card traceable to one backend query or one documented frontend calculation.

Acceptance criteria

  • The mismatch count card uses last_7_days and shows nonzero values when the API returns them.
  • Overview labels do not claim gateway outage or false-signal prevention unless the backend query proves that exact condition.
  • Mock transaction gateways are PayU-only until other gateway adapters exist.
  • Dashboard tests or component-level checks cover the mismatch stats mapping.
  • Admin API query tests still cover the mismatch count endpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions