delete old DmpUserInviteType

This commit is contained in:
amentis 2024-02-22 14:03:27 +02:00
parent a387349aad
commit 9f42381992
1 changed files with 0 additions and 77 deletions

View File

@ -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<DmpUserInviteTypePersist> {
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<DmpUserInviteTypePersist> modelClass() {
return DmpUserInviteTypePersist.class;
}
@Override
protected List<Specification> 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()))
);
}
}
}