/*
 * 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 PointsPeriodDto {
    /// Id representing the points period entry
    #[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,
    /// Epoch number within the season
    #[serde(rename = "epoch")]
    pub epoch: i64,
    /// Points earned in this period (excluding referral points) expressed as a decimal (precision: 9)
    #[serde(rename = "points")]
    pub points: String,
    /// Referral points earned in this period expressed as a decimal (precision: 9)
    #[serde(rename = "referralPoints")]
    pub referral_points: String,
    /// Beginning of points period (ms since Unix Epoch)
    #[serde(rename = "startedAt")]
    pub started_at: i64,
    /// End of points period (ms since Unix Epoch)
    #[serde(rename = "endedAt")]
    pub ended_at: i64,
    /// Optional name for the points period
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Points period creation timestamp (ms since Unix Epoch)
    #[serde(rename = "createdAt")]
    pub created_at: i64,
    /// Points period last update timestamp (ms since Unix Epoch)
    #[serde(rename = "updatedAt")]
    pub updated_at: i64,
}

impl PointsPeriodDto {
    pub fn new(
        id: uuid::Uuid,
        address: String,
        season: i64,
        epoch: i64,
        points: String,
        referral_points: String,
        started_at: i64,
        ended_at: i64,
        created_at: i64,
        updated_at: i64,
    ) -> PointsPeriodDto {
        PointsPeriodDto {
            id,
            address,
            season,
            epoch,
            points,
            referral_points,
            started_at,
            ended_at,
            name: None,
            created_at,
            updated_at,
        }
    }
}
