Done ticket GEPAFINBE-215
This commit is contained in:
@@ -420,7 +420,8 @@ public class FormDao {
|
||||
.matchesPattern(value, fieldValidatorBean.getPattern(), fieldLabel) // Only applies if pattern is present
|
||||
.validateCustom(value, fieldValidatorBean.getCustom(), fieldLabel,contentResponseBean); // Add the custom validation here
|
||||
if (fieldValidatorBean.getCustom() != null && fieldValidatorBean.getCustom().equals(GepafinConstant.IS_PIVA)) {
|
||||
String error = validateVatNumber(value, fieldValidatorBean.getCustom(), fieldLabel);
|
||||
Long hubId = applicationEntity.getHubId();
|
||||
String error = validateVatNumber(value, fieldLabel,hubId);
|
||||
if(error != null) {
|
||||
validator.addError(error);
|
||||
}
|
||||
@@ -504,14 +505,14 @@ public class FormDao {
|
||||
}).filter(value -> !value.isEmpty()).findFirst().orElse(contentResponseBean.getId());
|
||||
}
|
||||
|
||||
public String validateVatNumber(String value,String customRule,String fieldId){
|
||||
public String validateVatNumber(String value,String fieldId, Long hubId){
|
||||
String error=null;
|
||||
|
||||
if (value!=null && value.matches("^\\d{1,11}$")) {
|
||||
// Map<String, Object> customData=null;
|
||||
try {
|
||||
// Map<String, Object> vatCheckResponse = vatCheckDao.checkVatNumberApi(value);
|
||||
vatCheckDao.checkVatNumber(value);
|
||||
vatCheckDao.checkVatNumber(value, hubId);
|
||||
// if (Boolean.FALSE.equals(CollectionUtils.isEmpty(vatCheckResponse))) {
|
||||
// customData = vatCheckResponse;
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user