/*
 * Ethereal Exchange API
 *
 * Ethereal HTTP API for real-time trading, order management, and market data access.
 *
 * The version of the OpenAPI document: 0.1.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PointsSeasonSummaryDto {
    /// Id representing the summary of points in this season
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// Address of the account (non-checksummed)
    #[serde(rename = "address")]
    pub address: String,
    /// Season number
    #[serde(rename = "season")]
    pub season: f64,
    /// Total points earned including referral points in this season expressed as a decimal (precision: 9)
    #[serde(rename = "totalPoints")]
    pub total_points: String,
    /// Total points earned before most recent distribution expressed as a decimal (precision: 9)
    #[serde(rename = "previousTotalPoints")]
    pub previous_total_points: String,
    /// Referral points earned expressed as a decimal (precision: 9)
    #[serde(rename = "referralPoints")]
    pub referral_points: String,
    /// Referral points earned before most recent distribution expressed as a decimal (precision: 9)
    #[serde(rename = "previousReferralPoints")]
    pub previous_referral_points: String,
    /// Current rank in this season
    #[serde(rename = "rank")]
    pub rank: f64,
    /// Rank before most recent distribution
    #[serde(rename = "previousRank")]
    pub previous_rank: f64,
    /// Account tier derived based on activity this season
    #[serde(rename = "tier")]
    pub tier: Tier,
    /// Points season summary creation timestamp (ms since Unix Epoch)
    #[serde(rename = "createdAt")]
    pub created_at: f64,
    /// Points season summary last update timestamp (ms since Unix Epoch)
    #[serde(rename = "updatedAt")]
    pub updated_at: f64,
}

impl PointsSeasonSummaryDto {
    pub fn new(
        id: uuid::Uuid,
        address: String,
        season: f64,
        total_points: String,
        previous_total_points: String,
        referral_points: String,
        previous_referral_points: String,
        rank: f64,
        previous_rank: f64,
        tier: Tier,
        created_at: f64,
        updated_at: f64,
    ) -> PointsSeasonSummaryDto {
        PointsSeasonSummaryDto {
            id,
            address,
            season,
            total_points,
            previous_total_points,
            referral_points,
            previous_referral_points,
            rank,
            previous_rank,
            tier,
            created_at,
            updated_at,
        }
    }
}
/// Account tier derived based on activity this season
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Tier {
    #[serde(rename = "0")]
    TIER_0,
    #[serde(rename = "1")]
    TIER_1,
    #[serde(rename = "2")]
    TIER_2,
    #[serde(rename = "3")]
    TIER_3,
    #[serde(rename = "4")]
    TIER_4,
    #[serde(rename = "5")]
    TIER_5,
}

impl Default for Tier {
    fn default() -> Tier {
        Self::TIER_0
    }
}
