This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user