test(reporting): more reporting tables for different reports

This commit is contained in:
2025-04-13 08:27:28 -05:00
parent 17b6c0ac66
commit 9325e58551
17 changed files with 434 additions and 122 deletions

View File

@@ -0,0 +1,53 @@
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
import { responses } from "../../../globalUtils/routeDefs/responses.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { getCycleCountCheck } from "../controller/warehouse/cycleCountChecks/getCycleCountCheck.js";
import { getPPOO } from "../controller/warehouse/ppoo/getPPOO.js";
const app = new OpenAPIHono();
// const Body = z
// .object({
// age: z.number().optional().openapi({ example: 90 }),
// //email: z.string().optional().openapi({example: "s.smith@example.com"}),
// type: z.string().optional().openapi({ example: "fg" }),
// })
// .openapi("User");
app.openapi(
createRoute({
tags: ["logistics"],
summary: "Returns pallets currently in ppoo",
method: "get",
path: "/getppoo",
// request: {
// body: {
// content: {
// "application/json": { schema: Body },
// },
// },
// },
// description:
// "Provided a running number and lot number you can consume material.",
responses: responses(),
}),
async (c) => {
//apiHit(c, { endpoint: "api/sqlProd/close" });
const { data: ppoo, error } = await tryCatch(getPPOO());
if (error) {
return c.json({
success: false,
message: "Error getting lane data.",
data: error,
});
}
return c.json({
success: ppoo.success,
message: ppoo.message,
data: ppoo.data,
});
}
);
export default app;