use actix_web::web;

pub fn init_routes(cfg: &mut web::ServiceConfig) {
    cfg.service(
        web::scope("/ws")
            .route("", web::get().to(crate::room::ws_universal::ws_universal))
            .route("/rooms/{room_id}", web::get().to(crate::room::ws::ws_room))
            .route(
                "/projects/{project_id}",
                web::get().to(crate::room::ws::ws_project),
            ),
    );

    cfg.service(
        web::scope("/api")
            .configure(crate::auth::init_auth_routes)
            .configure(crate::git::init_git_routes)
            .configure(crate::git::init_git_toplevel_routes)
            .configure(crate::issue::init_issue_routes)
            .configure(crate::project::init_project_routes)
            .configure(crate::user::init_user_routes)
            .configure(crate::pull_request::init_pull_request_routes)
            .configure(crate::agent::init_agent_routes)
            .configure(crate::workspace::init_workspace_routes)
            .configure(crate::search::init_search_routes)
            .configure(crate::room::init_room_routes)
            .configure(crate::skill::init_skill_routes),
    );
}
