// @generated
// This file is @generated by prost-build.
/// Track Record
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrackRecord {
    /// 고유 ID
    #[prost(int64, tag="1")]
    pub id: i64,
    /// Quote 주문 ID
    #[prost(uint64, tag="2")]
    pub quote_order_id: u64,
    /// Quote 심볼
    #[prost(string, tag="3")]
    pub quote_symbol: ::prost::alloc::string::String,
    /// Quote 방향 (매수/매도)
    #[prost(enumeration="super::common::OrderSide", tag="4")]
    pub quote_side: i32,
    /// Quote 체결 가격
    #[prost(double, tag="5")]
    pub quote_filled_price: f64,
    /// Quote 체결 수량
    #[prost(int64, tag="6")]
    pub quote_filled_quantity: i64,
    /// Quote 체결 금액
    #[prost(double, tag="7")]
    pub quote_filled_amount: f64,
    /// Hedge 건수
    #[prost(int32, tag="8")]
    pub hedge_count: i32,
    /// Hedge 심볼
    #[prost(string, optional, tag="9")]
    pub hedge_symbol: ::core::option::Option<::prost::alloc::string::String>,
    /// Hedge 체결 평균 가격 (선물 원시 가격)
    #[prost(double, optional, tag="10")]
    pub hedge_filled_price: ::core::option::Option<f64>,
    /// Hedge 체결 수량 (선물 계약 수)
    #[prost(int64, tag="11")]
    pub hedge_filled_quantity: i64,
    /// Hedge 체결 금액 (선물 기준)
    #[prost(double, tag="12")]
    pub hedge_filled_amount: f64,
    /// 기대 헷지 가격 (QuoteContext에서 추출, 선물 환산)
    #[prost(double, optional, tag="13")]
    pub expected_hedge_price: ::core::option::Option<f64>,
    /// Quote 가격의 선물 환산가
    #[prost(double, optional, tag="24")]
    pub quote_price_as_hedge: ::core::option::Option<f64>,
    /// ETF→선물 감도 계수 (P&L 계산에 사용된 값, per-share 기준)
    /// sensitivity = hedge_conversion_ratio × futures_multiple / creation_unit
    #[prost(double, optional, tag="25")]
    pub sensitivity: ::core::option::Option<f64>,
    /// Hedge 경제적 가치 (선물승수 적용, KRW)
    /// hedge_filled_price × hedge_filled_quantity × futures_multiplier
    #[prost(double, optional, tag="26")]
    pub hedge_notional_amount: ::core::option::Option<f64>,
    /// 손익 금액
    #[prost(double, tag="14")]
    pub pnl_amount: f64,
    /// 손익 (bp)
    #[prost(double, tag="15")]
    pub pnl_bp: f64,
    /// 슬리피지 (bp)
    #[prost(double, optional, tag="16")]
    pub slippage_bp: ::core::option::Option<f64>,
    /// 펀드 코드
    #[prost(string, tag="17")]
    pub fund_code: ::prost::alloc::string::String,
    /// 날짜 (YYYYMMDD)
    #[prost(uint32, tag="18")]
    pub date: u32,
    /// 시장 구분
    #[prost(enumeration="super::common::MarketType", tag="19")]
    pub market_type: i32,
    /// Quote 거래소 시각 (마이크로초)
    #[prost(uint64, tag="20")]
    pub quote_exchange_time: u64,
    /// 마지막 Hedge 시각 (마이크로초)
    #[prost(uint64, optional, tag="21")]
    pub last_hedge_time: ::core::option::Option<u64>,
    /// 생성 시각
    #[prost(message, optional, tag="22")]
    pub created_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 수정 시각
    #[prost(message, optional, tag="23")]
    pub updated_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
/// Track Record 요약 통계
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TrackRecordSummary {
    /// 총 건수
    #[prost(int64, tag="1")]
    pub total_count: i64,
    /// 총 손익 금액
    #[prost(double, tag="2")]
    pub total_pnl_amount: f64,
    /// 평균 손익 (bp)
    #[prost(double, tag="3")]
    pub avg_pnl_bp: f64,
    /// 최대 손익 (bp)
    #[prost(double, tag="4")]
    pub max_pnl_bp: f64,
    /// 최소 손익 (bp)
    #[prost(double, tag="5")]
    pub min_pnl_bp: f64,
    /// 수익 건수
    #[prost(int64, tag="6")]
    pub win_count: i64,
    /// 손실 건수
    #[prost(int64, tag="7")]
    pub loss_count: i64,
    /// 평균 슬리피지 (bp)
    #[prost(double, optional, tag="8")]
    pub avg_slippage_bp: ::core::option::Option<f64>,
    /// 총 Quote 체결 금액
    #[prost(double, tag="9")]
    pub total_quote_amount: f64,
    /// 총 Hedge 체결 금액
    #[prost(double, tag="10")]
    pub total_hedge_amount: f64,
    /// 총 Hedge 경제적 가치 (선물승수 적용, KRW)
    #[prost(double, tag="11")]
    pub total_hedge_notional_amount: f64,
}
// ========== Request/Response Messages ==========

/// ListTrackRecords 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTrackRecordsRequest {
    /// 페이지 크기 (optional)
    #[prost(uint32, optional, tag="1")]
    pub page_size: ::core::option::Option<u32>,
    /// 페이지 토큰 (optional, for pagination)
    #[prost(string, optional, tag="2")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// Available Sequence and Operator
    /// * fund_code
    ///    * `equal`
    /// * quote_symbol
    ///    * `equal`, `contains`
    /// * quote_side
    ///    * `equal`
    /// * market_type
    ///    * `equal`
    /// * date
    ///    * `equal`, `greater_equal`, `less_equal`
    ///
    /// Examples
    /// * filter=fund_code="0159"
    /// * filter=quote_symbol:"7526"
    /// * filter=quote_side=ASK
    /// * filter=market_type=KOSPI
    /// * filter=date>=20260101 AND date<=20260131
    #[prost(string, tag="3")]
    pub filter: ::prost::alloc::string::String,
    /// 오더링 조건. (optional, AIP-132)
    ///
    /// Supported Fields
    /// * "date", "quote_exchange_time", "pnl_amount", "pnl_bp", "created_at", "quote_order_id"
    ///
    /// Examples
    /// * order_by=quote_exchange_time desc
    #[prost(string, tag="4")]
    pub order_by: ::prost::alloc::string::String,
}
/// ListTrackRecords 응답
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTrackRecordsResponse {
    /// Track Record 목록
    #[prost(message, repeated, tag="1")]
    pub track_records: ::prost::alloc::vec::Vec<TrackRecord>,
    /// 다음 페이지 토큰
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// GetTrackRecordSummary 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTrackRecordSummaryRequest {
    /// Available Sequence and Operator
    /// * fund_code
    ///    * `equal`
    /// * quote_symbol
    ///    * `equal`, `contains`
    /// * date
    ///    * `equal`, `greater_equal`, `less_equal`
    ///
    /// Examples
    /// * filter=fund_code="0159"
    /// * filter=date>=20260101 AND date<=20260131
    #[prost(string, tag="1")]
    pub filter: ::prost::alloc::string::String,
}
/// RebuildTrackRecords 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RebuildTrackRecordsRequest {
    /// 시작 날짜 (YYYYMMDD)
    #[prost(uint32, tag="1")]
    pub date_from: u32,
    /// 종료 날짜 (YYYYMMDD)
    #[prost(uint32, tag="2")]
    pub date_to: u32,
}
/// RebuildTrackRecords 응답
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RebuildTrackRecordsResponse {
    /// 처리된 Quote 건수
    #[prost(int64, tag="1")]
    pub total_quotes: i64,
    /// 매칭된 건수 (Hedge가 있는)
    #[prost(int64, tag="2")]
    pub matched_count: i64,
    /// 매칭되지 않은 건수
    #[prost(int64, tag="3")]
    pub unmatched_count: i64,
    /// upsert된 Track Record 건수
    #[prost(int64, tag="4")]
    pub upserted_count: i64,
}
include!("kdo.v1.track_record.tonic.rs");
include!("kdo.v1.track_record.serde.rs");
// @@protoc_insertion_point(module)