When an organisation uses the "average of dates" forecasting strategy, the system automatically creates sales predictions to help with roster planning. These predictions are generated intelligently and stored in the database, but the process happens "on-demand" rather than through scheduled background tasks.
- Organisation sets their forecasting strategy to "average of dates" in their settings
- This tells the system to use historical sales averaging for predictions
- When a manager or admin visits the roster overview page to plan shifts
- When they select new date ranges or locations to view
- When they navigate to any week/period that needs roster planning
The system immediately and automatically:
- Examines the previous 5 weeks of historical sales data
- Identifies which dates had good, reliable sales data
- Determines the best historical dates to use for creating predictions
The system uses smart logic to choose which dates to average:
Scenario A - Current Date Has Historical Data:
- If planning for a Tuesday, and there's good Tuesday sales data from previous weeks
- Uses only Tuesday data from recent weeks for the most accurate prediction
Scenario B - Current Date Has No Historical Data:
- If planning for a new day/time that hasn't been tracked before
- Finds the most recent 3 days that had strong sales data
- Uses those days as the basis for prediction
- Calculates the average sales from the selected historical dates
- Applies any configured growth percentage (if the business is growing/declining)
- Generates predictions for each hour/time period throughout the day
- Automatically saves these predictions as PredictedStoreStat records in the database
- Predictions are instantly available in the roster interface
- Managers can see predicted sales volumes while planning shifts
- These predictions help determine how many staff to schedule
- Process repeats automatically whenever someone views roster planning for new dates
- Predictions stay current as new historical data becomes available
- No manual intervention required from administrators
Responsive & Current: Predictions are created when needed, using the most recent data available
Intelligent Selection: The system automatically chooses the most relevant historical dates rather than using arbitrary averages
No Maintenance Required: Unlike scheduled forecasting systems, this requires no ongoing maintenance or monitoring
User-Driven: Predictions are created as managers actually do their planning work, ensuring they're always relevant
Automatic Storage: Once created, predictions are saved for future reference and reporting
When Existing Predictions Are Present: Skip or Recreate?
The Answer: It Skips Creation (Does Nothing)
When someone visits the roster overview and PredictedStoreStat records already exist for those dates, the system does not recreate them. Here's the specific logic:
The Decision-Making Process
What This Means Practically
Scenario A: Manager Opens Last Week's Roster
Scenario B: Manager Opens Next Week's Roster
Scenario C: Manager Manually Adjusts Predictions