import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi"; import { responses } from "../../../globalUtils/routeDefs/responses.js"; const app = new OpenAPIHono({ strict: false }); const current: any = [ { name: "getActiveAv", endpoint: "/api/datamart/getarticles", description: "Gets all current active AV, with specific critiera.", }, // { // name: "getStockLaneDims", // endpoint: "/api/v1/masterData/getStockDims", // description: "Returns the lane dims along with a column to send actaul dims to be updated.", // }, // { // name: "getAddressInfo", // endpoint: "/api/v1/masterData/getAddressInfo", // description: "Returns current active addresses with street and zip", // }, // { // name: "getMissingPkgData", // endpoint: "/api/v1/masterData/getMissingPKGData", // description: "Returns all packaging data that is missing either printer, layout, or carton layout", // }, { name: "getCustomerInventory", endpoint: "/api/datamart/getcustomerinventory", description: "Returns specific customer inventory based on there address ID.", criteria: "customer", }, // { // name: "getPalletLabels", // endpoint: "/api/v1/masterData/getPalletLabels", // description: "Returns specific amount of pallets RN, Needs label number and printer, Specfic to Dayton.", // criteria: "runningNumber,printerName,count", // }, { name: "getopenorders", endpoint: "/api/datamart/getopenorders", description: "Returns open orders based on day count sent over, sDay 15 days in the past eDay 5 days in the future, can be left empty for this default days", criteria: "sDay,eDay", }, // { // name: "getOpenIncoming", // endpoint: "/api/v1/masterData/getOpenIncoming", // description: // "Returns open orders based on day count sent over, sDay 15 days in the past eDay 5 days in the future, can be left empty for this default days", // criteria: "sDay,eDay", // }, // { // name: "planningCheckPkg", // endpoint: "/api/v1/masterData/planningPkgCheck", // description: "Returns all lots starting later than today and has a pkg that is missing layouts.", // }, { name: "getinventory", endpoint: "/api/datamart/getinventory", // description: "Returns all inventory, by default excludes running numebrs, also excludes inv locations.", description: "Returns all inventory, excludes inv locations. no running numbers", criteria: "includeRunnningNumbers", // uncomment this out once the improt process can be faster }, // { // name: "getOpenOrderUpdates", // endpoint: "/api/v1/masterData/getOpenOrderUpdates", // // description: "Returns all inventory, by default excludes running numebrs, also excludes inv locations.", // description: "Returns all orders based on customer id, leaving empty will pull everythinng in.", // criteria: "customer", // uncomment this out once the improt process can be faster // }, { name: "getSiloAdjustment", endpoint: "/api/logistics/getsilosdjustment", // description: "Returns all inventory, by default excludes running numebrs, also excludes inv locations.", description: "Returns all siloadjustments in selected date range IE: 1/1/2025 to 1/31/2025", criteria: "startDate,endDate", // uncomment this out once the improt process can be faster }, { name: "Delivery by date trange", endpoint: "/api/datamart/deliverybydaterange", // description: "Returns all inventory, by default excludes running numebrs, also excludes inv locations.", description: "Returns all Deliverys in selected date range IE: 1/1/2025 to 1/31/2025", criteria: "start,end", // uncomment this out once the improt process can be faster }, ]; app.openapi( createRoute({ tags: ["dataMart"], summary: "Returns all avalible querys.", method: "get", path: "/getavalibleaquerys", responses: responses(), }), async (c) => { //const body = await c.req.json(); // make sure we have a vaid user being accessed thats really logged in //apiHit(c, { endpoint: `api/logger/logs/id` }); return c.json({ success: true, message: "All Current Active Querys.", sheetVersion: 2.7, data: current, }); } ); export default app;