feat(ocme): cycle count implemeneted

This commit is contained in:
2025-03-20 14:02:19 -05:00
parent eb2c34c557
commit 74bcd6e805
6 changed files with 316 additions and 322 deletions

View File

@@ -1,6 +1,7 @@
import type {User} from "../../../types/users.js";
import {alplaStockInv} from "./cycleCount/alplaStockInventory.js";
import {emptyCount} from "./cycleCount/emptyCycleCount.js";
import {fullLaneCount} from "./cycleCount/fullLaneCycleCount.js";
import {ocmeInv} from "./cycleCount/ocmeInventory.js";
export const prepareLane = "https://usday1prod.alpla.net/application/public/v1.1/Warehousing/PrepareLaneForInventory";
@@ -8,7 +9,7 @@ export const openLane = "https://usday1prod.alpla.net/application/public/v1.0/Wa
export const closeLane = "https://usday1prod.alpla.net/application/public/v1.0/Warehousing/InventoryClose";
export const releaseLane = "https://usday1prod.alpla.net/application/public/v1.1/Warehousing/ReleaseLaneFromInventory";
export const scannerID = 500;
export const cycleCount = async (lane: string, user: User) => {
export const cycleCount = async (lane: any, user: User) => {
/**
* We will get the inventory from both systems and merge them together, intert it into our db then do the cycle count and update each item
* one it dose it.
@@ -21,7 +22,7 @@ export const cycleCount = async (lane: string, user: User) => {
const alplaStock = await alplaStockInv(ocme[0].alpla_laneID);
// create a new array that has the merge happen.
const mergeOcmeData = ocme.map((d) => {
const mergeOcmeData = ocme.map((d: any) => {
// check if its in the ocme array we add it
const inStock = alplaStock.filter((r: any) => r.runningNumber === d.runningNumber);
//console.log(inStock);
@@ -52,9 +53,10 @@ export const cycleCount = async (lane: string, user: User) => {
// determine what type of count we are doing.
if (ocme.length === 0) {
// do empty count
await emptyCount(user, lane);
await emptyCount(user, ocme[0].alpla_laneID);
} else {
// do the full lane inv
await fullLaneCount(user, ocme[0].alpla_laneID, ocme);
}
// store in the db so we have a record.... for later when we fully randomize and automate this.