import { OpenAPIHono } from "@hono/zod-openapi";
import produser from "./routes/produser.js";
import createProdRole from "./routes/addProdRole.js";
import getRoles from "./routes/getProdRoles.js";
import { prodRoles } from "./utils/prodRoles.js";

const app = new OpenAPIHono();
const routes = [produser, createProdRole, getRoles] as const;

const appRoutes = routes.forEach((route) => {
    app.route("/produser", route);
});
app.all("/produser/*", (c) => {
    return c.json({
        success: false,
        message: "You have encounters a prodUser route that dose not exist.",
    });
});

setTimeout(() => {
    prodRoles();
}, 2000);

export default app;
