From 79f20d77d335b81ee426db92ca251e4da326fec3 Mon Sep 17 00:00:00 2001 From: amentis Date: Wed, 19 Jun 2024 16:53:12 +0300 Subject: [PATCH] no message --- .../src/main/java/org/opencdmp/model/persist/DmpPersist.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/core/src/main/java/org/opencdmp/model/persist/DmpPersist.java b/backend/core/src/main/java/org/opencdmp/model/persist/DmpPersist.java index df4c431c4..25d017c57 100644 --- a/backend/core/src/main/java/org/opencdmp/model/persist/DmpPersist.java +++ b/backend/core/src/main/java/org/opencdmp/model/persist/DmpPersist.java @@ -224,6 +224,10 @@ public class DmpPersist { .iff(() -> !this.isEmpty(item.getLabel())) .must(() -> this.lessEqualLength(item.getLabel(), DmpEntity._labelLength)) .failOn(DmpPersist._label).failWith(this.messageSource.getMessage("Validation_MaxLength", new Object[]{DmpPersist._label}, LocaleContextHolder.getLocale())), + this.spec() + .iff(() -> item.getStatus() == DmpStatus.Finalized) + .must(() -> !this.isEmpty(item.getDescription())) + .failOn(DmpPersist._description).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{DmpPersist._description}, LocaleContextHolder.getLocale())), this.spec() .must(() -> !this.isNull(item.getStatus())) .failOn(DmpPersist._status).failWith(this.messageSource.getMessage("Validation_Required", new Object[]{DmpPersist._status}, LocaleContextHolder.getLocale())),