feat(forecast): migrated forecast over

This commit is contained in:
2025-04-18 16:26:48 -05:00
parent 8c5c9fd244
commit dcfa96b710
8 changed files with 302 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import { standardForecast } from "./mappings/standardForcast.js";
export const forecastIn = async (data: any, user: any) => {
/**
* Bulk orders in, and custom file parsing.
*/
let success = true;
let message = "";
let orderData: any = [];
// what type of order are we dealing with?
if (data["fileType"] === "standard") {
//run the standard forecast in
const standard = await standardForecast(data["postPostForecast"], user);
success = standard.success ?? false;
message = standard.message ?? "Error posting standard forecast";
orderData = standard.data;
}
if (data["fileType"] === "energizer") {
// orders in
}
if (data["fileType"] === "loreal") {
// orders in
}
if (data["fileType"] === "pg") {
// orders in
}
return {
success,
message,
data: orderData,
};
};