feat(printer delay): printer delay option to grab the delay based off cycle time

This commit is contained in:
2025-10-03 14:57:57 -05:00
parent 356dd5a578
commit a7e1fcd3be
3 changed files with 124 additions and 0 deletions

View File

@@ -6,11 +6,13 @@ import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { getLots } from "../controller/lots/lots.js";
import { getPrinters } from "../controller/printers/getPrinters.js";
import { createLog } from "../../logger/logger.js";
import { printerDelayByLot } from "./printerDelayByLot.js";
export const assignedPrinters = async () => {
createLog("debug", "ocp", "ocp", "Lot assignment check");
const { data: lot, error: lotError } = await tryCatch(getLots());
const l: any = lot;
if (lotError) {
return {
success: false,
@@ -41,6 +43,9 @@ export const assignedPrinters = async () => {
data: [],
};
}
// update the printers if we have the setting checked
printerDelayByLot(l.data);
const { data: print, error: printerError } = await tryCatch(getPrinters());
if (printerError) {