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

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitOrderRequest {
    /// 펀드 코드 (필수)
    #[prost(string, tag="1")]
    pub fund_code: ::prost::alloc::string::String,
    /// 종목 코드 ISIN (필수)
    #[prost(string, tag="2")]
    pub symbol: ::prost::alloc::string::String,
    /// 매수/매도 (필수)
    #[prost(enumeration="super::common::OrderSide", tag="3")]
    pub side: i32,
    /// 수량 (필수)
    #[prost(int64, tag="4")]
    pub quantity: i64,
    /// 가격 (필수, 시장가 주문 시 0)
    #[prost(string, tag="5")]
    pub price: ::prost::alloc::string::String,
    /// 주문 유형 (기본: LIMIT)
    #[prost(enumeration="QuoteType", tag="6")]
    pub quote_type: i32,
    /// 유동성 공급자 여부
    #[prost(bool, tag="7")]
    pub is_lp: bool,
    /// 자동정정 전략
    #[prost(enumeration="super::common::AmendMethodType", optional, tag="8")]
    pub auto_amend_strategy: ::core::option::Option<i32>,
    /// 지정가 가격 결정 방식 (미지정 시 price 필드의 가격 사용)
    #[prost(enumeration="LimitPriceType", optional, tag="9")]
    pub limit_price_type: ::core::option::Option<i32>,
    /// 호가조건 (미지정 시 FAS, 일반 지정가)
    #[prost(enumeration="super::common::OrderConditionType", optional, tag="10")]
    pub order_condition: ::core::option::Option<i32>,
    /// 헷지 누적 대상 여부 (미지정 시 false)
    /// true 로 설정하면 외부에서 직접 제출한 주문의 체결도 hedge accumulator 에 누적되어 목표 헷지에 반영됨.
    /// 실제 누적되려면 (fund_code, symbol) 조합으로 Hedge 가 DB 에 등록되어 있어야 함.
    #[prost(bool, optional, tag="11")]
    pub need_hedge: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitOrderResponse {
    /// 주문 ID
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 주문 상태
    #[prost(enumeration="OrderStatus", tag="2")]
    pub status: i32,
    /// 결과 메시지
    #[prost(string, tag="3")]
    pub message: ::prost::alloc::string::String,
}
// ========== AmendOrder ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmendOrderRequest {
    /// 원주문 ID
    #[prost(uint64, tag="1")]
    pub original_order_id: u64,
    /// 종목 코드
    #[prost(string, tag="3")]
    pub symbol: ::prost::alloc::string::String,
    /// 정정 가격
    #[prost(string, tag="5")]
    pub price: ::prost::alloc::string::String,
    /// 매수/매도
    #[prost(enumeration="super::common::OrderSide", tag="6")]
    pub side: i32,
    /// 유동성 공급자 여부
    #[prost(bool, tag="7")]
    pub is_lp: bool,
    /// 주문 유형 (기본: LIMIT)
    #[prost(enumeration="QuoteType", tag="8")]
    pub quote_type: i32,
    /// 펀드 코드 (필수)
    #[prost(string, tag="9")]
    pub fund_code: ::prost::alloc::string::String,
    /// 호가조건 (미지정 시 FAS, 일반 지정가)
    #[prost(enumeration="super::common::OrderConditionType", optional, tag="10")]
    pub order_condition: ::core::option::Option<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AmendOrderResponse {
    /// 신규 주문 ID
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 원주문 ID
    #[prost(uint64, tag="2")]
    pub original_order_id: u64,
    /// 주문 상태
    #[prost(enumeration="OrderStatus", tag="3")]
    pub status: i32,
    /// 결과 메시지
    #[prost(string, tag="4")]
    pub message: ::prost::alloc::string::String,
}
// ========== CancelOrder ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelOrderRequest {
    /// 원주문 ID
    #[prost(uint64, tag="1")]
    pub original_order_id: u64,
    /// 종목 코드
    #[prost(string, tag="3")]
    pub symbol: ::prost::alloc::string::String,
    /// 펀드 코드 (필수)
    #[prost(string, tag="4")]
    pub fund_code: ::prost::alloc::string::String,
    /// 매수/매도
    #[prost(enumeration="super::common::OrderSide", tag="6")]
    pub side: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelOrderResponse {
    /// 취소 주문 ID
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 원주문 ID
    #[prost(uint64, tag="2")]
    pub original_order_id: u64,
    /// 주문 상태
    #[prost(enumeration="OrderStatus", tag="3")]
    pub status: i32,
    /// 결과 메시지
    #[prost(string, tag="4")]
    pub message: ::prost::alloc::string::String,
}
// ========== ListAllUnfilledOrders ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAllUnfilledOrdersRequest {
    /// 펀드 코드 (optional, 미지정 시 전체 펀드)
    #[prost(string, optional, tag="1")]
    pub fund_code: ::core::option::Option<::prost::alloc::string::String>,
    /// 종목 코드 (optional, 미지정 시 전체 종목)
    #[prost(string, optional, tag="2")]
    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
    /// 매수/매도 (optional, 미지정 시 양방향)
    #[prost(enumeration="super::common::OrderSide", optional, tag="3")]
    pub side: ::core::option::Option<i32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAllUnfilledOrdersResponse {
    /// 미체결 주문 목록
    #[prost(message, repeated, tag="1")]
    pub orders: ::prost::alloc::vec::Vec<Order>,
}
// ========== CancelAllOrders ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CancelAllOrdersRequest {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelAllOrdersResponse {
    /// 취소 요청된 주문 수
    #[prost(int32, tag="1")]
    pub cancelled_count: i32,
    /// 결과 메시지
    #[prost(string, tag="2")]
    pub message: ::prost::alloc::string::String,
}
// ========== StreamOrderResults ==========

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamOrderResultsRequest {
    /// 필터: 특정 펀드만 (optional)
    #[prost(string, optional, tag="1")]
    pub fund_code: ::core::option::Option<::prost::alloc::string::String>,
    /// 필터: 특정 종목만 (optional)
    #[prost(string, optional, tag="2")]
    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderResult {
    /// 주문 ID
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 종목 코드
    #[prost(string, tag="2")]
    pub symbol: ::prost::alloc::string::String,
    /// 펀드 코드
    #[prost(string, tag="3")]
    pub fund_code: ::prost::alloc::string::String,
    /// 매수/매도
    #[prost(enumeration="super::common::OrderSide", tag="4")]
    pub side: i32,
    /// 가격
    #[prost(string, tag="5")]
    pub price: ::prost::alloc::string::String,
    /// 수량
    #[prost(int64, tag="6")]
    pub quantity: i64,
    /// 결과 유형
    #[prost(enumeration="OrderResultType", tag="7")]
    pub result_type: i32,
    /// 타임스탬프
    #[prost(message, optional, tag="8")]
    pub timestamp: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// result_type에 따른 추가 정보
    #[prost(oneof="order_result::Details", tags="10, 11, 12, 13")]
    pub details: ::core::option::Option<order_result::Details>,
}
/// Nested message and enum types in `OrderResult`.
pub mod order_result {
    /// result_type에 따른 추가 정보
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Details {
        #[prost(message, tag="10")]
        Received(super::ReceivedDetails),
        #[prost(message, tag="11")]
        Rejected(super::RejectedDetails),
        #[prost(message, tag="12")]
        Filled(super::FilledDetails),
        #[prost(message, tag="13")]
        Cancelled(super::CancelledDetails),
    }
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ReceivedDetails {
    /// 접수 시간 (nanoseconds since epoch)
    #[prost(uint64, tag="1")]
    pub receive_time: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RejectedDetails {
    /// 거부 코드
    #[prost(string, tag="1")]
    pub rejection_code: ::prost::alloc::string::String,
    /// 에러 메시지
    #[prost(string, tag="2")]
    pub error_message: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FilledDetails {
    /// 체결 가격
    #[prost(string, tag="1")]
    pub filled_price: ::prost::alloc::string::String,
    /// 체결 수량
    #[prost(int64, tag="2")]
    pub filled_quantity: i64,
    /// 체결 시간 (nanoseconds since epoch)
    #[prost(uint64, tag="3")]
    pub trade_time: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CancelledDetails {
    /// 취소 코드
    #[prost(string, tag="1")]
    pub cancellation_code: ::prost::alloc::string::String,
    /// 취소 수량
    #[prost(int64, tag="2")]
    pub cancelled_quantity: i64,
}
/// 주문 목록 조회 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrdersRequest {
    /// 필터링 조건 (선택적, AIP-160)
    #[prost(string, tag="1")]
    pub filter: ::prost::alloc::string::String,
    /// 페이징 (AIP-158)
    #[prost(int32, tag="2")]
    pub page_size: i32,
    #[prost(string, tag="3")]
    pub page_token: ::prost::alloc::string::String,
}
/// 주문 목록 조회 응답
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrdersResponse {
    /// 주문 목록
    #[prost(message, repeated, tag="1")]
    pub orders: ::prost::alloc::vec::Vec<Order>,
    /// 다음 페이지 토큰 (AIP-158)
    #[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 Order {
    /// 주문 ID
    #[prost(string, tag="1")]
    pub order_id: ::prost::alloc::string::String,
    /// 주문 타입
    #[prost(enumeration="super::common::OrderSide", tag="2")]
    pub order_side: i32,
    /// 상품 (예: etfs/A069500)
    #[prost(string, tag="3")]
    pub symbol: ::prost::alloc::string::String,
    /// 주문 가격
    #[prost(string, tag="4")]
    pub price: ::prost::alloc::string::String,
    /// 주문 수량
    #[prost(int64, tag="5")]
    pub quantity: i64,
    /// 체결 수량
    #[prost(int64, tag="6")]
    pub filled_quantity: i64,
    /// 주문 상태
    #[prost(enumeration="OrderStatus", tag="7")]
    pub status: i32,
    /// 주문 시간 (Unix timestamp)
    #[prost(int64, tag="8")]
    pub created_at: i64,
    /// 업데이트 시간 (Unix timestamp)
    #[prost(int64, tag="9")]
    pub updated_at: i64,
    /// 펀드 코드
    #[prost(string, tag="10")]
    pub fund_code: ::prost::alloc::string::String,
}
// ========== Enums ==========

#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum QuoteType {
    Unspecified = 0,
    /// 지정가
    Limit = 1,
    /// 시장가
    Market = 2,
    /// 상대호가
    BestTake = 3,
    /// 자기호가
    BestMake = 4,
}
impl QuoteType {
    /// 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 {
            QuoteType::Unspecified => "QUOTE_TYPE_UNSPECIFIED",
            QuoteType::Limit => "QUOTE_TYPE_LIMIT",
            QuoteType::Market => "QUOTE_TYPE_MARKET",
            QuoteType::BestTake => "QUOTE_TYPE_BEST_TAKE",
            QuoteType::BestMake => "QUOTE_TYPE_BEST_MAKE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "QUOTE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "QUOTE_TYPE_LIMIT" => Some(Self::Limit),
            "QUOTE_TYPE_MARKET" => Some(Self::Market),
            "QUOTE_TYPE_BEST_TAKE" => Some(Self::BestTake),
            "QUOTE_TYPE_BEST_MAKE" => Some(Self::BestMake),
            _ => None,
        }
    }
}
/// 지정가 가격 결정 방식
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LimitPriceType {
    /// 직접 지정한 가격 사용 (price 필드 사용)
    Unspecified = 0,
    /// 상대호가 (매수→매도1호가, 매도→매수1호가)
    BestTake = 1,
    /// 상대호가 +1틱 (더 공격적: 매수는 가격↑, 매도는 가격↓)
    BestTakePlus1 = 2,
    /// 상대호가 +2틱 (더 공격적)
    BestTakePlus2 = 3,
    /// 상대호가 +3틱 (더 공격적)
    BestTakePlus3 = 4,
    /// 자기호가 -1틱 (덜 공격적: 매수는 가격↓, 매도는 가격↑)
    BestMakeMinus1 = 5,
    /// 자기호가 -2틱 (덜 공격적)
    BestMakeMinus2 = 6,
    /// 자기호가 -3틱 (덜 공격적)
    BestMakeMinus3 = 7,
}
impl LimitPriceType {
    /// 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 {
            LimitPriceType::Unspecified => "LIMIT_PRICE_TYPE_UNSPECIFIED",
            LimitPriceType::BestTake => "LIMIT_PRICE_TYPE_BEST_TAKE",
            LimitPriceType::BestTakePlus1 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_1",
            LimitPriceType::BestTakePlus2 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_2",
            LimitPriceType::BestTakePlus3 => "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_3",
            LimitPriceType::BestMakeMinus1 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_1",
            LimitPriceType::BestMakeMinus2 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_2",
            LimitPriceType::BestMakeMinus3 => "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_3",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "LIMIT_PRICE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "LIMIT_PRICE_TYPE_BEST_TAKE" => Some(Self::BestTake),
            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_1" => Some(Self::BestTakePlus1),
            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_2" => Some(Self::BestTakePlus2),
            "LIMIT_PRICE_TYPE_BEST_TAKE_PLUS_3" => Some(Self::BestTakePlus3),
            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_1" => Some(Self::BestMakeMinus1),
            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_2" => Some(Self::BestMakeMinus2),
            "LIMIT_PRICE_TYPE_BEST_MAKE_MINUS_3" => Some(Self::BestMakeMinus3),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderStatus {
    Unspecified = 0,
    /// 주문 제출됨
    Submitted = 1,
    /// 거부됨 (validation 실패)
    Rejected = 2,
}
impl OrderStatus {
    /// 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 {
            OrderStatus::Unspecified => "ORDER_STATUS_UNSPECIFIED",
            OrderStatus::Submitted => "ORDER_STATUS_SUBMITTED",
            OrderStatus::Rejected => "ORDER_STATUS_REJECTED",
        }
    }
    /// 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_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_STATUS_SUBMITTED" => Some(Self::Submitted),
            "ORDER_STATUS_REJECTED" => Some(Self::Rejected),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderResultType {
    Unspecified = 0,
    /// 접수됨
    Received = 1,
    /// 거부됨
    Rejected = 2,
    /// 체결됨
    Filled = 3,
    /// 취소됨
    Cancelled = 4,
}
impl OrderResultType {
    /// 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 {
            OrderResultType::Unspecified => "ORDER_RESULT_TYPE_UNSPECIFIED",
            OrderResultType::Received => "ORDER_RESULT_TYPE_RECEIVED",
            OrderResultType::Rejected => "ORDER_RESULT_TYPE_REJECTED",
            OrderResultType::Filled => "ORDER_RESULT_TYPE_FILLED",
            OrderResultType::Cancelled => "ORDER_RESULT_TYPE_CANCELLED",
        }
    }
    /// 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_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_RESULT_TYPE_RECEIVED" => Some(Self::Received),
            "ORDER_RESULT_TYPE_REJECTED" => Some(Self::Rejected),
            "ORDER_RESULT_TYPE_FILLED" => Some(Self::Filled),
            "ORDER_RESULT_TYPE_CANCELLED" => Some(Self::Cancelled),
            _ => None,
        }
    }
}
include!("kdo.v1.order.tonic.rs");
include!("kdo.v1.order.serde.rs");
// @@protoc_insertion_point(module)