test(materials per day): work on getting this running better

This commit is contained in:
2025-11-19 18:42:58 -06:00
parent 9aa0b31278
commit a30eebf5d3
9 changed files with 373 additions and 186 deletions

View File

@@ -0,0 +1,28 @@
// 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 materialPerDayCheck from "../controller/materialsPerDay/materialPerDay.js";
import runTiImport from "../controller/notifications/tiIntergration.js";
const app = new OpenAPIHono({ strict: false });
app.openapi(
createRoute({
tags: ["notify"],
summary: "Manually trigger TI intergrations.",
method: "get",
path: "/materialPerDayCheck",
//middleware: authMiddleware,
responses: responses(),
}),
async (c) => {
apiHit(c, { endpoint: "/materialPerDayCheck" });
const tiImport = await materialPerDayCheck();
return c.json({
success: tiImport?.success,
message: tiImport?.message,
});
},
);
export default app;