refactor(ocp): change the way logs are brought in and other changes to clean the code up

This commit is contained in:
2025-04-09 17:49:03 -05:00
parent bad390ec17
commit 2e2699ab3c
20 changed files with 307 additions and 124 deletions

View File

@@ -60,11 +60,11 @@ export const labelingProcess = async ({
"error",
"labeling",
"ocp",
`There is not a lot assigned to ${macId[0]?.Name}.`
`There is not a lot assigned to ${line}.`
);
return {
success: false,
message: `There is not a lot assigned to ${macId[0]?.Name}.`,
message: `There is not a lot assigned to ${line}.`,
};
}
}
@@ -128,7 +128,7 @@ export const labelingProcess = async ({
}
// if there are more than 2 lots it might be an auto labeler, autolabeler will be defined by its id for now only dayton
if (filteredLot.length > 2 && plantToken[0].value !== "usday1") {
if (filteredLot?.length > 2 && plantToken[0].value !== "usday1") {
createLog(
"error",
"labeling",
@@ -214,15 +214,15 @@ export const labelingProcess = async ({
// create the label
const label = await createLabel(filteredLot[0], userPrinted);
if (!label.success) {
createLog(
"error",
"labeling",
"ocp",
`There was an error creating the label: ${label.message}`
);
return { sucess: false, message: label.message, data: label.data };
}
// if (!label.success) {
// createLog(
// "error",
// "labeling",
// "ocp",
// `There was an error creating the label: ${label.message}`
// );
// return { sucess: false, message: label.message, data: label.data };
// }
// send over to be booked in if we can do it.
const bookin = settingData.filter((s) => s.name === "bookin");