use crate::user_role::UserRole;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct AddChannelRequest {
    pub name: String,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct AddPlatformRequest {
    pub name: String,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct AddGameRequest {
    pub name_id: String,
    pub name: String,
    pub description: String,
    pub author: String,
    pub default_channel_name: Option<String>,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct GetReleaseRequest {
    pub game_name_id: String,
    pub platform: String,
    pub version: String,
    pub channel: String,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct AddUserRequest {
    pub username: String,
    pub password: String,
    pub email: String,
    pub role: UserRole,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct GetGamesRequest {
    pub platform: Option<String>,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct GetGamesResponse {
    pub games: Vec<GameInfoResponse>,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct GameInfoResponse {
    pub name_id: String,
    pub name: String,
    pub author: String,
    pub description: String,
    pub default_channel: Option<String>,
    pub release_date: DateTime<Utc>,
    pub releases: Vec<ReleaseInfoResponse>,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct ReleaseInfoResponse {
    pub channel: String,
    pub version: String,
    pub platform: String,
    pub description: String,
    pub release_date: DateTime<Utc>,
    pub executable_path: String,
    pub size_bytes: u64,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct AddGameAccessRequest {
    pub game_name_id: String,
    pub username: String,
}
