public async Task <GetAllDocumentsResponse> Execute(string limit, string cursor) { var parsedLimit = Convert.ToInt32(limit); var documentResponse = await _localDatabaseGateway.GetAllRecords(parsedLimit, cursor); var documentResponses = documentResponse.Select(record => new DocumentResponse { Id = record.Id, DocNo = record.CominoDocumentNumber, Sender = record.DocumentCreator, Created = record.Id, Status = record.Status.PrettierStatusName(), LetterType = record.LetterType, DocumentType = record.DocumentType, Logs = record.Log?.Select(x => new Dictionary <string, string> { { "date", x.Key }, { "message", x.Value } }).ToList() }).ToList(); return(new GetAllDocumentsResponse { Documents = documentResponses }); }