Sales Forecast
Sales Forecast predicts your future daily revenue by feeding your historical sales into a statistical forecasting model (Prophet) and showing you the predicted value plus a lower/upper confidence range for each future day.
Overview
You pick a From/To date range of historical sales, and the page sends that history to a forecasting model which returns a day-by-day prediction for the next 30 days, each with a predicted value and a lower/upper confidence bound.
This is an Enterprise-tier feature and sits under the Advanced Analytics category on the All Reports directory — of that whole category, this is currently the only forecasting report that is fully wired up end to end.
The forecast quality depends entirely on how much and how consistent your historical sales data is — a short or gappy date range will produce a much less reliable prediction.
Before You Start
- Requires the Enterprise plan tier — this is the highest tier gate of any report in the Reports section.
- You need a meaningful amount of historical sales data in the date range you select; the model cannot forecast from a range with little or no sales activity.
- The forecasting engine is a separate analytics microservice — if that service is not reachable, forecasting will fail even though the rest of BazaarPOS works normally.
Step-by-Step Guide
1 Run a sales forecast
- Set the From and To dates to define the historical sales window the model should learn from.
- Click Run Forecast.
- Wait for the button to show "Forecasting…" while your sales history is fetched and sent to the forecasting model.
- Once complete, read the Forecast (next 30 days) table: Date, Prediction, Lower and Upper columns for each of the next 30 days.
- Use the gap between Lower and Upper as the model's confidence range — a wide gap means the model is less certain about that day's prediction.
Every Field & Button, Explained
| Field / Button | What it does |
|---|---|
From / To | The historical date range of past sales used to train the forecast for this run. |
Run Forecast | Fetches your sales history for that range and submits it to the forecasting model; disabled while a forecast is already running. |
Date (forecast table) | One row per predicted future day, always 30 days from the model regardless of how wide your historical range was. |
Prediction | The model's expected revenue for that future date. |
Lower / Upper | The confidence interval around the prediction — the true value is expected to fall between these most of the time. |
Tips & Best Practices
- Feed the model a longer historical range (several months, ideally covering at least one full season if your business is seasonal) for a more reliable forecast than just the last week or two.
- Treat the Lower/Upper range as important as the Prediction itself — a prediction with a very wide range is a signal to not over-commit purchasing or staffing decisions to that number.
- Re-run the forecast periodically (e.g. monthly) rather than relying on a stale one — as more actual sales come in, a fresh run will produce a tighter, more accurate prediction.
Troubleshooting & FAQ
Sales Forecast is not visible in my Reports menu.
Run Forecast shows an error toast and no table appears.
The forecast looks flat or clearly wrong.
Forecast always predicts the same 30 days no matter what date range I pick.
🧑💻 Developer Notes
Source component(s):
frontend-app/packages/pos-react-lib/src/pages/analytics/SalesForecasting.jsx
Backend endpoints used:
GET /api/reports/sales/historyPOST {fastApiUrl}/forecast — external Prophet analytics microservice, not the main BazaarPOS backend API
Related tables (db-core repositories):
SaleSaleItem
Feature flag key: sales_forecasting (requires enterprise plan tier or above)
Forecasting is powered by an external FastAPI microservice running Meta's Prophet time-series model, addressed via window.appConfig?.fastApiUrl or the POS_FASTAPI_URL environment variable, falling back to http://127.0.0.1:8000 in development. Sales history is fetched from the main backend, reshaped into Prophet's expected {ds, y} format client-side, then POSTed directly to the analytics service — a second network hop outside the normal BazaarPOS API that must be reachable for this page to work.