use std::sync::Arc;

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

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

pub fn router() -> Router<Arc<AppState>> {
    Router::new()
        .route("/{server_id}/trigger", post(trigger_wipe))
        .route("/{server_id}/dry-run", post(dry_run_wipe))
        .route("/{wipe_id}/rollback", post(rollback_wipe))
        .route("/{wipe_id}/status", get(get_wipe_status))
        .route("/history", get(get_wipe_history))
        .route("/history/{id}", get(get_wipe_history_detail))
}

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

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

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

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

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

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