feat: harden attachment storage for level 4

This commit is contained in:
EgorAnti
2026-11-11 21:20:45 +03:00
parent e06678b6a9
commit 90a689661b
27 changed files with 650 additions and 14 deletions
@@ -23,7 +23,7 @@ public record CreateMessageRequest(
}
@AssertTrue(message = "attachment_ids must be unique and non-null")
public boolean areAttachmentIdsValid() {
public boolean isAttachmentIdsValid() {
return attachment_ids != null
&& attachment_ids.stream().noneMatch(java.util.Objects::isNull)
&& new HashSet<>(attachment_ids).size() == attachment_ids.size();