/*
 * 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: i64,
    /// Total points earned (excluding referral points) in this season expressed as a decimal (precision: 9)
    #[serde(rename = "totalPoints")]
    pub total_points: String,
    /// Total points earned (excluding referral points) before most recent distribution expressed as a decimal (precision: 9)
    #[serde(rename = "previousTotalPoints")]
    pub previous_total_points: String,
    /// Referral points earned in this season expressed as a decimal (precision: 9)
    #[serde(rename = "referralPoints")]
    pub referral_points: String,
    /// Referral points earned in this season 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: i64,
    /// Rank before most recent distribution
    #[serde(rename = "previousRank")]
    pub previous_rank: i64,
    #[serde(rename = "tier")]
    pub tier: models::TierEnum,
    /// Points season summary creation timestamp (ms since Unix Epoch)
    #[serde(rename = "createdAt")]
    pub created_at: i64,
    /// Points season summary last update timestamp (ms since Unix Epoch)
    #[serde(rename = "updatedAt")]
    pub updated_at: i64,
}

impl PointsSeasonSummaryDto {
    pub fn new(
        id: uuid::Uuid,
        address: String,
        season: i64,
        total_points: String,
        previous_total_points: String,
        referral_points: String,
        previous_referral_points: String,
        rank: i64,
        previous_rank: i64,
        tier: models::TierEnum,
        created_at: i64,
        updated_at: i64,
    ) -> PointsSeasonSummaryDto {
        PointsSeasonSummaryDto {
            id,
            address,
            season,
            total_points,
            previous_total_points,
            referral_points,
            previous_referral_points,
            rank,
            previous_rank,
            tier,
            created_at,
            updated_at,
        }
    }
}
