feat: staff scheduling, floor plan editor, and advanced reports [#1194 #1195 #1196 #1197]#1258
Open
Tyler7x wants to merge 1 commit into
Open
Conversation
…inctCodes#1194-DistinctCodes#1197) - FE-21: /admin/staff weekly calendar grid + /my-shifts page for staff - BE-23: FloorPlan + FloorPlanZone entities with full CRUD and zone save/activate endpoints - FE-22: /admin/facilities SVG drag-to-draw floor plan editor with zone labelling - BE-24: /reports/bookings, /reports/revenue, /reports/members, /reports/occupancy with ?format=csv support - BE shifts module: Shift entity with staff scheduling CRUD (admin-gated create/update/delete)
|
@Tyler7x is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Closes #1194, #1195, #1196, #1197
This PR delivers four interconnected features spanning the backend and frontend:
BE-23 — Admin Floor Plan Layout (
/floor-plan)Introduces two new TypeORM entities with full CRUD:
FloorPlan: stores canvas dimensions (canvasWidth,canvasHeight), an optionalbackgroundImageUrl, and anisActiveflag. Only one plan is active at a time.FloorPlanZone: child records linked to aFloorPlan, each carryingx,y,width,height,label,color, and an optionalworkspaceIdFK for linking zones to bookable spaces.Endpoints (
FloorPlanController, admin-gated exceptGET /floor-plan/active):POST/floor-planGET/floor-planGET/floor-plan/activePATCH/floor-plan/:idPUT/floor-plan/:id/zonesPATCH/floor-plan/:id/activateBE-24 — Advanced Reports & CSV Export (
/reports)Four new reporting endpoints, all admin/super_admin gated:
GET /reports/bookingsGET /reports/revenueGET /reports/membersGET /reports/occupancyAll endpoints accept
?from=ISO&to=ISOdate range filters. Pass?format=csvto get a downloadable CSV attachment instead of JSON. Default range is the last 30 days.FE-21 — Staff Scheduling Frontend
/admin/staff— Weekly calendar grid (Mon–Sun). Admin can navigate weeks with prev/next arrows. Each day column lists shifts as cards showing staff name, role, and time range. Admins can delete shifts inline and open a "Add Shift" modal (requires staff UUID, role name, start/end datetime, optional notes)./my-shifts— Staff-facing view showing this week's shifts grouped by day. Empty state shown when no shifts are scheduled.FE-22 — Admin Floor Plan Editor (
/admin/facilities)SVG-based drag-to-draw floor plan editor:
PUT /floor-plan/:id/zones.PATCH /floor-plan/:id/activate(only shown when the plan is not already active).Files Changed
Backend
backend/src/shifts/entities/shift.entity.ts(new)backend/src/shifts/shifts.service.ts(new)backend/src/shifts/shifts.controller.ts(new)backend/src/shifts/shifts.module.ts(new)backend/src/floor-plan/entities/floor-plan.entity.ts(new)backend/src/floor-plan/entities/floor-plan-zone.entity.ts(new)backend/src/floor-plan/floor-plan.service.ts(new)backend/src/floor-plan/floor-plan.controller.ts(new)backend/src/floor-plan/floor-plan.module.ts(new)backend/src/reports/reports.service.ts(new)backend/src/reports/reports.controller.ts(new)backend/src/reports/reports.module.ts(new)backend/src/app.module.ts(ShiftsModule, FloorPlanModule, ReportsModule registered)Frontend
frontend/app/admin/staff/page.tsx(new)frontend/app/my-shifts/page.tsx(new)frontend/app/admin/facilities/page.tsx(new)frontend/components/dashboard/DashboardSidebar.tsx(My Shifts + Staff Schedule + Facilities nav items)Test Plan
POST /shiftscreates shift;GET /shifts?startDate=&endDate=returns itGET /shifts/this-weekreturns only current week, scoped to staff if non-adminPOST /floor-plan→PUT /floor-plan/:id/zones→GET /floor-plan/activereturns zonesPATCH /floor-plan/:id/activatedeactivates all other plansGET /reports/bookings?format=csvreturns CSV attachment/my-shiftsshows only shifts for logged-in staff user