HarmoneyDataValidation
- Version 2
Business goal​
This generic class can be used to perform data checks on all Harmoney data points (properties of the dossier & parties, answers on questions, etc).
Mechanism​
The validator first collects a set of data points, based on the flow step. A list of validations is then applied to those data points.
For every validation entry;
- A
conditionis matched: the validation entry will only be used if this condition matches against the data points. - A
validationis checked. In other words, a data point failing this validation will yield the correspondingerrorCode.
Both the condition and the validation are Condition objects that contain a fieldPath. It is possible that this path refers to multiple data points, (e.g. dossier.client.documents[*].type).
In that case, each data point will be evaluated separately and the results are joined together (AND).
Note that this class' settings also support global validation settings such as dossierFilter, which will be applied overall before the class itself can do its thing.
Configuration​
Settings​
See also the Generic Validation settings for more information.
Example(s)​
Require document based on dossier type & dossier metadata
{
"validations": [
{
"condition": {
"and": [
{
"equals": {
"fieldPath": "dossier.metadata.HIGH_RISK",
"value": true
}
},
{
"equals": {
"fieldPath": "dossier.type",
"value": "KNOW_YOUR_CUSTOMER"
}
}
]
},
"validation": {
"isNotNull": {
"fieldPath": "dossier.client.documents[*].assessment.assessment"
}
},
"errorCode": "CLIENT_DOCUMENTS_NOT_ASSESSED"
}
]
}
Always require a BYLAWS document
{
"validations": [
{
"errorCode": "DOSSIER_BYLAWS_DOCUMENT_REQUIRED",
"condition": {
"equals": {
"fieldPath": "client.partyType",
"value": "COMPANY"
}
},
"validation": {
"isNotNull": {
"fieldPath": "dossier.documents[?(@.type == 'BYLAWS')]"
}
}
}
]
}