public async Task RegisterEventAsync(IRawLogEvent evnt, string clientId = null)
        {
            var newEntity = RawLogEventEntity.Create(evnt);
            await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, evnt.DateTime);

            if (!string.IsNullOrWhiteSpace(clientId))
            {
                var byCLient = RawLogEventEntity.CreateByClient(evnt, clientId);
                await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(byCLient, evnt.DateTime);
            }
        }
예제 #2
0
 public async Task AddAsync(IAccountBalanceChange change)
 {
     var entity = _convertService.Convert <AccountBalanceChangeEntity>(change);
     // ReSharper disable once RedundantArgumentDefaultValue
     await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, entity.ChangeTimestamp,
                                                                RowKeyDateTimeFormat.Iso);
 }
        public Task AddAsync(IOrderHistory order)
        {
            var entity = MarginTradingOrderHistoryEntity.Create(order);

            // ReSharper disable once RedundantArgumentDefaultValue
            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, entity.CloseDate ?? entity.OpenDate ?? entity.CreateDate, RowKeyDateTimeFormat.Iso));
        }
예제 #4
0
        public Task AddAsync(string withdrawalId, string message, string techData)
        {
            var now = DateTime.UtcNow;

            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(
                       WithdrawalLogEntity.Create(withdrawalId, message, techData, now), now));
        }
        public async Task <IGlobalCheckInfo> AddOrUpdateAsync(IGlobalCheckInfo entity)
        {
            var newEntity = GlobalCheckInfoEntity.Create(entity);
            await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, newEntity.StartDateTime);

            return(newEntity);
        }
예제 #6
0
        public async Task AddAsync(IMarginTradingAccountHistory accountHistory)
        {
            var entity = MarginTradingAccountHistoryEntity.Create(accountHistory);

            entity.EntityVersion = 2;
            // ReSharper disable once RedundantArgumentDefaultValue
            await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, entity.Date, RowKeyDateTimeFormat.Iso);
        }
예제 #7
0
        public Task AddAsync(IOrderHistory order, ITrade trade)
        {
            var entity = OrderHistoryEntity.Create(order);

            // ReSharper disable once RedundantArgumentDefaultValue
            //TODO: use event datetime
            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity,
                                                                        DateTime.UtcNow, RowKeyDateTimeFormat.Iso));
        }
        private async Task <CashOutBaseEntity> ChangeStatus(string clientId, string requestId, CashOutRequestStatus status)
        {
            var entity = await _tableStorage.DeleteAsync(clientId, requestId);

            entity.PartitionKey = "Processed";
            entity.Status       = status;

            return(await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, entity.DateTime));
        }
        private async Task <ICashOutRequest> ChangeStatus(string clientId, string requestId, CashOutRequestStatus status)
        {
            var entity = await _tableStorage.DeleteAsync(CashOutAttemptEntity.PendingRecords.GeneratePartition(clientId),
                                                         CashOutAttemptEntity.PendingRecords.GenerateRowKey(requestId));

            entity.PartitionKey = CashOutAttemptEntity.HistoryRecords.GeneratePartition();
            entity.Status       = status;

            return(await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, entity.DateTime));
        }
        public async Task <ITransferEvent> RegisterAsync(ITransferEvent src)
        {
            var newEntity = TransferEventEntity.ByClientId.Create(src);
            var inserted  = await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, newEntity.DateTime,
                                                                                       RowKeyDateTimeFormat.Short);

            var byMultisigEntity = TransferEventEntity.ByMultisig.Create(src, inserted.RowKey);
            await _tableStorage.InsertAsync(byMultisigEntity);

            return(newEntity);
        }
예제 #11
0
        public async Task InsertAsync(IPaymentTransaction paymentTransaction)
        {
            var commonEntity = Mapper.Map <PaymentTransactionEntity>(paymentTransaction);

            commonEntity.PartitionKey = PaymentTransactionEntity.GeneratePartitionKey();
            await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(commonEntity, paymentTransaction.Created);

            var entityByClient = Mapper.Map <PaymentTransactionEntity>(paymentTransaction);

            entityByClient.PartitionKey = PaymentTransactionEntity.GeneratePartitionKey(paymentTransaction.ClientId);
            entityByClient.RowKey       = PaymentTransactionEntity.GenerateRowKey(paymentTransaction.Id);

            var index = AzureMultiIndex.Create(IndexPartitionKey, paymentTransaction.Id, commonEntity, entityByClient);

            await Task.WhenAll(
                _tableStorage.InsertAsync(entityByClient),
                _tableStorageIndices.InsertAsync(index)
                );
        }
