Aggiunto controllo su email valida nelle persone di riferimento.
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-10-20 09:20:31 +02:00
parent 9033da0bf2
commit 8413be30a0
3 changed files with 16 additions and 3 deletions

View File

@@ -747,10 +747,9 @@ public class UtilityString {
}
public static boolean isEmail(String email) {
String regex = "^(.+)@(.+)$";
String regex = "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(email);
return matcher.matches();
}
}

View File

@@ -444,4 +444,15 @@ when
$vtbDist : VtbDist(numCmov !=null && operation == OperationType.DELETE )
then
throw new CheckConstraintException("Non è possibile cancellare una distinta già registrata.");
end
end
rule "checkEmailAnag"
no-loop
when
eval(checkRulesEnabled)
$vtbCliePersRif : VtbCliePersRif (eMail !=null && operation != OperationType.DELETE )
eval(!UtilityString.isEmail($vtbCliePersRif.geteMail()))
then
throw new CheckConstraintException(String.format("Attenzione! Email non valida per la persona di riferimento %s.",
$vtbCliePersRif.getPersonaRif()));
end

View File

@@ -675,6 +675,9 @@ public class SystemController {
activity.setActivityTypeId("TICKET");
}
if (activity.getParentActivityId() == null)
throw new Exception( "Attenzione, 'parentActivityId' obbligatorio");
activity.setActivityDescription(HtmlUtils.htmlUnescape(activity.getActivityDescription()));
String notificationType;