//! This code was AUTOGENERATED using the Codama library.
use {
    carbon_core::graphql::primitives::{Pubkey, U128, U64},
    juniper::GraphQLObject,
};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "CreatePersonalPositionEvent")]
pub struct CreatePersonalPositionEventGraphQL {
    pub pool_state: Pubkey,
    pub minter: Pubkey,
    pub nft_owner: Pubkey,
    pub tick_lower_index: i32,
    pub tick_upper_index: i32,
    pub liquidity: U128,
    pub deposit_amount0: U64,
    pub deposit_amount1: U64,
    pub deposit_amount0_transfer_fee: U64,
    pub deposit_amount1_transfer_fee: U64,
}

impl From<crate::types::CreatePersonalPositionEvent> for CreatePersonalPositionEventGraphQL {
    fn from(original: crate::types::CreatePersonalPositionEvent) -> Self {
        Self {
            pool_state: carbon_core::graphql::primitives::Pubkey(original.pool_state),
            minter: carbon_core::graphql::primitives::Pubkey(original.minter),
            nft_owner: carbon_core::graphql::primitives::Pubkey(original.nft_owner),
            tick_lower_index: original.tick_lower_index,
            tick_upper_index: original.tick_upper_index,
            liquidity: carbon_core::graphql::primitives::U128(original.liquidity),
            deposit_amount0: carbon_core::graphql::primitives::U64(original.deposit_amount0),
            deposit_amount1: carbon_core::graphql::primitives::U64(original.deposit_amount1),
            deposit_amount0_transfer_fee: carbon_core::graphql::primitives::U64(
                original.deposit_amount0_transfer_fee,
            ),
            deposit_amount1_transfer_fee: carbon_core::graphql::primitives::U64(
                original.deposit_amount1_transfer_fee,
            ),
        }
    }
}
