Files
lstV2/server/services/logistics/logisticsService.ts

52 lines
1.4 KiB
TypeScript

import { OpenAPIHono } from "@hono/zod-openapi";
import comsumeMaterial from "./route/consumeMaterial.js";
import returnMat from "./route/returnMaterial.js";
import createSiloAdjustment from "./route/siloAdjustments/createSiloAdjustment.js";
import postComment from "./route/siloAdjustments/postComment.js";
import getStockSilo from "./route/siloAdjustments/getStockData.js";
import { migrateAdjustments } from "./controller/siloAdjustments/migrateAdjustments.js";
import getSiloAdjustments from "./route/siloAdjustments/getSiloAdjustments.js";
import { getLanesToCycleCount } from "./controller/warehouse/cycleCountChecks/cyclecountCheck.js";
import getCycleCountCheck from "./route/getCycleCountChecks.js";
import getPPOO from "./route/getPPOO.js";
const app = new OpenAPIHono();
const routes = [
comsumeMaterial,
returnMat,
// silo
createSiloAdjustment,
postComment,
getStockSilo,
getSiloAdjustments,
//lanes
getCycleCountCheck,
//warehouse
getPPOO,
] as const;
// app.route("/server", modules);
const appRoutes = routes.forEach((route) => {
app.route("/logistics", route);
});
setTimeout(() => {
migrateAdjustments();
}, 120 * 1000);
/**
* Start the cycle count check
*/
setTimeout(() => {
getLanesToCycleCount();
}, 5 * 1000);
setInterval(async () => {
getLanesToCycleCount();
}, 15 * 60 * 1000);
export default app;