示例#1
0
        public async Task ChangeAsync(string orderId, [FromBody] OrderChangeRequest request)
        {
            if (!_ordersCache.TryGetOrderById(orderId, out var order))
            {
                throw new InvalidOperationException("Order not found");
            }

            ValidationHelper.ValidateAccountId(order, request.AccountId);


            var originator = GetOriginator(request.Originator);

            await _tradingEngine.ChangeOrderAsync(order.Id, request.Price, originator,
                                                  request.AdditionalInfo, request.ForceOpen);

            _operationsLogService.AddLog("action order.changeLimits", order.AccountId,
                                         new { orderId = orderId, request = request.ToJson() }.ToJson(), "");
        }