public async Task <List <ReleaseChecklistIssue> > GetErrors(Release release) { var errors = new List <ReleaseChecklistIssue>(); if (await _dataImportService.HasIncompleteImports(release.Id)) { errors.Add(new ReleaseChecklistIssue(ValidationErrorMessages.DataFileImportsMustBeCompleted)); } var replacementDataFiles = await _fileRepository.ListReplacementDataFiles(release.Id); if (replacementDataFiles.Any()) { errors.Add(new ReleaseChecklistIssue(ValidationErrorMessages.DataFileReplacementsMustBeCompleted)); } var isDataGuidanceValid = await _dataGuidanceService.Validate(release.Id); if (isDataGuidanceValid.IsLeft) { errors.Add(new ReleaseChecklistIssue(ValidationErrorMessages.PublicDataGuidanceRequired)); } if (release.Amendment && !release.Updates.Any(update => update.Created > release.Created)) { errors.Add(new ReleaseChecklistIssue(ValidationErrorMessages.ReleaseNoteRequired)); } if (await ReleaseHasEmptyGenericContentSection(release.Id)) { errors.Add(new ReleaseChecklistIssue(ValidationErrorMessages.EmptyContentSectionExists)); } if (await ReleaseGenericContentSectionsContainEmptyContentBlock(release.Id)) { errors.Add(new ReleaseChecklistIssue(ValidationErrorMessages.GenericSectionsContainEmptyHtmlBlock)); } return(errors); }