import { type Express, Router } from "express";
import { requireAuth } from "../middleware/auth.middleware.js";
import { featureCheck } from "../middleware/featureActive.middleware.js";
import listener from "./ocp.printer.listener.js";
import update from "./ocp.printer.update.js";

export const setupOCPRoutes = (baseUrl: string, app: Express) => {
	//setup all the routes
	const router = Router();

	// is the feature even on?
	router.use(featureCheck("ocp"));

	// non auth routes up here
	router.use(listener);

	// auth routes below here
	router.use(requireAuth);

	router.use(update);
	//router.use("");

	app.use(`${baseUrl}/api/ocp`, router);
};
