コード例 #1
0
        private async Task UpdateKycProfileSettings(string clientId)
        {
            var documents = (await _kycDocumentsRepository.GetOneEachTypeLatestAsync(clientId)).ToArray();

            var settings = await _clientSettingsRepository.GetSettings <KycProfileSettings>(clientId);

            settings.ShowIdCard           = !documents.HasType(KycDocumentTypes.IdCard);
            settings.ShowIdProofOfAddress = !documents.HasType(KycDocumentTypes.ProofOfAddress);
            settings.ShowSelfie           = !documents.HasType(KycDocumentTypes.Selfie);

            await _clientSettingsRepository.SetSettings(clientId, settings);
        }
コード例 #2
0
        public async Task <ActionResult> Get(GetOrdersModel data)
        {
            var traderId = this.GetTraderId();


            var orderSettings = new OrdersRequestSettings
            {
                ActiveChecked   = data.Active != null,
                DoneChecked     = data.Done != null,
                CanceledChecked = data.Canceled != null,
            };
            await _clientSettingsRepository.SetSettings(traderId, orderSettings);

            var orders = await _ordersRepository.GetOrdersByTraderAsync(traderId, o =>
                                                                        (data.Active != null && o.Status == OrderStatus.Registered) |
                                                                        (data.Canceled != null && o.Status == OrderStatus.Canceled) |
                                                                        (data.Done != null && o.Status == OrderStatus.Done));

            var viewModel = new GetOrdersViewModel
            {
                AssetPairs = _assetPairsDictionary.GetAll().ToDictionary(itm => itm.Id),
                Orders     = orders.ToArray()
            };

            return(View(viewModel));
        }
コード例 #3
0
        public async Task AddTrustedApplication(string clientId, string applicatinoId)
        {
            var userTrustedApplications = await _clientSettingsRepository.GetSettings <ApplicationsSettings>(clientId);

            var isTrustedApplication = userTrustedApplications.TrustedApplicationIds.Contains(applicatinoId);

            if (!isTrustedApplication)
            {
                var userTrustedApplicationsList = userTrustedApplications.TrustedApplicationIds.ToList();
                userTrustedApplicationsList.Add(applicatinoId);

                userTrustedApplications.TrustedApplicationIds = userTrustedApplicationsList.ToArray();

                await _clientSettingsRepository.SetSettings(clientId, userTrustedApplications);
            }
        }