예제 #1
0
        public async Task <KycStatus> GetKycStatusAsync(string clientId)
        {
            var rowKey = KycEntity.GenerateRowKey(clientId);
            var entity = (await _tableStorage.GetDataRowKeyOnlyAsync(rowKey)).FirstOrDefault();

            return(entity?.GetSatus() ?? KycEntity.DefaultStatus);
        }
예제 #2
0
        public async Task SetStatusAsync(string clientId, KycStatus status)
        {
            var rowKey = KycEntity.GenerateRowKey(clientId);
            var entity = (await _tableStorage.GetDataRowKeyOnlyAsync(rowKey)).FirstOrDefault();

            if (entity != null)
            {
                await _tableStorage.DeleteAsync(entity);
            }

            if (status == KycEntity.DefaultStatus)
            {
                return;
            }

            entity = KycEntity.Create(clientId, status);
            await _tableStorage.InsertOrReplaceAsync(entity);
        }
예제 #3
0
        public async Task <IEnumerable <string> > GetClientsByStatus(KycStatus kycStatus)
        {
            var partitionKey = KycEntity.GeneratePartitionKey(kycStatus);

            return((await _tableStorage.GetDataAsync(partitionKey)).Select(itm => itm.GetClientId()));
        }