fix(dashboards): correct fabricated deltas, missing statuses & page-scoped counts across all four role dashboards#142
Merged
Conversation
…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.
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.
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
GET /api/applications/company/status-counts); the 50-row page now feeds only the recent-applications list.ComparisonToPlatformAvgis now nullable; the chip renders only when a real comparison is disclosed.Consultant
deltaprop → showed as a green growth pill → dropped.Student
Admin
accepted / decided(accepted + rejected), matching the provider definition. Funnel subtitle reworded.Verification
dotnet buildgreen (exit 0).tscclean on all touched files; all 6 edited locale JSONs parse.