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    /// * log_type
107    ///    * `equal`
108    /// * side
109    ///    * `equal`
110    /// * order_type
111    ///    * `equal`
112    ///
113    /// Examples
114    /// * filter=fund_code="0159"
115    /// * filter=symbol:"7526"
116    /// * filter=log_type=FILLED
117    /// * filter=side=BUY
118    /// * filter=order_type=AMEND
119    #[prost(string, tag="3")]
120    pub filter: ::prost::alloc::string::String,
121}
122/// ListOrderLogs 응답
123#[allow(clippy::derive_partial_eq_without_eq)]
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct ListOrderLogsResponse {
126    /// 펀드 목록
127    #[prost(message, repeated, tag="1")]
128    pub order_logs: ::prost::alloc::vec::Vec<OrderLog>,
129    /// 다음 페이지 토큰
130    #[prost(string, tag="2")]
131    pub next_page_token: ::prost::alloc::string::String,
132}
133#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct GetOrderLogStatisticsRequest {
136    /// Available Sequence and Operator
137    /// * fund_code
138    ///    * `equal`, `contains`
139    /// * symbol
140    ///    * `equal`, `contains`
141    ///
142    /// Examples
143    /// * filter=fund_code="0159"
144    /// * filter=symbol:"7526"
145    #[prost(string, tag="1")]
146    pub filter: ::prost::alloc::string::String,
147}
148/// 주문 로그 타입
149///
150/// Rust의 SCREAMING_SNAKE_CASE를 반영하여 정의
151/// 주석은 Rust 코드의 내용을 번역했습니다.
152#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
153#[repr(i32)]
154pub enum OrderLogType {
155    /// 알 수 없는 값 (기본값)
156    Unspecified = 0,
157    /// 접수 확인
158    Received = 1,
159    /// 거래소 거부
160    Rejected = 2,
161    /// 메리츠 내부 거부
162    MeritzRejected = 3,
163    /// 체결
164    Filled = 4,
165    /// 자동 취소
166    AutoCancelled = 5,
167}
168impl OrderLogType {
169    /// String value of the enum field names used in the ProtoBuf definition.
170    ///
171    /// The values are not transformed in any way and thus are considered stable
172    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
173    pub fn as_str_name(&self) -> &'static str {
174        match self {
175            OrderLogType::Unspecified => "ORDER_LOG_TYPE_UNSPECIFIED",
176            OrderLogType::Received => "RECEIVED",
177            OrderLogType::Rejected => "REJECTED",
178            OrderLogType::MeritzRejected => "MERITZ_REJECTED",
179            OrderLogType::Filled => "FILLED",
180            OrderLogType::AutoCancelled => "AUTO_CANCELLED",
181        }
182    }
183    /// Creates an enum from field names used in the ProtoBuf definition.
184    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
185        match value {
186            "ORDER_LOG_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
187            "RECEIVED" => Some(Self::Received),
188            "REJECTED" => Some(Self::Rejected),
189            "MERITZ_REJECTED" => Some(Self::MeritzRejected),
190            "FILLED" => Some(Self::Filled),
191            "AUTO_CANCELLED" => Some(Self::AutoCancelled),
192            _ => None,
193        }
194    }
195}
196/// 주문 방향 (매수/매도)
197/// Rust 코드에는 정의되지 않았지만, OrderLog에 사용되므로 정의 가정
198#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
199#[repr(i32)]
200pub enum OrderSide {
201    Unspecified = 0,
202    /// 매수
203    Buy = 1,
204    /// 매도
205    Sell = 2,
206}
207impl OrderSide {
208    /// String value of the enum field names used in the ProtoBuf definition.
209    ///
210    /// The values are not transformed in any way and thus are considered stable
211    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
212    pub fn as_str_name(&self) -> &'static str {
213        match self {
214            OrderSide::Unspecified => "ORDER_SIDE_UNSPECIFIED",
215            OrderSide::Buy => "BUY",
216            OrderSide::Sell => "SELL",
217        }
218    }
219    /// Creates an enum from field names used in the ProtoBuf definition.
220    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
221        match value {
222            "ORDER_SIDE_UNSPECIFIED" => Some(Self::Unspecified),
223            "BUY" => Some(Self::Buy),
224            "SELL" => Some(Self::Sell),
225            _ => None,
226        }
227    }
228}
229/// 주문 타입 (신규/정정/취소)
230/// Rust 코드에는 정의되지 않았지만, OrderLog에 사용되므로 정의 가정
231#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
232#[repr(i32)]
233pub enum OrderType {
234    Unspecified = 0,
235    /// 신규
236    New = 1,
237    /// 정정
238    Amend = 2,
239    /// 취소
240    Cancel = 3,
241}
242impl OrderType {
243    /// String value of the enum field names used in the ProtoBuf definition.
244    ///
245    /// The values are not transformed in any way and thus are considered stable
246    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
247    pub fn as_str_name(&self) -> &'static str {
248        match self {
249            OrderType::Unspecified => "ORDER_TYPE_UNSPECIFIED",
250            OrderType::New => "NEW",
251            OrderType::Amend => "AMEND",
252            OrderType::Cancel => "CANCEL",
253        }
254    }
255    /// Creates an enum from field names used in the ProtoBuf definition.
256    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
257        match value {
258            "ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
259            "NEW" => Some(Self::New),
260            "AMEND" => Some(Self::Amend),
261            "CANCEL" => Some(Self::Cancel),
262            _ => None,
263        }
264    }
265}
266include!("kdo.v1.order_log.tonic.rs");
267include!("kdo.v1.order_log.serde.rs");
268// @@protoc_insertion_point(module)