ids_apis/
kdo.v1.order_log.rs

1// @generated
2// This file is @generated by prost-build.
3/// 주문 로그
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct OrderLog {
7    /// 로그 고유 ID (DB에서 자동 생성)
8    #[prost(int64, tag="1")]
9    pub id: i64,
10    /// 주문 ID (거래소에서 받은 ID)
11    #[prost(uint64, tag="2")]
12    pub order_id: u64,
13    /// 원본 주문 ID (수정/취소의 경우)
14    /// Option<u64>는 optional uint64로 매핑
15    #[prost(uint64, optional, tag="3")]
16    pub original_order_id: ::core::option::Option<u64>,
17    /// 펀드 코드
18    #[prost(string, tag="4")]
19    pub fund_code: ::prost::alloc::string::String,
20    /// 심볼
21    #[prost(string, tag="5")]
22    pub symbol: ::prost::alloc::string::String,
23    /// 로그 타입
24    #[prost(enumeration="OrderLogType", tag="6")]
25    pub log_type: i32,
26    /// 주문 방향 (매수/매도)
27    #[prost(enumeration="OrderSide", tag="7")]
28    pub side: i32,
29    /// 주문 타입 (신규/정정/취소)
30    #[prost(enumeration="OrderType", tag="8")]
31    pub order_type: i32,
32    /// 주문 가격 (Price)
33    /// 정확도 유지를 위해 string 또는 고정 소수점(fixed64 등)을 사용할 수 있으나,
34    /// 여기서는 간단하게 string으로 가정
35    #[prost(string, tag="9")]
36    pub price: ::prost::alloc::string::String,
37    /// 주문 수량 (Quantity)
38    /// 정확도 유지를 위해 string 또는 고정 소수점(fixed64 등)을 사용할 수 있으나,
39    /// 여기서는 간단하게 string으로 가정
40    #[prost(string, tag="10")]
41    pub quantity: ::prost::alloc::string::String,
42    /// 체결 가격 (Filled 로그의 경우) (FilledPrice)
43    #[prost(string, optional, tag="11")]
44    pub filled_price: ::core::option::Option<::prost::alloc::string::String>,
45    /// 체결 수량 (Filled 로그의 경우) (FilledQuantity)
46    #[prost(string, optional, tag="12")]
47    pub filled_quantity: ::core::option::Option<::prost::alloc::string::String>,
48    /// 체결 금액 (계산값) (FilledAmount)
49    #[prost(string, optional, tag="13")]
50    pub filled_amount: ::core::option::Option<::prost::alloc::string::String>,
51    /// 거부/취소 코드
52    #[prost(string, optional, tag="14")]
53    pub rejection_code: ::core::option::Option<::prost::alloc::string::String>,
54    /// 에러 메시지 (MeritzRejected의 경우)
55    #[prost(string, optional, tag="15")]
56    pub error_message: ::core::option::Option<::prost::alloc::string::String>,
57    /// 이벤트 발생 시각 (거래소 시각, 마이크로초)
58    /// Rust Timestamp 타입을 u64로 가정
59    #[prost(uint64, tag="16")]
60    pub event_time: u64,
61    /// 이벤트 수신 시각 (시스템 시각, 마이크로초)
62    /// Rust Timestamp 타입을 u64로 가정
63    #[prost(uint64, tag="17")]
64    pub receive_time: u64,
65    /// DB 삽입 시각
66    /// Rust의 DateTime<Utc> 타입을 Google의 Timestamp 메시지로 매핑
67    #[prost(message, optional, tag="18")]
68    pub created_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
69}
70#[allow(clippy::derive_partial_eq_without_eq)]
71#[derive(Clone, Copy, PartialEq, ::prost::Message)]
72pub struct OrderLogFillStatistics {
73    /// 총 체결 건수
74    #[prost(int64, tag="1")]
75    pub total_fills: i64,
76    /// 총 체결 수량
77    #[prost(int64, tag="2")]
78    pub total_quantity: i64,
79    /// 총 체결 금액
80    #[prost(int64, tag="3")]
81    pub total_amount: i64,
82    /// 매수 체결 건수
83    #[prost(int64, tag="4")]
84    pub buy_count: i64,
85    /// 매도 체결 건수
86    #[prost(int64, tag="5")]
87    pub sell_count: i64,
88}
89// ========== Request/Response Messages ==========
90
91/// ListOrderLogs 요청
92#[allow(clippy::derive_partial_eq_without_eq)]
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct ListOrderLogsRequest {
95    /// 페이지 크기 (optional)
96    #[prost(uint32, optional, tag="1")]
97    pub page_size: ::core::option::Option<u32>,
98    /// 페이지 토큰 (optional, for pagination)
99    #[prost(string, optional, tag="2")]
100    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
101    /// Available Sequence and Operator
102    /// * fund_code
103    ///    * `equal`, `contains`
104    /// * symbol
105    ///    * `equal`, `contains`
106    ///
107    /// Examples
108    /// * filter=fund_code="0159"
109    /// * filter=symbol:"7526"
110    #[prost(string, tag="3")]
111    pub filter: ::prost::alloc::string::String,
112}
113/// ListOrderLogs 응답
114#[allow(clippy::derive_partial_eq_without_eq)]
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct ListOrderLogsResponse {
117    /// 펀드 목록
118    #[prost(message, repeated, tag="1")]
119    pub order_logs: ::prost::alloc::vec::Vec<OrderLog>,
120    /// 다음 페이지 토큰
121    #[prost(string, tag="2")]
122    pub next_page_token: ::prost::alloc::string::String,
123}
124#[allow(clippy::derive_partial_eq_without_eq)]
125#[derive(Clone, PartialEq, ::prost::Message)]
126pub struct GetOrderLogStatisticsRequest {
127    /// Available Sequence and Operator
128    /// * fund_code
129    ///    * `equal`, `contains`
130    /// * symbol
131    ///    * `equal`, `contains`
132    ///
133    /// Examples
134    /// * filter=fund_code="0159"
135    /// * filter=symbol:"7526"
136    #[prost(string, tag="1")]
137    pub filter: ::prost::alloc::string::String,
138}
139/// 주문 로그 타입
140///
141/// Rust의 SCREAMING_SNAKE_CASE를 반영하여 정의
142/// 주석은 Rust 코드의 내용을 번역했습니다.
143#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
144#[repr(i32)]
145pub enum OrderLogType {
146    /// 알 수 없는 값 (기본값)
147    Unspecified = 0,
148    /// 접수 확인
149    Received = 1,
150    /// 거래소 거부
151    Rejected = 2,
152    /// 메리츠 내부 거부
153    MeritzRejected = 3,
154    /// 체결
155    Filled = 4,
156    /// 자동 취소
157    AutoCancelled = 5,
158}
159impl OrderLogType {
160    /// String value of the enum field names used in the ProtoBuf definition.
161    ///
162    /// The values are not transformed in any way and thus are considered stable
163    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
164    pub fn as_str_name(&self) -> &'static str {
165        match self {
166            OrderLogType::Unspecified => "ORDER_LOG_TYPE_UNSPECIFIED",
167            OrderLogType::Received => "RECEIVED",
168            OrderLogType::Rejected => "REJECTED",
169            OrderLogType::MeritzRejected => "MERITZ_REJECTED",
170            OrderLogType::Filled => "FILLED",
171            OrderLogType::AutoCancelled => "AUTO_CANCELLED",
172        }
173    }
174    /// Creates an enum from field names used in the ProtoBuf definition.
175    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
176        match value {
177            "ORDER_LOG_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
178            "RECEIVED" => Some(Self::Received),
179            "REJECTED" => Some(Self::Rejected),
180            "MERITZ_REJECTED" => Some(Self::MeritzRejected),
181            "FILLED" => Some(Self::Filled),
182            "AUTO_CANCELLED" => Some(Self::AutoCancelled),
183            _ => None,
184        }
185    }
186}
187/// 주문 방향 (매수/매도)
188/// Rust 코드에는 정의되지 않았지만, OrderLog에 사용되므로 정의 가정
189#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
190#[repr(i32)]
191pub enum OrderSide {
192    Unspecified = 0,
193    /// 매수
194    Buy = 1,
195    /// 매도
196    Sell = 2,
197}
198impl OrderSide {
199    /// String value of the enum field names used in the ProtoBuf definition.
200    ///
201    /// The values are not transformed in any way and thus are considered stable
202    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
203    pub fn as_str_name(&self) -> &'static str {
204        match self {
205            OrderSide::Unspecified => "ORDER_SIDE_UNSPECIFIED",
206            OrderSide::Buy => "BUY",
207            OrderSide::Sell => "SELL",
208        }
209    }
210    /// Creates an enum from field names used in the ProtoBuf definition.
211    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
212        match value {
213            "ORDER_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
214            "BUY" => Some(Self::Buy),
215            "SELL" => Some(Self::Sell),
216            _ => None,
217        }
218    }
219}
220/// 주문 타입 (신규/정정/취소)
221/// Rust 코드에는 정의되지 않았지만, OrderLog에 사용되므로 정의 가정
222#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
223#[repr(i32)]
224pub enum OrderType {
225    Unspecified = 0,
226    /// 신규
227    New = 1,
228    /// 정정
229    Amend = 2,
230    /// 취소
231    Cancel = 3,
232}
233impl OrderType {
234    /// String value of the enum field names used in the ProtoBuf definition.
235    ///
236    /// The values are not transformed in any way and thus are considered stable
237    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
238    pub fn as_str_name(&self) -> &'static str {
239        match self {
240            OrderType::Unspecified => "ORDER_TYPE_UNSPECIFIED",
241            OrderType::New => "NEW",
242            OrderType::Amend => "AMEND",
243            OrderType::Cancel => "CANCEL",
244        }
245    }
246    /// Creates an enum from field names used in the ProtoBuf definition.
247    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
248        match value {
249            "ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
250            "NEW" => Some(Self::New),
251            "AMEND" => Some(Self::Amend),
252            "CANCEL" => Some(Self::Cancel),
253            _ => None,
254        }
255    }
256}
257include!("kdo.v1.order_log.tonic.rs");
258include!("kdo.v1.order_log.serde.rs");
259// @@protoc_insertion_point(module)