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

/// VI Arbitrage 서비스 상태
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ViArbitrageStatus {
    /// 서비스 활성화 여부
    #[prost(bool, tag="1")]
    pub enabled: bool,
    /// Basis 임계값 (bp 단위)
    #[prost(int64, tag="2")]
    pub basis_threshold_bp: i64,
    /// 현재 VI 종목 수
    #[prost(int32, tag="3")]
    pub vi_stock_count: i32,
    /// 금일 트리거 횟수
    #[prost(int32, tag="4")]
    pub trigger_count_today: i32,
    /// 서비스 시작 시간
    #[prost(message, optional, tag="5")]
    pub start_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
// ============================================================================
// VI Stock
// ============================================================================

/// 현재 VI 상태인 종목 정보
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViStock {
    /// 주식 심볼 (예: "A005930")
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// VI 세션 종류 ("vi_static", "vi_dynamic")
    #[prost(string, tag="2")]
    pub vi_session: ::prost::alloc::string::String,
    /// VI 진입 시간
    #[prost(message, optional, tag="3")]
    pub vi_start_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// VI 예체가
    #[prost(int64, tag="4")]
    pub krx_estimated_price: i64,
    /// 대응 주식선물 심볼 (없으면 빈 문자열)
    #[prost(string, tag="5")]
    pub futures_symbol: ::prost::alloc::string::String,
    /// 현재 NXT 가격 (있으면)
    #[prost(int64, optional, tag="6")]
    pub nxt_price: ::core::option::Option<i64>,
    /// 현재 선물 가격 (있으면)
    #[prost(int64, optional, tag="7")]
    pub futures_price: ::core::option::Option<i64>,
    /// 현재 Basis (bp)
    #[prost(int64, optional, tag="8")]
    pub current_basis_bp: ::core::option::Option<i64>,
    /// VI 경과 시간 (ms)
    #[prost(int64, tag="9")]
    pub elapsed_ms: i64,
}
// ============================================================================
// Trigger History
// ============================================================================

/// VI Arbitrage 트리거 이력
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TriggerRecord {
    /// 트리거 ID (auto-increment)
    #[prost(int64, tag="1")]
    pub id: i64,
    /// 주식 심볼
    #[prost(string, tag="2")]
    pub symbol: ::prost::alloc::string::String,
    /// 주식선물 심볼
    #[prost(string, tag="3")]
    pub futures_symbol: ::prost::alloc::string::String,
    /// 트리거 시점 NXT 가격
    #[prost(int64, tag="4")]
    pub nxt_price: i64,
    /// 트리거 시점 선물 가격
    #[prost(int64, tag="5")]
    pub futures_price: i64,
    /// 트리거 시점 Basis (bp)
    #[prost(int64, tag="6")]
    pub basis_bp: i64,
    /// 트리거 방향 (LONG: NXT 매수/선물 매도, SHORT: NXT 매도/선물 매수)
    #[prost(enumeration="TriggerDirection", tag="7")]
    pub direction: i32,
    /// 트리거 시간
    #[prost(message, optional, tag="8")]
    pub trigger_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 트리거 결과 (주문 성공 여부)
    #[prost(enumeration="TriggerResult", tag="9")]
    pub result: i32,
    /// 에러 메시지 (실패 시)
    #[prost(string, tag="10")]
    pub error_message: ::prost::alloc::string::String,
}
// ============================================================================
// Events (Streaming)
// ============================================================================

/// VI 이벤트 (스트리밍용)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViEvent {
    /// 이벤트 발생 시간
    #[prost(message, optional, tag="1")]
    pub event_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 이벤트 타입
    #[prost(oneof="vi_event::Event", tags="2, 3, 4, 5")]
    pub event: ::core::option::Option<vi_event::Event>,
}
/// Nested message and enum types in `ViEvent`.
pub mod vi_event {
    /// 이벤트 타입
    #[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Event {
        /// VI 진입 이벤트
        #[prost(message, tag="2")]
        ViEntered(super::ViEnteredEvent),
        /// VI 해제 이벤트
        #[prost(message, tag="3")]
        ViExited(super::ViExitedEvent),
        /// 트리거 이벤트
        #[prost(message, tag="4")]
        Triggered(super::TriggeredEvent),
        /// Basis 임계값 근접 이벤트 (경고)
        #[prost(message, tag="5")]
        BasisWarning(super::BasisWarningEvent),
    }
}
/// VI 진입 이벤트
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViEnteredEvent {
    /// 주식 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// VI 세션 종류
    #[prost(string, tag="2")]
    pub vi_session: ::prost::alloc::string::String,
    /// VI 진입 전 KRX 가격
    #[prost(int64, tag="3")]
    pub krx_last_price: i64,
    /// 대응 주식선물 심볼
    #[prost(string, tag="4")]
    pub futures_symbol: ::prost::alloc::string::String,
}
/// VI 해제 이벤트
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ViExitedEvent {
    /// 주식 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// VI 지속 시간 (ms)
    #[prost(int64, tag="2")]
    pub duration_ms: i64,
}
/// 트리거 발동 이벤트
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TriggeredEvent {
    /// 트리거 정보
    #[prost(message, optional, tag="1")]
    pub trigger: ::core::option::Option<TriggerRecord>,
}
/// Basis 경고 이벤트 (임계값의 80% 이상일 때)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasisWarningEvent {
    /// 주식 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// 현재 Basis (bp)
    #[prost(int64, tag="2")]
    pub current_basis_bp: i64,
    /// 임계값 (bp)
    #[prost(int64, tag="3")]
    pub threshold_bp: i64,
    /// 임계값 대비 비율 (%)
    #[prost(double, tag="4")]
    pub threshold_ratio: f64,
}
/// Basis 업데이트 (스트리밍용)
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BasisUpdate {
    /// 업데이트 시간
    #[prost(message, optional, tag="1")]
    pub update_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 주식 심볼
    #[prost(string, tag="2")]
    pub symbol: ::prost::alloc::string::String,
    /// NXT 가격
    #[prost(int64, tag="3")]
    pub nxt_price: i64,
    /// 선물 가격
    #[prost(int64, tag="4")]
    pub futures_price: i64,
    /// Basis (bp)
    #[prost(int64, tag="5")]
    pub basis_bp: i64,
    /// 임계값 대비 비율 (%)
    #[prost(double, tag="6")]
    pub threshold_ratio: f64,
}
// ============================================================================
// Request/Response Messages
// ============================================================================

