balls :D
All checks were successful
Build Frontend / build (push) Successful in 1m6s

This commit is contained in:
g
2026-01-12 02:32:23 +00:00
parent b10e8f8939
commit 624bfa5485
3 changed files with 89 additions and 30 deletions

View File

@@ -494,15 +494,18 @@ export const getStockPredictions = async (
* @param daysAhead Number of days to predict ahead (default: 7)
* @param period Historical period in days (default: 30)
* @param storeId Optional storeId for staff users
* @param simulation Simulation factor (e.g. 0.1 for +10%)
*/
export const getPredictionsOverview = async (
daysAhead: number = 7,
period: number = 30,
storeId?: string,
simulation: number = 0,
): Promise<PredictionsOverview> => {
const params = new URLSearchParams({
daysAhead: daysAhead.toString(),
period: period.toString(),
simulation: simulation.toString(),
});
if (storeId) params.append("storeId", storeId);
@@ -538,7 +541,8 @@ export const getStockPredictionsWithStore = async (
export const getPredictionsOverviewWithStore = async (
daysAhead: number = 7,
period: number = 30,
simulation: number = 0,
): Promise<PredictionsOverview> => {
const storeId = getStoreIdForUser();
return getPredictionsOverview(daysAhead, period, storeId);
return getPredictionsOverview(daysAhead, period, storeId, simulation);
};