import { Router } from "express";
import { adminRouter } from "./admin.routes.js";
import { authRouter } from "./auth.routes.js";
import { orderRouter } from "./order.routes.js";
import { paymentRouter } from "./payment.routes.js";
import { printRouter } from "./print.routes.js";
import { productRouter } from "./product.routes.js";
import { quoteRouter } from "./quote.routes.js";
import { supportRouter } from "./support.routes.js";
import { vendorRouter } from "./vendor.routes.js";

export function registerRoutes(app) {
  const api = Router();

  api.get("/health", (_request, response) => response.json({ status: "ok", service: "omosala-marketplace-api" }));
  api.use("/auth", authRouter);
  api.use("/products", productRouter);
  api.use("/orders", orderRouter);
  api.use("/vendors", vendorRouter);
  api.use("/payments", paymentRouter);
  api.use("/quotes", quoteRouter);
  api.use("/print", printRouter);
  api.use("/support", supportRouter);
  api.use("/admin", adminRouter);

  app.use("/api", api);
}
