/*
 * 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: f64,
    /// Epoch number within the season
    #[serde(rename = "epoch")]
    pub epoch: f64,
    /// Points earned in this epoch expressed as a decimal (precision: 9)
    #[serde(rename = "points")]
    pub points: String,
    /// Referral points earned in this epoch 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: f64,
    /// End of points period (ms since Unix Epoch)
    #[serde(rename = "endedAt")]
    pub ended_at: f64,
    /// Points period creation timestamp (ms since Unix Epoch)
    #[serde(rename = "createdAt")]
    pub created_at: f64,
    /// Points period last update timestamp (ms since Unix Epoch)
    #[serde(rename = "updatedAt")]
    pub updated_at: f64,
}

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