test(fifo index): running fifo index data on 2 servers as a trial to validate data
This commit is contained in:
41
server/services/notifications/routes/fifoIndex.ts
Normal file
41
server/services/notifications/routes/fifoIndex.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
// an external way to creating logs
|
||||
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||
import { apiHit } from "../../../globalUtils/apiHits.js";
|
||||
import fifoIndexCheck from "../controller/notifications/fifoIndex.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
|
||||
app.openapi(
|
||||
createRoute({
|
||||
tags: ["notify"],
|
||||
summary: "Manually trigger TI intergrations.",
|
||||
method: "get",
|
||||
path: "/fifoindex",
|
||||
//middleware: authMiddleware,
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c) => {
|
||||
/**
|
||||
* get the blocking notification stuff
|
||||
*/
|
||||
apiHit(c, { endpoint: "/fifoindex" });
|
||||
|
||||
/**
|
||||
* getting the shipped pallets
|
||||
*/
|
||||
const checkedData = await fifoIndexCheck();
|
||||
|
||||
return c.json({
|
||||
success: true,
|
||||
message: "Fifo index results",
|
||||
data: checkedData.data.palletsOut,
|
||||
fifoCheck: {
|
||||
totalShipped: checkedData.data.totalShipped,
|
||||
inFifo: checkedData.data.inFifo,
|
||||
outOfFifoData: checkedData.data.outOfFifoData,
|
||||
},
|
||||
});
|
||||
}
|
||||
);
|
||||
export default app;
|
||||
Reference in New Issue
Block a user