pub mod health;
pub mod admin;
pub mod analytics;
pub mod bets;
pub mod events;
pub mod experiments;
pub mod localization;
pub mod markets;
pub mod results;
pub mod session;

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

pub fn router() -> Router {
    Router::new()
        .route("/health", get(health::handler))
        .route("/api/v1/feed/next", get(events::next))
        .route("/api/v1/events/{event_id}", get(events::show))
        .route("/api/v1/events/{event_id}/manifest", get(events::manifest))
        .route("/api/v1/events/{event_id}/markets", get(markets::list_for_event))
        .route("/api/v1/events/{event_id}/result", get(results::show))
        .route("/api/v1/markets/{market_id}/odds/current", get(markets::current_odds))
        .route("/api/v1/admin/events", post(admin::create_event))
        .route("/api/v1/admin/markets", post(admin::create_market))
        .route("/api/v1/admin/odds", post(admin::create_odds))
        .route("/api/v1/admin/settlements", post(admin::create_settlement))
        .route("/api/v1/bets/intent", post(bets::submit))
        .route("/api/v1/bets/{bet_intent_id}", get(bets::show))
        .route("/api/v1/analytics/batch", post(analytics::batch))
        .route("/api/v1/experiments/config", get(experiments::config))
        .route("/api/v1/localization/{locale_code}", get(localization::bundle))
        .route("/api/v1/session/start", post(session::start))
        .route("/api/v1/session/end", post(session::end))
        .route("/api/v1/session/me", get(session::me))
}
