/*
 * Thalex RPC API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SessionSettlement {
    /// The base currency of the settled PnL.
    #[serde(rename = "base_currency")]
    pub base_currency: String,
    /// The settled profit and loss (PnL) amount before conversion.
    #[serde(rename = "settled_pnl")]
    pub settled_pnl: rust_decimal::Decimal,
    /// The profit and loss (PnL) amount for the position.
    #[serde(rename = "position_pnl")]
    pub position_pnl: rust_decimal::Decimal,
    /// The price at which the asset was converted.
    #[serde(rename = "conversion_price")]
    pub conversion_price: rust_decimal::Decimal,
}

impl SessionSettlement {
    pub fn new(
        base_currency: String,
        settled_pnl: rust_decimal::Decimal,
        position_pnl: rust_decimal::Decimal,
        conversion_price: rust_decimal::Decimal,
    ) -> SessionSettlement {
        SessionSettlement {
            base_currency,
            settled_pnl,
            position_pnl,
            conversion_price,
        }
    }
}
