public async Task <IEnumerable <IAuditLogData> > GetKycRecordsAsync(string clientId) { var records = new List <AuditLogDataEntity>(); var kycDocumentChangesTask = _tableStorage.GetDataAsync(AuditLogDataEntity.GeneratePartitionKey(clientId, AuditRecordType.KycDocument)); var kycStatusChangesTask = _tableStorage.GetDataAsync(AuditLogDataEntity.GeneratePartitionKey(clientId, AuditRecordType.KycStatus)); var kycPersonalDataTask = _tableStorage.GetDataAsync(AuditLogDataEntity.GeneratePartitionKey(clientId, AuditRecordType.PersonalData)); var otherEventRecordsTask = _tableStorage.GetDataAsync(AuditLogDataEntity.GeneratePartitionKey(clientId, AuditRecordType.OtherEvent)); records.AddRange(await kycDocumentChangesTask); records.AddRange(await kycStatusChangesTask); records.AddRange(await kycPersonalDataTask); records.AddRange(await otherEventRecordsTask); return(records.OrderByDescending(x => x.CreatedTime)); }
public async Task InsertRecord(string clientId, IAuditLogData record) { var entity = AuditLogDataEntity.Create(clientId, record); await _tableStorage.InsertAsync(entity); }