예제 #1
0
        public async Task RemoveDepositFeesSettings(RemoveDepositFeesRequest request)
        {
            using var action = MyTelemetry.StartActivity("Remove Deposit Fees Settings");
            request.AddToActivityAsJsonTag("request");
            try
            {
                _logger.LogInformation("Remove Deposit Fees Setting: {jsonText}",
                                       JsonConvert.SerializeObject(request));

                var entity = await _writer.DeleteAsync(DepositFeesNoSqlEntity.GeneratePartitionKey(request.BrokerId, request.ProfileId),
                                                       DepositFeesNoSqlEntity.GenerateRowKey(request.AssetId));

                if (entity != null)
                {
                    _logger.LogInformation("Removed Deposit Fees Settings: {jsonText}",
                                           JsonConvert.SerializeObject(entity));
                }
                else
                {
                    _logger.LogInformation("Unable to remove Deposit Fees Setting, do not exist: {jsonText}",
                                           JsonConvert.SerializeObject(request));
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Cannot remove ExternalMarketSettings: {requestJson}",
                                 JsonConvert.SerializeObject(request));
                ex.FailActivity();
                throw;
            }
        }
예제 #2
0
        public DepositFees GetDepositFees(string brokerId, string groupId, string assetId)
        {
            var entity = _depositFeesReader.Get(DepositFeesNoSqlEntity.GeneratePartitionKey(brokerId, groupId),
                                                DepositFeesNoSqlEntity.GenerateRowKey(assetId));

            if (entity == null)
            {
                return(new DepositFees {
                    FeeType = FeeType.NoFee
                });
            }

            return(entity?.DepositFees);
        }