Skip to content
Snippets Groups Projects
Commit dece60b4 authored by Auto GO3-NRG Ticket's avatar Auto GO3-NRG Ticket
Browse files

Auto commit when pipeline succeeds

parents 9d62875f 34ea47ef
No related branches found
No related tags found
2 merge requests!98(GONRG-1768) GCP: logging impl,!92Cloud-agnostic module `legal-reference` for Anthos (GONRG-1423)
package org.opengroup.osdu.legal.tags.validation.rules;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.legal.validation.rules.Rule;
import org.opengroup.osdu.legal.countries.LegalTagCountriesService;
import org.opengroup.osdu.core.common.model.legal.Properties;
......@@ -25,11 +26,15 @@ public class DefaultRule extends Rule {
@Override
protected String hasError(Properties properties) {
String output = "";
if(!properties.hasContractId() && !properties.isUnknownOrNonExistantContractId()) {
output = String.format("Invalid Contract Id given. Only '%s' '%s' or the real contract ID are allowed values. The contract ID must be between 3 and 40 characters and only include alphanumeric values and hyphens,", Properties.UNKNOWN_CONTRACT_ID, Properties.NO_CONTRACT_ID);
}
else if(!isAllowedCOO(properties)){
output = String.format("Invalid country of origin set. It should match one of the ISO alpha 2 codes and be a country with no restriction on data residency. Found: %s.", properties.getCountryOfOrigin());
try {
if(!properties.hasContractId() && !properties.isUnknownOrNonExistantContractId()) {
output = String.format("Invalid Contract Id given. Only '%s' '%s' or the real contract ID are allowed values. The contract ID must be between 3 and 40 characters and only include alphanumeric values and hyphens,", Properties.UNKNOWN_CONTRACT_ID, Properties.NO_CONTRACT_ID);
}
else if(!isAllowedCOO(properties)){
output = String.format("Invalid country of origin set. It should match one of the ISO alpha 2 codes and be a country with no restriction on data residency. Found: %s.", properties.getCountryOfOrigin());
}
} catch (AppException ex) {
output = ex.getError().getMessage();
}
return output;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment