import { Router } from "express";
import { createAuthRoutes } from "./auth.routes";
import { createChatRoutes } from "./chat.routes";
import { createEventRoutes } from "./event.routes";
import {
  AuthController,
  ChatController,
  EventController,
  CaldavController,
} from "../controllers";
import { createCaldavRoutes } from "./caldav.routes";

export interface Controllers {
  authController: AuthController;
  chatController: ChatController;
  eventController: EventController;
  caldavController: CaldavController;
}

export function createRoutes(controllers: Controllers): Router {
  const router = Router();

  router.use("/auth", createAuthRoutes(controllers.authController));
  router.use("/chat", createChatRoutes(controllers.chatController));
  router.use("/events", createEventRoutes(controllers.eventController));
  router.use("/caldav", createCaldavRoutes(controllers.caldavController));

  return router;
}

export * from "./auth.routes";
export * from "./chat.routes";
export * from "./event.routes";
