refactor(quality): added a check to monior #7 as well

This commit is contained in:
2025-12-02 15:25:05 -06:00
parent ac27a286c0
commit 6833dfc992
3 changed files with 21 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ export const qualityCycle = async () => {
db
.select()
.from(qualityRequest)
.where(inArray(qualityRequest.palletStatus, [1, 4, 5, 6])),
.where(inArray(qualityRequest.palletStatus, [1, 4, 5, 6, 7])),
);
if (error) {
@@ -64,6 +64,9 @@ export const qualityCycle = async () => {
let prodData: any =
queryData?.data.length === 0 ? [] : queryData.data;
// if there isnt a pallet just continue
if (queryData?.data.length === 0) continue;
if (
lstQData[i]?.locationAtRequest != prodData[0]?.locationAtRequest
) {
@@ -71,7 +74,7 @@ export const qualityCycle = async () => {
const qDataPost = {
warehouseMovedTo: prodData[0]?.warehouseAtRequest,
locationMovedTo: prodData[0]?.locationAtRequest,
// how ling did it take the warehouse to originally move the pallet
// how long did it take the warehouse to originally move the pallet
durationToMove: warehouse.includes(lstQData[i].palletStatus)
? differenceInMinutes(
new Date(Date.now()),