From 9f42381992bf1496deda5959ea0b2a19d9a023e4 Mon Sep 17 00:00:00 2001 From: amentis Date: Thu, 22 Feb 2024 14:03:27 +0200 Subject: [PATCH] delete old DmpUserInviteType --- .../persist/DmpUserInviteTypePersist.java | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 dmp-backend/core/src/main/java/eu/eudat/model/persist/DmpUserInviteTypePersist.java diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/persist/DmpUserInviteTypePersist.java b/dmp-backend/core/src/main/java/eu/eudat/model/persist/DmpUserInviteTypePersist.java deleted file mode 100644 index 016a67db2..000000000 --- a/dmp-backend/core/src/main/java/eu/eudat/model/persist/DmpUserInviteTypePersist.java +++ /dev/null @@ -1,77 +0,0 @@ -package eu.eudat.model.persist; - -import eu.eudat.commons.validation.BaseValidator; -import gr.cite.tools.validation.specification.Specification; -import eu.eudat.convention.ConventionService; -import eu.eudat.errorcode.ErrorThesaurusProperties; -import org.springframework.beans.factory.config.ConfigurableBeanFactory; -import org.springframework.context.MessageSource; -import org.springframework.context.annotation.Scope; -import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.stereotype.Component; - -import java.util.Arrays; -import java.util.List; -import java.util.UUID; - -public class DmpUserInviteTypePersist { - - private UUID userId; - - public static final String _userId = "userId"; - - private String email; - - public static final String _email = "email"; - - public UUID getUserId() { - return userId; - } - - public void setUserId(UUID userId) { - this.userId = userId; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - @Component(DmpUserInviteTypePersistValidator.ValidatorName) - @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) - public static class DmpUserInviteTypePersistValidator extends BaseValidator { - - public static final String ValidatorName = "DmpUserInviteTypePersistValidator"; - - private final MessageSource messageSource; - - protected DmpUserInviteTypePersistValidator(ConventionService conventionService, ErrorThesaurusProperties errors, MessageSource messageSource) { - super(conventionService, errors); - this.messageSource = messageSource; - } - - @Override - protected Class modelClass() { - return DmpUserInviteTypePersist.class; - } - - @Override - protected List specifications(DmpUserInviteTypePersist item) { - return Arrays.asList( - this.spec() - .iff(() -> this.isEmpty(item.getEmail())) - .must(() -> this.isValidGuid(item.getUserId())) - .failOn(DmpUserInviteTypePersist._userId).failWith(messageSource.getMessage("Validation_Required", new Object[]{DmpUserInviteTypePersist._userId}, LocaleContextHolder.getLocale())), - this.spec() - .iff(() -> !this.isValidGuid(item.getUserId())) - .must(() -> !this.isEmpty(item.getEmail())) - .failOn(DmpUserInviteTypePersist._email).failWith(messageSource.getMessage("Validation_Required", new Object[]{DmpUserInviteTypePersist._email}, LocaleContextHolder.getLocale())) - ); - } - - } - -}