Files
lstV2/server/services/ocp/controller/labeling/getLabelRatio.ts
Blake Matthes 41308788fd feat(labelratio): new feature to monitor label ratio from auto and manual
this was designed more for dayton but could be used for all plants
2025-07-14 10:18:23 -05:00

24 lines
685 B
TypeScript

import { db } from "../../../../../database/dbclient.js";
import { labelRatio } from "../../../../../database/schema/ratios.js";
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
export const getLabelRatio = async () => {
const { data: labelInfo, error: labelError } = await tryCatch(
db.select().from(labelRatio)
);
if (labelError) {
return {
success: false,
message: "There was an error getting the labels",
data: [labelError],
};
}
return {
success: true,
message: "Current labels order by upd_Date.",
count: labelInfo.length,
data: labelInfo,
};
};