pub mod code_review;
pub mod model;
pub mod model_capability;
pub mod model_parameter_profile;
pub mod model_pricing;
pub mod model_version;
pub mod pr_summary;
pub mod provider;

use actix_web::web;

pub fn init_agent_routes(cfg: &mut web::ServiceConfig) {
    cfg.service(
        web::scope("/agents")
            .route(
                "/code-review/{namespace}/{repo}",
                web::post().to(code_review::trigger_code_review),
            )
            .route(
                "/pr-description/{namespace}/{repo}",
                web::post().to(pr_summary::generate_pr_description),
            )
            .route("/providers", web::get().to(provider::provider_list))
            .route("/providers/{id}", web::get().to(provider::provider_get))
            .route("/providers", web::post().to(provider::provider_create))
            .route(
                "/providers/{id}",
                web::patch().to(provider::provider_update),
            )
            .route(
                "/providers/{id}",
                web::delete().to(provider::provider_delete),
            )
            .route("/models", web::get().to(model::model_list))
            .route("/models/{id}", web::get().to(model::model_get))
            .route("/models", web::post().to(model::model_create))
            .route("/models/{id}", web::patch().to(model::model_update))
            .route("/models/{id}", web::delete().to(model::model_delete))
            .route(
                "/versions",
                web::get().to(model_version::model_version_list),
            )
            .route(
                "/versions/{id}",
                web::get().to(model_version::model_version_get),
            )
            .route(
                "/versions",
                web::post().to(model_version::model_version_create),
            )
            .route(
                "/versions/{id}",
                web::patch().to(model_version::model_version_update),
            )
            .route(
                "/versions/{id}",
                web::delete().to(model_version::model_version_delete),
            )
            .route(
                "/versions/{model_version_id}/pricing",
                web::get().to(model_pricing::model_pricing_list),
            )
            .route(
                "/pricing/{id}",
                web::get().to(model_pricing::model_pricing_get),
            )
            .route(
                "/pricing",
                web::post().to(model_pricing::model_pricing_create),
            )
            .route(
                "/pricing/{id}",
                web::patch().to(model_pricing::model_pricing_update),
            )
            .route(
                "/pricing/{id}",
                web::delete().to(model_pricing::model_pricing_delete),
            )
            .route(
                "/versions/{model_version_id}/capabilities",
                web::get().to(model_capability::model_capability_list),
            )
            .route(
                "/capabilities/{id}",
                web::get().to(model_capability::model_capability_get),
            )
            .route(
                "/capabilities",
                web::post().to(model_capability::model_capability_create),
            )
            .route(
                "/capabilities/{id}",
                web::patch().to(model_capability::model_capability_update),
            )
            .route(
                "/capabilities/{id}",
                web::delete().to(model_capability::model_capability_delete),
            )
            .route(
                "/versions/{model_version_id}/parameters",
                web::get().to(model_parameter_profile::model_parameter_profile_list),
            )
            .route(
                "/parameters/{id}",
                web::get().to(model_parameter_profile::model_parameter_profile_get),
            )
            .route(
                "/parameters",
                web::post().to(model_parameter_profile::model_parameter_profile_create),
            )
            .route(
                "/parameters/{id}",
                web::patch().to(model_parameter_profile::model_parameter_profile_update),
            )
            .route(
                "/parameters/{id}",
                web::delete().to(model_parameter_profile::model_parameter_profile_delete),
            ),
    );
}
