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

/// Gitea release information
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GiteaRelease {
    pub id: u64,
    pub tag_name: String,
    pub name: String,
    pub body: String,
    pub draft: bool,
    pub prerelease: bool,
    pub created_at: DateTime<Utc>,
    pub published_at: Option<DateTime<Utc>>,
    pub author: GiteaUser,
    pub assets: Vec<GiteaAsset>,
}

/// Gitea user information
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GiteaUser {
    pub id: u64,
    pub login: String,
    pub full_name: Option<String>,
    pub email: Option<String>,
}

/// Gitea release asset
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GiteaAsset {
    pub id: u64,
    pub name: String,
    pub size: u64,
    pub download_count: u64,
    pub created_at: DateTime<Utc>,
    pub browser_download_url: String,
}

/// Gitea repository information
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GiteaRepository {
    pub id: u64,
    pub name: String,
    pub full_name: String,
    pub description: Option<String>,
    pub owner: GiteaUser,
    pub html_url: String,
    pub created_at: DateTime<Utc>,
    pub updated_at: DateTime<Utc>,
    pub archived: bool,
}

/// Gitea tag information
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GiteaTag {
    pub name: String,
    pub message: String,
    pub commit: GiteaCommit,
}

/// Gitea commit information
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GiteaCommit {
    pub sha: String,
    pub url: String,
}
