use crate::market::meme_market::{MemeMarketTradingFee, MemeMarketTradingSettings};
use crate::market::MarketIdentifier;
use crate::{AssetAmount, MemeMarketId, WalletRegisterId};
use serde::{Deserialize, Serialize};

/// Represents the registration of a meme market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct MemeMarketRegistration {
    /// Identifier for the meme market
    pub identifier: MarketIdentifier,

    /// Quantity of the base asset
    pub base_asset_quantity: AssetAmount,

    /// Quantity of the quote asset
    pub quote_asset_quantity: AssetAmount,
}

/// Represents an update to the initial trading settings of a meme market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateMemeMarketInitialTradingSettings {
    /// New trading settings for the meme market
    pub settings: MemeMarketTradingSettings,
}

/// Represents an update to the trading settings of a meme market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateMemeMarketTradingSettings {
    /// Identifier for the meme market
    pub market_id: MemeMarketId,

    /// New trading settings for the meme market
    pub trading_settings: MemeMarketTradingSettings,
}

/// Represents a claim for the trading fee of a meme market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct ClaimMemeMarketTradingFee {
    /// Identifier for the meme market
    pub market_id: MemeMarketId,

    /// Amount of the base asset fee
    pub base: AssetAmount,

    /// Amount of the quote asset fee
    pub quote: AssetAmount,
}

/// Represents an update to the initial fee recipient of a meme market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateMemeMarketInitialFeeTo {
    /// New fee recipient
    pub fee_to: WalletRegisterId,
}

/// Represents an update to the fee recipient of a meme market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateMemeMarketFeeTo {
    /// Identifier for the meme market
    pub market_id: MemeMarketId,

    /// New fee recipient
    pub fee_to: WalletRegisterId,
}

/// Represents an update to the initial trading fee of a meme market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateMemeMarketInitialTradingFee {
    /// New trading fee
    pub fee: MemeMarketTradingFee,
}

/// Represents an update to the trading fee of a meme market
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct UpdateMemeMarketTradingFee {
    /// Identifier for the meme market
    pub market_id: MemeMarketId,

    /// New trading fee
    pub fee: MemeMarketTradingFee,
}

#[cfg(test)]
mod tests;
