use std::sync::Arc;

use axum::{
    routing::{delete, get, post, put},
    Json, Router,
};

use crate::models::error::ApiResult;
use crate::AppState;

pub fn router() -> Router<Arc<AppState>> {
    Router::new()
        .route("/", get(list_schedules))
        .route("/", post(create_schedule))
        .route("/{id}", get(get_schedule))
        .route("/{id}", put(update_schedule))
        .route("/{id}", delete(delete_schedule))
        .route("/{id}/toggle", post(toggle_schedule))
        .route("/calendar", get(get_calendar))
        .route("/conflicts", get(get_conflicts))
}

async fn list_schedules() -> ApiResult<Json<serde_json::Value>> {
    Ok(Json(serde_json::json!({"status": "not_implemented"})))
}

async fn create_schedule() -> ApiResult<Json<serde_json::Value>> {
    Ok(Json(serde_json::json!({"status": "not_implemented"})))
}

async fn get_schedule() -> ApiResult<Json<serde_json::Value>> {
    Ok(Json(serde_json::json!({"status": "not_implemented"})))
}

async fn update_schedule() -> ApiResult<Json<serde_json::Value>> {
    Ok(Json(serde_json::json!({"status": "not_implemented"})))
}

async fn delete_schedule() -> ApiResult<Json<serde_json::Value>> {
    Ok(Json(serde_json::json!({"status": "not_implemented"})))
}

async fn toggle_schedule() -> ApiResult<Json<serde_json::Value>> {
    Ok(Json(serde_json::json!({"status": "not_implemented"})))
}

async fn get_calendar() -> ApiResult<Json<serde_json::Value>> {
    Ok(Json(serde_json::json!({"status": "not_implemented"})))
}

async fn get_conflicts() -> ApiResult<Json<serde_json::Value>> {
    Ok(Json(serde_json::json!({"status": "not_implemented"})))
}