#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetStatusRequest {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListViStocksRequest {
    /// 페이지 크기 (optional, default: 100)
    #[prost(int32, optional, tag="1")]
    pub page_size: ::core::option::Option<i32>,
    /// 페이지 토큰
    #[prost(string, optional, tag="2")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListViStocksResponse {
    /// VI 종목 목록
    #[prost(message, repeated, tag="1")]
    pub vi_stocks: ::prost::alloc::vec::Vec<ViStock>,
    /// 다음 페이지 토큰
    #[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 ListTriggerHistoryRequest {
    /// 페이지 크기 (optional, default: 50)
    #[prost(int32, optional, tag="1")]
    pub page_size: ::core::option::Option<i32>,
    /// 페이지 토큰
    #[prost(string, optional, tag="2")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// 시작 시간 필터 (이후)
    #[prost(message, optional, tag="3")]
    pub start_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 종료 시간 필터 (이전)
    #[prost(message, optional, tag="4")]
    pub end_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 심볼 필터 (특정 종목만)
    #[prost(string, optional, tag="5")]
    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListTriggerHistoryResponse {
    /// 트리거 이력
    #[prost(message, repeated, tag="1")]
    pub triggers: ::prost::alloc::vec::Vec<TriggerRecord>,
    /// 다음 페이지 토큰
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
    /// 총 건수
    #[prost(int32, tag="3")]
    pub total_count: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamViEventsRequest {
    /// 특정 심볼만 구독 (없으면 전체)
    #[prost(string, repeated, tag="1")]
    pub symbols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Basis 경고 이벤트 포함 여부 (기본: true)
    #[prost(bool, optional, tag="2")]
    pub include_basis_warning: ::core::option::Option<bool>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamBasisRequest {
    /// 특정 심볼만 구독 (없으면 현재 VI 종목 전체)
    #[prost(string, repeated, tag="1")]
    pub symbols: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// 업데이트 최소 간격 (ms, 기본: 100)
    #[prost(int32, optional, tag="2")]
    pub min_interval_ms: ::core::option::Option<i32>,
}
/// 트리거 방향
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TriggerDirection {
    Unspecified = 0,
    /// NXT 매수, 선물 매도 (NXT < 선물)
    Long = 1,
    /// NXT 매도, 선물 매수 (NXT > 선물)
    Short = 2,
}
impl TriggerDirection {
    /// 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 {
            TriggerDirection::Unspecified => "TRIGGER_DIRECTION_UNSPECIFIED",
            TriggerDirection::Long => "TRIGGER_DIRECTION_LONG",
            TriggerDirection::Short => "TRIGGER_DIRECTION_SHORT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TRIGGER_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
            "TRIGGER_DIRECTION_LONG" => Some(Self::Long),
            "TRIGGER_DIRECTION_SHORT" => Some(Self::Short),
            _ => None,
        }
    }
}
/// 트리거 결과
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TriggerResult {
    Unspecified = 0,
    /// 주문 성공
    Success = 1,
    /// 주문 실패
    Failed = 2,
    /// 스킵됨 (쿨다운 등)
    Skipped = 3,
}
impl TriggerResult {
    /// 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 {
            TriggerResult::Unspecified => "TRIGGER_RESULT_UNSPECIFIED",
            TriggerResult::Success => "TRIGGER_RESULT_SUCCESS",
            TriggerResult::Failed => "TRIGGER_RESULT_FAILED",
            TriggerResult::Skipped => "TRIGGER_RESULT_SKIPPED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TRIGGER_RESULT_UNSPECIFIED" => Some(Self::Unspecified),
            "TRIGGER_RESULT_SUCCESS" => Some(Self::Success),
            "TRIGGER_RESULT_FAILED" => Some(Self::Failed),
            "TRIGGER_RESULT_SKIPPED" => Some(Self::Skipped),
            _ => None,
        }
    }
}
include!("kdo.v1.vi_arbitrage.tonic.rs");
include!("kdo.v1.vi_arbitrage.serde.rs");
// @@protoc_insertion_point(module)