feat(notify): material per day for the next 90 days
This commit is contained in:
37
lstV2/server/services/notifications/routes/materialPerDay.ts
Normal file
37
lstV2/server/services/notifications/routes/materialPerDay.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// an external way to creating logs
|
||||
import { createRoute, OpenAPIHono, z } from "@hono/zod-openapi";
|
||||
import { apiHit } from "../../../globalUtils/apiHits.js";
|
||||
import { responses } from "../../../globalUtils/routeDefs/responses.js";
|
||||
import fifoIndexCheck from "../controller/notifications/fifoIndex.js";
|
||||
import materialPerDayCheck from "../controller/notifications/materialPerDay.js";
|
||||
|
||||
const app = new OpenAPIHono({ strict: false });
|
||||
|
||||
app.openapi(
|
||||
createRoute({
|
||||
tags: ["notify"],
|
||||
summary: "",
|
||||
method: "get",
|
||||
path: "/materialperday",
|
||||
//middleware: authMiddleware,
|
||||
responses: responses(),
|
||||
}),
|
||||
async (c) => {
|
||||
/**
|
||||
* get the blocking notification stuff
|
||||
*/
|
||||
apiHit(c, { endpoint: "/materialperday" });
|
||||
|
||||
/**
|
||||
* getting the shipped pallets
|
||||
*/
|
||||
const checkedData = await materialPerDayCheck();
|
||||
|
||||
return c.json({
|
||||
success: checkedData.success,
|
||||
message: checkedData.message,
|
||||
data: checkedData.data,
|
||||
});
|
||||
},
|
||||
);
|
||||
export default app;
|
||||
Reference in New Issue
Block a user