public async Task <KycStatus> GetKycStatusAsync(string clientId) { var rowKey = KycEntity.GenerateRowKey(clientId); var entity = (await _tableStorage.GetDataRowKeyOnlyAsync(rowKey)).FirstOrDefault(); return(entity?.GetSatus() ?? KycEntity.DefaultStatus); }
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); }
public async Task <IEnumerable <string> > GetClientsByStatus(KycStatus kycStatus) { var partitionKey = KycEntity.GeneratePartitionKey(kycStatus); return((await _tableStorage.GetDataAsync(partitionKey)).Select(itm => itm.GetClientId())); }