Skip to content

fix(dashboards): correct fabricated deltas, missing statuses & page-scoped counts across all four role dashboards#142

Merged
ma7moudalysalem merged 1 commit into
mainfrom
fix/dashboard-accuracy
Jul 7, 2026
Merged

fix(dashboards): correct fabricated deltas, missing statuses & page-scoped counts across all four role dashboards#142
ma7moudalysalem merged 1 commit into
mainfrom
fix/dashboard-accuracy

Conversation

@ma7moudalysalem

Copy link
Copy Markdown
Owner

A full sweep of every role dashboard (admin, student, consultant, provider) for numbers that were wrong, under-counted, or fabricated. 11 real defects found and fixed — none critical, but each showed a figure the code couldn't justify.

Provider

  • Shortlisted applications were dropped from the "by status" chart and the pending-review count → added to both.
  • Pending-review KPI + status chart were computed from only the first 50 applications while the label claimed "across your current applications" → new server GROUP BY aggregate over all submitted apps (GET /api/applications/company/status-counts); the 50-row page now feeds only the recent-applications list.
  • Acceptance-rate KPI showed a green "+0.0pp vs platform avg" chip for every provider, but that delta is withheld from non-admins (FR-207) → ComparisonToPlatformAvg is now nullable; the chip renders only when a real comparison is disclosed.

Consultant

  • "Projected next month" earnings extrapolated from the mean of the last 3 months instead of the latest month → anchor on last month + average MoM slope.
  • "Bookings by status" silently omitted Rejected / Expired / NoShowReported → added Rejected + Expired buckets, folded NoShowReported into the no-show row.
  • "Completed" KPI rendered a static completion ratio through the delta prop → showed as a green growth pill → dropped.

Student

  • Same Shortlisted omission on the "applications by status" chart, which made it disagree with the "active applications" KPI → added.

Admin

  • Analytics acceptance rate divided accepted by all applications (incl. drafts, external-tracked, withdrawn) → now accepted / decided (accepted + rejected), matching the provider definition. Funnel subtitle reworded.
  • User-growth chart subtitle hardcoded "last 30 days" while a 7/30/90 toggle changes the window → interpolate the selected range.
  • Recent-activity feed printed raw PascalCase enum names for the 7 booking/consultant audit actions (missing i18n keys) and used a generic icon for the two consultant actions → added labels (en + ar) and icons.

Verification

…coped counts across all four role dashboards

A sweep of every role dashboard turned up numbers that were wrong,
under-counted, or fabricated. No dashboard was left showing a figure it
could not actually justify.

Provider:
- Shortlisted applications were dropped from the "by status" chart and the
  pending-review count; add the bucket to both.
- Pending-review KPI + status chart were computed from only the first 50
  applications while the label claimed "across your current applications".
  Add a server-side GROUP BY aggregate over ALL of the provider's submitted
  applications (GET /api/applications/company/status-counts) and derive the
  KPI + chart from it; the 50-row page still feeds only the recent list.
- Acceptance-rate KPI showed a green "+0.0pp vs platform avg" chip for every
  provider, but that delta is intentionally withheld from non-admins (FR-207).
  Make ComparisonToPlatformAvg nullable — null for non-admins — and render the
  chip only when a real comparison is disclosed.

Consultant:
- "Projected next month" earnings extrapolated from the MEAN of the last 3
  months instead of the latest month, systematically lagging the trend. Anchor
  on the last month + average MoM slope.
- "Bookings by status" silently omitted Rejected / Expired / NoShowReported.
  Add Rejected + Expired buckets and fold NoShowReported into the no-show row.
- "Completed" KPI passed the completion ratio through the delta prop, so a
  static ratio rendered as a green period-over-period growth pill. Drop it.

Student:
- Same Shortlisted omission on the student "applications by status" chart,
  which made it disagree with the "active applications" KPI.

Admin:
- Analytics acceptance rate divided accepted by ALL applications (incl. drafts,
  external-tracked, withdrawn). Match the provider definition: accepted / decided
  (accepted + rejected). Funnel subtitle reworded to "all applications".
- User-growth chart subtitle hardcoded "last 30 days" while a 7/30/90 toggle
  changes the window; interpolate the selected range.
- Recent-activity feed printed raw PascalCase enum names for the 7 booking /
  consultant audit actions (missing i18n keys) and used a generic icon for the
  two consultant actions. Add the labels (en + ar) and icons.
Copilot AI review requested due to automatic review settings July 7, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ma7moudalysalem ma7moudalysalem merged commit 3cf1f9b into main Jul 7, 2026
1 check passed
@ma7moudalysalem ma7moudalysalem deleted the fix/dashboard-accuracy branch July 7, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants