fix(builds): fixed non used variables
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m32s

This commit is contained in:
2026-06-15 17:16:29 -05:00
parent 24af3ca403
commit 2ebf695526
2 changed files with 22 additions and 59 deletions

View File

@@ -6,7 +6,7 @@ import {
sqlQuerySelector, sqlQuerySelector,
} from "../prodSql/prodSqlQuerySelector.utils.js"; } from "../prodSql/prodSqlQuerySelector.utils.js";
import { returnFunc } from "../utils/returnHelper.utils.js"; import { returnFunc } from "../utils/returnHelper.utils.js";
import { sendEmail } from "../utils/sendEmail.utils.js"; //import { sendEmail } from "../utils/sendEmail.utils.js";
import { tryCatch } from "../utils/trycatch.utils.js"; import { tryCatch } from "../utils/trycatch.utils.js";
import { postData } from "./logistics.dm.postData.js"; import { postData } from "./logistics.dm.postData.js";
@@ -83,7 +83,7 @@ export const lorealForecast = async (data: any, user: any) => {
const article: any = a?.data; const article: any = a?.data;
console.log(article); //console.log(article);
// process the ebm forcast // process the ebm forcast
for (let i = 0; i < ebmForeCastData.length; i++) { for (let i = 0; i < ebmForeCastData.length; i++) {
@@ -127,31 +127,6 @@ export const lorealForecast = async (data: any, user: any) => {
//console.log(ebmForeCastData.length); //console.log(ebmForeCastData.length);
} }
// petForeCastData.forEach((item: any, index: any) => {
// //console.log(`Processing item ${index + 1} of ${forecastData.length}`);
// // Extract the customer code
// const customerCode = item["SOUTH PET BOTTLES"];
// // Process each date in the current object
// for (const [date, qty] of Object.entries(item)) {
// // Skip metadata fields
// if (petMetadataFields.includes(date)) continue;
// if (qty === 0) continue;
// // Create your transformed record
// const record = {
// customerArticleNo: customerCode,
// requirementDate: excelDateStuff(parseInt(date)),
// quantity: qty,
// };
// // Do something with this record
// petForecastData.push(record);
// }
// });
// pet forecast // pet forecast
for (let i = 0; i < petForeCastData.length; i++) { for (let i = 0; i < petForeCastData.length; i++) {
// bottle code // bottle code
@@ -200,25 +175,25 @@ export const lorealForecast = async (data: any, user: any) => {
//console.log(comForecast); //console.log(comForecast);
// email the for the missing ones // email the for the missing ones
const missedGrouped = Object.values( // const missedGrouped = Object.values(
missingSku.reduce((acc: any, item: any) => { // missingSku.reduce((acc: any, item: any) => {
const key = item.customerArticleNo; // const key = item.customerArticleNo;
if (!acc[key]) { // if (!acc[key]) {
// first time we see this customer // // first time we see this customer
acc[key] = item; // acc[key] = item;
} else { // } else {
// compare dates and keep the earliest // // compare dates and keep the earliest
if ( // if (
new Date(item.requirementDate) < new Date(acc[key].requirementDate) // new Date(item.requirementDate) < new Date(acc[key].requirementDate)
) { // ) {
acc[key] = item; // acc[key] = item;
} // }
} // }
return acc; // return acc;
}, {}), // }, {}),
); // );
// TODO: change this to a flagged notification so that he users can subscribe or leave it. this removes the hardcody shit. // TODO: change this to a flagged notification so that he users can subscribe or leave it. this removes the hardcody shit.
// const emailSetup = { // const emailSetup = {
@@ -248,19 +223,7 @@ export const lorealForecast = async (data: any, user: any) => {
const updatedPredefinedObject = { const updatedPredefinedObject = {
...predefinedObject, ...predefinedObject,
positions: [ positions: [...predefinedObject.positions, ...ebmForecastData],
...predefinedObject.positions,
...ebmForecastData,
// ...ebmForecastData.filter(
// (q: any) =>
// q.customerArticleNo != "" && q.customerArticleNo != "Total"
// ),
// ...petForecastData.filter(
// (q: any) =>
// q.customerArticleNo != "" && q.customerArticleNo != "Total"
// ),
],
}; };
// console.log(updatedPredefinedObject); // console.log(updatedPredefinedObject);

View File

@@ -113,8 +113,8 @@ export const pNgForecast = async (data: any, user: any) => {
// } // }
return { return {
customerArticleNo: parseInt(o["Customer Item No."]), customerArticleNo: parseInt(o["Customer Item No."] ?? "0", 10),
requirementDate: excelDateStuff(parseInt(o["Request Date"])), requirementDate: excelDateStuff(parseInt(o["Request Date"] ?? "0", 10)),
quantity: o["Remaining Qty to be Shipped"], quantity: o["Remaining Qty to be Shipped"],
}; };
}); });