Overview
Admins manage workspace capacity reactively. Forecasting predicts future demand based on historical booking patterns — enabling proactive pricing adjustments, staffing decisions, and workspace promotion.
Context
Booking entity: backend/src/bookings/entities/booking.entity.ts — startDate, workspaceId, planType, status
Workspace entity: backend/src/workspaces/entities/workspace.entity.ts — totalSeats
DashboardModule: backend/src/dashboard/ — add forecast endpoint here
Tasks
Files to Modify / Create
backend/src/dashboard/dashboard.controller.ts
backend/src/dashboard/providers/admin-analytics.provider.ts
Overview
Admins manage workspace capacity reactively. Forecasting predicts future demand based on historical booking patterns — enabling proactive pricing adjustments, staffing decisions, and workspace promotion.
Context
Bookingentity:backend/src/bookings/entities/booking.entity.ts—startDate,workspaceId,planType,statusWorkspaceentity:backend/src/workspaces/entities/workspace.entity.ts—totalSeatsDashboardModule:backend/src/dashboard/— add forecast endpoint hereTasks
GET /dashboard/admin/occupancy-forecast— returns predicted occupancy per workspace for the next 30 daysCONFIRMEDorCOMPLETEDbookings for W on the same day-of-week as D over the past 90 daysW.totalSeatsto getpredictedOccupancyPercent(0–100){ predictions: [{ date, workspaceId, workspaceName, predictedOccupancyPercent }] }?workspaceId=filter to return forecast for a single workspaceFiles to Modify / Create
backend/src/dashboard/dashboard.controller.tsbackend/src/dashboard/providers/admin-analytics.provider.ts