// @generated
// This file is @generated by prost-build.
// ============================================================================
// Basket Entity
// ============================================================================

/// 바스켓 - 여러 상품을 묶은 덩어리
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Basket {
    /// 리소스 이름 (baskets/{id})
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// 바스켓 ID
    #[prost(int32, tag="2")]
    pub id: i32,
    /// 바스켓 이름
    #[prost(string, tag="3")]
    pub display_name: ::prost::alloc::string::String,
    /// 바스켓 타입
    #[prost(enumeration="BasketType", tag="4")]
    pub basket_type: i32,
    /// 구성 종목 목록
    #[prost(message, repeated, tag="5")]
    pub items: ::prost::alloc::vec::Vec<BasketItem>,
    /// 실행 설정 (분할 주문, 체결률 임계값, 주문 유형 등)
    #[prost(message, optional, tag="6")]
    pub execution_config: ::core::option::Option<ExecutionConfig>,
    /// 생성 시간
    #[prost(message, optional, tag="11")]
    pub create_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 수정 시간
    #[prost(message, optional, tag="12")]
    pub update_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 타입별 설정
    #[prost(oneof="basket::TypeConfig", tags="7, 8")]
    pub type_config: ::core::option::Option<basket::TypeConfig>,
}
/// Nested message and enum types in `Basket`.
pub mod basket {
    /// 타입별 설정
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum TypeConfig {
        /// ETF 구성종목 설정 (basket_type이 ETF_CONSTITUENT인 경우)
        #[prost(message, tag="7")]
        EtfConstituent(super::EtfConstituentConfig),
        /// 청산 설정 (basket_type이 LIQUIDATION인 경우)
        #[prost(message, tag="8")]
        Liquidation(super::LiquidationConfig),
    }
}
/// ETF 구성종목 바스켓 설정
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EtfConstituentConfig {
    /// ETF 심볼
    #[prost(string, tag="1")]
    pub etf_symbol: ::prost::alloc::string::String,
    #[prost(int64, tag="2")]
    pub quantity: i64,
}
/// 청산 바스켓 설정
/// 청산은 방향이 없음 - 롱 포지션은 매도, 숏 포지션은 매수로 자동 결정
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LiquidationConfig {
    /// 청산 목표 시점 (optional)
    #[prost(message, optional, tag="1")]
    pub target_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
/// 바스켓 구성 항목
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasketItem {
    /// 종목 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 수량 (음수 가능: 매도 포지션)
    #[prost(int64, tag="2")]
    pub quantity: i64,
    /// 가격 소스 (바스켓 가치 계산용)
    #[prost(enumeration="PriceSource", tag="3")]
    pub price_source: i32,
    /// 계약 승수 (선물용, 주식은 1.0)
    #[prost(double, tag="4")]
    pub multiple: f64,
    /// 주문에 사용할 펀드 코드
    #[prost(string, tag="5")]
    pub fund_code: ::prost::alloc::string::String,
}
// ============================================================================
// Execution Configuration
// ============================================================================

/// 실행 설정
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutionConfig {
    /// 분할 주문 횟수 (1 = 한 번에 전량 주문)
    #[prost(uint32, tag="1")]
    pub rounds: u32,
    /// 라운드 간 딜레이 (ms)
    #[prost(uint64, tag="2")]
    pub round_delay_ms: u64,
    /// 다음 라운드 진행을 위한 체결률 임계값 (0.0~1.0)
    #[prost(double, tag="3")]
    pub fill_threshold_pct: f64,
    /// 주문 유형
    #[prost(enumeration="OrderType", tag="4")]
    pub order_type: i32,
    /// 심볼별 호가 설정 (optional)
    #[prost(map="string, message", tag="5")]
    pub pricing_configs: ::std::collections::HashMap<::prost::alloc::string::String, SymbolPricingConfig>,
}
/// 심볼별 호가 설정
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SymbolPricingConfig {
    /// 매수 시 사용할 가격
    #[prost(enumeration="PriceSource", tag="1")]
    pub buy_price_source: i32,
    /// 매도 시 사용할 가격
    #[prost(enumeration="PriceSource", tag="2")]
    pub sell_price_source: i32,
    /// 가격 조정 (틱 단위, +: 공격적, -: 보수적)
    #[prost(int32, tag="3")]
    pub price_offset_ticks: i32,
}
// ============================================================================
// Basket Value
// ============================================================================

/// 바스켓 가치 (현재 시세 기준)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasketValue {
    /// 리소스 이름 (baskets/{id})
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// 바스켓 ID
    #[prost(int32, tag="2")]
    pub id: i32,
    /// 총 가치 (원)
    #[prost(int64, tag="3")]
    pub total_value: i64,
    /// 구성종목별 가치
    #[prost(message, repeated, tag="4")]
    pub item_values: ::prost::alloc::vec::Vec<BasketItemValue>,
    /// 계산 시간
    #[prost(message, optional, tag="5")]
    pub calculated_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
/// 구성종목 가치
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasketItemValue {
    /// 종목 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 수량
    #[prost(int64, tag="2")]
    pub quantity: i64,
    /// 사용된 가격
    #[prost(string, tag="3")]
    pub price: ::prost::alloc::string::String,
    /// 가격 소스
    #[prost(enumeration="PriceSource", tag="4")]
    pub price_source: i32,
    /// 계약 승수
    #[prost(double, tag="5")]
    pub multiple: f64,
    /// 종목 가치 (price * quantity * multiple)
    #[prost(int64, tag="6")]
    pub value: i64,
}
// ============================================================================
// Request/Response Messages
// ============================================================================

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBasketRequest {
    /// 리소스 이름 (baskets/{id})
    #[prost(string, tag="1")]
    pub basket: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBasketsRequest {
    /// 페이지 크기 (optional)
    #[prost(int32, optional, tag="1")]
    pub page_size: ::core::option::Option<i32>,
    /// 페이지 토큰 (optional, for pagination)
    #[prost(string, optional, tag="2")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// 필터링 조건 (optional, AIP-160)
    ///
    /// Available Fields:
    /// * basket_type - 바스켓 타입 (BASKET_TYPE_ETF_CONSTITUENT, BASKET_TYPE_LIQUIDATION, BASKET_TYPE_CUSTOM)
    /// * display_name - 바스켓 이름 (문자열, 부분 일치)
    /// * etf_constituent.etf_symbol - ETF 심볼 (ETF_CONSTITUENT 타입인 경우)
    ///
    /// Operators:
    /// * = : 일치
    /// * != : 불일치
    /// * : : 포함 (문자열 부분 일치)
    ///
    /// Examples:
    /// * basket_type=BASKET_TYPE_ETF_CONSTITUENT
    /// * basket_type!=BASKET_TYPE_CUSTOM
    /// * display_name:"KODEX"
    /// * etf_constituent.etf_symbol="069500"
    /// * basket_type=BASKET_TYPE_ETF_CONSTITUENT AND etf_constituent.etf_symbol="069500"
    /// * basket_type=BASKET_TYPE_LIQUIDATION AND display_name:"청산"
    #[prost(string, tag="3")]
    pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBasketsResponse {
    /// 바스켓 목록
    #[prost(message, repeated, tag="1")]
    pub baskets: ::prost::alloc::vec::Vec<Basket>,
    /// 다음 페이지 토큰
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateBasketRequest {
    /// 생성할 바스켓
    #[prost(message, optional, tag="1")]
    pub basket: ::core::option::Option<Basket>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateBasketRequest {
    /// 수정할 바스켓
    #[prost(message, optional, tag="1")]
    pub basket: ::core::option::Option<Basket>,
    /// 수정할 필드 마스크
    #[prost(message, optional, tag="2")]
    pub update_mask: ::core::option::Option<super::super::super::google::protobuf::FieldMask>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteBasketRequest {
    /// 리소스 이름 (baskets/{id})
    #[prost(string, tag="1")]
    pub basket: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBasketValueRequest {
    /// 리소스 이름 (baskets/{id})
    #[prost(string, tag="1")]
    pub basket: ::prost::alloc::string::String,
}
/// 바스켓 타입
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BasketType {
    Unspecified = 0,
    /// ETF 구성종목 바스켓 (PDF 기반 자동 계산)
    EtfConstituent = 1,
    /// 청산 바스켓 (잔고 전량 청산: 롱→매도, 숏→매수)
    Liquidation = 2,
    /// 커스텀 바스켓 (수동 구성)
    Custom = 3,
}
impl BasketType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            BasketType::Unspecified => "BASKET_TYPE_UNSPECIFIED",
            BasketType::EtfConstituent => "BASKET_TYPE_ETF_CONSTITUENT",
            BasketType::Liquidation => "BASKET_TYPE_LIQUIDATION",
            BasketType::Custom => "BASKET_TYPE_CUSTOM",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "BASKET_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "BASKET_TYPE_ETF_CONSTITUENT" => Some(Self::EtfConstituent),
            "BASKET_TYPE_LIQUIDATION" => Some(Self::Liquidation),
            "BASKET_TYPE_CUSTOM" => Some(Self::Custom),
            _ => None,
        }
    }
}
/// 가격 소스
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PriceSource {
    Unspecified = 0,
    /// (bid1 + ask1) / 2
    MidPrice = 1,
    /// 최우선 매수호가
    Bid1 = 2,
    /// 최우선 매도호가
    Ask1 = 3,
    /// 2차 매수호가
    Bid2 = 4,
    /// 2차 매도호가
    Ask2 = 5,
    /// 최근 체결가
    LastPrice = 6,
    /// 3차 매수호가
    Bid3 = 7,
    /// 3차 매도호가
    Ask3 = 8,
}
impl PriceSource {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            PriceSource::Unspecified => "PRICE_SOURCE_UNSPECIFIED",
            PriceSource::MidPrice => "PRICE_SOURCE_MID_PRICE",
            PriceSource::Bid1 => "PRICE_SOURCE_BID1",
            PriceSource::Ask1 => "PRICE_SOURCE_ASK1",
            PriceSource::Bid2 => "PRICE_SOURCE_BID2",
            PriceSource::Ask2 => "PRICE_SOURCE_ASK2",
            PriceSource::LastPrice => "PRICE_SOURCE_LAST_PRICE",
            PriceSource::Bid3 => "PRICE_SOURCE_BID3",
            PriceSource::Ask3 => "PRICE_SOURCE_ASK3",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PRICE_SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
            "PRICE_SOURCE_MID_PRICE" => Some(Self::MidPrice),
            "PRICE_SOURCE_BID1" => Some(Self::Bid1),
            "PRICE_SOURCE_ASK1" => Some(Self::Ask1),
            "PRICE_SOURCE_BID2" => Some(Self::Bid2),
            "PRICE_SOURCE_ASK2" => Some(Self::Ask2),
            "PRICE_SOURCE_LAST_PRICE" => Some(Self::LastPrice),
            "PRICE_SOURCE_BID3" => Some(Self::Bid3),
            "PRICE_SOURCE_ASK3" => Some(Self::Ask3),
            _ => None,
        }
    }
}
/// 주문 유형
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderType {
    Unspecified = 0,
    /// 시장가
    Market = 1,
    /// 지정가 (pricing_config 기반)
    Limit = 2,
    /// 공격적 지정가 (상대호가)
    Aggressive = 3,
}
impl OrderType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            OrderType::Unspecified => "ORDER_TYPE_UNSPECIFIED",
            OrderType::Market => "ORDER_TYPE_MARKET",
            OrderType::Limit => "ORDER_TYPE_LIMIT",
            OrderType::Aggressive => "ORDER_TYPE_AGGRESSIVE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_TYPE_MARKET" => Some(Self::Market),
            "ORDER_TYPE_LIMIT" => Some(Self::Limit),
            "ORDER_TYPE_AGGRESSIVE" => Some(Self::Aggressive),
            _ => None,
        }
    }
}
include!("kdo.v1.basket.tonic.rs");
include!("kdo.v1.basket.serde.rs");
// @@protoc_insertion_point(module)