예제 #12
0
        public async Task CreateAsync(IPaymentTransaction src)
        {
            var commonEntity = PaymentTransactionEntity.Create(src);

            commonEntity.PartitionKey = PaymentTransactionEntity.IndexCommon.GeneratePartitionKey();
            await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(commonEntity, src.Created);

            var entityByClient = PaymentTransactionEntity.Create(src);

            entityByClient.PartitionKey = PaymentTransactionEntity.IndexByClient.GeneratePartitionKey(src.ClientId);
            entityByClient.RowKey       = PaymentTransactionEntity.IndexByClient.GenerateRowKey(src.Id);


            var index = AzureMultiIndex.Create(IndexPartitinKey, src.Id, commonEntity, entityByClient);


            await Task.WhenAll(
                _tableStorage.InsertAsync(entityByClient),
                _tableStorageIndices.InsertAsync(index)
                );
        }
예제 #13
0
        public Task WriteAsync(string clientId, string url, string request, string response, string userAgent)
        {
            var newEntity = RequestsLogRecord.Create(clientId, url, request, response, userAgent);

            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, newEntity.DateTime));
        }
예제 #14
0
        public Task AddRecordAsync(IAuthorizationLogRecord record)
        {
            var newEntity = AuthorizationLogRecordEntity.Create(record);

            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, record.DateTime));
        }
예제 #15
0
        public Task WriteAsync(string userId, string dataId)
        {
            var newEntity = ClientLogItem.Create(userId, dataId);

            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, DateTime.UtcNow));
        }
예제 #16
0
		public async Task AddAsync(IOvernightSwapHistory obj)
		{
			var entity = OvernightSwapHistoryEntity.Create(obj);
			await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, entity.Time);
		}
예제 #17
0
 public Task InsertAsync(OrderbookBestPricesHistoryEntity entity, DateTime time)
 {
     return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, time));
 }
 public async Task InsertHistoryRecord(IWalletCredentials oldWalletCredentials)
 {
     var entity = WalletCredentialsHistoryRecord.Create(oldWalletCredentials);
     await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, DateTime.UtcNow);
 }
예제 #19
0
 public async Task InsertAsync(IPaymentTransactionEventLog newEvent)
 {
     var newEntity = Mapper.Map <PaymentTransactionEventLogEntity>(newEvent);
     await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, newEntity.DateTime);
 }
예제 #20
0
 public async Task RegisterIgnoredAsync(DateTime dateTime, ILkk2YOrder order)
 {
     var newEntity = Lkk2YOrderEntity.CreateIgnored(order);
     await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, dateTime);
 }
예제 #21
0
        public Task AddAsync(IKycUploadsLogItem itm)
        {
            var newEntity = KycUploadsLogItemEntity.Create(itm);

            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, newEntity.DateTime));
        }
예제 #22
0
        public async Task <IRegistrationLogEvent> RegisterEventAsync(IRegistrationLogEvent evnt)
        {
            var newEntity = RegistrationLogEventEntity.Create(evnt);

            return(await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, evnt.DateTime));
        }
예제 #23
0
        public Task WriteEvent(string clientId, Event eventType, string data)
        {
            var entity = EthClientEventRecord.Create(clientId, eventType, data);

            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, DateTime.UtcNow));
        }
 public async Task WriteAsync(IPaymentTransactionLogEvent newEvent)
 {
     var newEntity = PaymentTransactionLogEventEntity.Create(newEvent);
     await _tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, newEntity.DateTime);
 }
예제 #25
0
 public async Task InsertAsync(ILogItem olapEntity)
 {
     await _storage.InsertAndGenerateRowKeyAsDateTimeAsync(LogEntity.CreateEntity(olapEntity), DateTime.UtcNow);
 }
        public Task InsertRecordAsync(string method, string clientId)
        {
            var entity = ApiCallHistoryRecord.Create(method, clientId);

            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(entity, entity.DateTime));
        }
        public Task CreateAsync(IMarginTradingPaymentLog record)
        {
            var newEntity = MarginTradingPaymentLogEntity.Create(record);

            return(_tableStorage.InsertAndGenerateRowKeyAsDateTimeAsync(newEntity, newEntity.DateTime));
        }