Skip to content

Commit

Permalink
Exclude failed from ReadyForPublish consideration (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceredron authored Mar 11, 2025
1 parent 88d37f2 commit e73f646
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public async Task<List<Guid>> GetNonPublishedCorrespondencesByAttachmentId(Guid
var correspondences = await _context.Correspondences
.Where(correspondence =>
correspondence.Content!.Attachments.Any(attachment => attachment.AttachmentId == attachmentId) // Correspondence has the given attachment
&& !correspondence.Statuses.Any(status => status.Status == CorrespondenceStatus.Published || status.Status == CorrespondenceStatus.ReadyForPublish) // Correspondence is not published
&& !correspondence.Statuses.Any(status => status.Status == CorrespondenceStatus.Published || status.Status == CorrespondenceStatus.ReadyForPublish // Correspondence is not published
|| status.Status == CorrespondenceStatus.Failed)
&& correspondence.Content.Attachments.All(correspondenceAttachment => // All attachments of correspondence are published
correspondenceAttachment.Attachment.Statuses.Any(statusEntity => statusEntity.Status == AttachmentStatus.Published) // All attachments must be published
&& !correspondenceAttachment.Attachment.Statuses.Any(statusEntity => statusEntity.Status == AttachmentStatus.Purged))) // No attachments can be purged
Expand Down

0 comments on commit e73f646

Please # to comment.