import { OpenAPIHono } from "@hono/zod-openapi";

// routes
import getInfo from "./route/getInfo.js";
import postRunningNr from "./route/postRunningNumber.js";
import pickedup from "./route/pickedUp.js";
import postsscc from "./route/postSSCC.js";
import getShipments from "./route/getShipmentPallets.js";
import cycleCount from "./route/cycleCount.js";
import { serve } from "@hono/node-server";
import { createLog } from "../logger/logger.js";
import { db } from "../../../database/dbclient.js";
import { settings } from "../../../database/schema/settings.js";
import manualTrigger from "./route/triggerCamera.js";

const app = new OpenAPIHono();
const port = process.env.OCME_PORT;
const routes = [
    getInfo,
    postRunningNr,
    postsscc,
    pickedup,
    getShipments,
    cycleCount,
    manualTrigger,
] as const;

const appRoutes = routes.forEach((route) => {
    app.route("/api/v1", route);
});

app.all("/api/v1/*", (c) => {
    return c.json({
        success: false,
        message: "you have encounted an ocme route that dose not exist.",
    });
});

export default app;
