Skip to content

fix: move footfall dashboard into /rwa-admin with sidebar#9

Open
maragakn wants to merge 1 commit intomainfrom
feat/footfall-rwa-admin-fix
Open

fix: move footfall dashboard into /rwa-admin with sidebar#9
maragakn wants to merge 1 commit intomainfrom
feat/footfall-rwa-admin-fix

Conversation

@maragakn
Copy link
Copy Markdown
Collaborator

@maragakn maragakn commented Apr 9, 2026

Summary

Test plan

  • Visit /rwa-admin — confirm sidebar is present and footfall widgets load
  • Stat cards show Today's Footfall, Trainers Active, Asset Alerts, Open Requests
  • FootfallCard shows hourly bar chart with today's booking count
  • TrainerAttendanceCard shows present/late/absent summary + trainer list
  • BookingFeed shows last 12 bookings with member name, flat, and time slot
  • /rwa (bare) returns 404 — old page is gone

Made with Cursor

Integrates FootfallCard, TrainerAttendanceCard, and BookingFeed into
the proper /rwa-admin page (with sidebar) replacing the placeholder.
Scopes stat queries to the active center. Removes the orphaned /rwa
standalone page that had no layout or navigation.

Made-with: Cursor
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the footfall dashboard from a standalone /rwa page without layout to the proper /rwa-admin page with sidebar navigation. The changes integrate footfall widgets (FootfallCard, TrainerAttendanceCard, BookingFeed) into the RWA Admin dashboard and scope all stat queries to the active center for data correctness. The orphaned standalone /rwa/page.tsx is removed.

Changes:

  • Deletes the standalone /rwa/page.tsx dashboard page (42 lines)
  • Adds new getCenter() function to /rwa-admin/page.tsx to fetch the active center
  • Refactors getStats() to accept centerId parameter and scopes amenity booking and trainer attendance queries to the center
  • Integrates FootfallCard, TrainerAttendanceCard, and BookingFeed components with proper centerId passing
  • Updates dashboard header to display center name and formatted date dynamically

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/rwa/page.tsx Deleted — orphaned standalone page without layout or navigation
app/rwa-admin/page.tsx Integrated footfall dashboard components with sidebar, added center retrieval, refactored stats queries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/rwa-admin/page.tsx
Comment on lines +30 to +35
prisma.equipmentAsset.count({
where: { condition: { in: ["FAIR", "POOR"] } },
}),
prisma.serviceRequest.count({
where: { status: { in: ["OPEN", "ASSIGNED"] } },
}),
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

According to the PR description, "Scopes all stat queries to the active center (centerId) for correctness." However, the equipmentAsset and serviceRequest count queries are missing the centerId filter. These models have centerId fields in the schema (EquipmentAsset line 120, ServiceRequest line 210), so these stats will display data from all centers instead of just the active center. Add centerId to the where clause for both queries to maintain data isolation.

Copilot uses AI. Check for mistakes.
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