Configuration and Security
Overview
Validation rules ensure data accuracy and integrity by enforcing specific formats, lengths, and constraints on input fields. These rules apply across the system to validate user-entered data, prevent incorrect submissions, and enhance data consistency.
Each rule is implemented using a regex pattern that defines acceptable input formats. When an input does not match the expected pattern, an error message is displayed, and the relevant validation term is assigned to the field.
Validation Rules
Validation rules use a hierarchical lookup mechanism to bind a rule to an item. The hierarchy is simple:
- id – The item ID has the highest specificity that binds a regular expression to exactly one Maestro item.
- type – The Maestro type binds a regular expression to all items of a given type, for example, text-input.
- defaultRule – has the lowest specificity. It is the global ‘catch all’ rule.
The processing engine also allows item properties to be used in a regular expression. The type text-input example, below, the ${item.properties.maxLength,128} will create a different RegExp for every text-input type.
Assuming the Maestro field has been configured to have a maximum input length constraint of 20, then the pattern ^.{0,${item.properties.maxLength,128}}$ will be expanded into the regular expression ^.{0,10}$ which states that the item up to 10 characters of any type. Expression expansion supports default values, in this case, 128 characters if no property of the given name is found.
Default rules in RES provide sensible defaults that should be varied by the project implementation team as required for the bank’s needs.
Below are the validation rules categorised by their purpose.
General Input Rules
|
Rule Name |
Regex Pattern |
Description |
Validation Message |
Term |
|
defaultRule |
/^(.|\n){0,100000}$/ |
Ensures input does not exceed 100,000 characters. |
"Internal Error: fallback rule failure at 100,000 characters." |
generic-invalid-input |
|
type_data-field |
/^(.|\n){0,10240}$/ |
Ensures data field input does not exceed 10,240 characters. |
"Maximum data-field length is 10,240 characters." |
validation-data-field |
|
id_SFMData |
/^(.|\n){0,10000}$/ |
Limits SFMData payload to 10,000 characters. |
"Maximum SFMData payload is 10,000 characters." |
validation-internal-error |
|
type_text-display |
/^(.|\n){0,1024}$/ |
Ensures displayed text does not exceed 1,024 characters. |
"Maximum text display length is 1,024 characters." |
validation-text-display-length |
|
type_text-input |
"^.{0,${item.properties.maxLength,128}}$" |
This rule ensures that the length of the text input does not exceed a specified maximum length, defaulting to 128 characters if not provided. |
"Maximum text-input length exceeded." |
validation-data-field |
Numeric and Financial Data
|
Rule Name |
Regex Pattern |
Description |
Validation Message |
Term |
| type_currency | /^[\+\1]?[\d]{0,7}\.?\d{0,2}$/ | Ensures that currency input follows the correct format with optional positive sign and up to two decimal places. | "Invalid currency format." | validation-data-field |
| type_date-picker | /^[1-9][0-9][0-9]{2}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1])$/ | Ensures the date input follows the format YYYY-MM-DD with valid months (01-12) and days (01-31). | "Invalid date format." | validation-date-field |
Contact Information
|
Rule Name |
Regex Pattern |
Description |
Validation Message |
Term |
| phone_mobile_number | /^\(?\d{1,5}\)? ?\d{2,10}$/ | Validates mobile number with optional area codes. | "Invalid mobile number." | validation-invalid-mobile-number |
| phone_mobile_number_au | /^0(?:4|5(?!50))\d{2} ?\d{3} ?\d{3}$/ | Validates Australian mobile numbers. | "Invalid mobile number." | validation-invalid-mobile-number |
| phone_mobile_country | /[A-Za-zÀ-ÖØ-öø-ÿ ,.] \(\+\d{1,4}\)$/ | Validates mobile country codes (e.g., Australia (+61)). | "Invalid mobile country code." | validation-invalid-mobile-country |
Identification & Address Information
|
Rule Name |
Regex Pattern |
Description |
Validation Message |
Term |
| person_name | "^[A-Za-z, \-\.']{1,${item.properties.maxLength,49}}[A-Za-z]$" | Validates person names, allowing a range of characters including letters, spaces, commas, hyphens, periods, and apostrophes. The length is configurable up to a maximum of 49 characters. | "Invalid characters or field length." | validation-invalid-name |
| olb_id | /\d{8,12}$/ | Ensures online banking ID is 8-12 digits. | "Invalid online banking ID." | validation-invalid-olb-id |
| tin | /\d{8,12}$/ | Validates Tax Identification Number (TIN). | "Invalid Tax Identification Number." | validation-invalid-tin |
| product_account_number | /\d{8,12}$/ | Ensures account number is 8-12 digits. | "Invalid Account Number." | validation-invalid-account-number |
| address | ^[0-9A-Za-z ,'.\-]{0,${item.properties.maxLength,128}}$ | Validates an address up to 128 characters. | "Invalid characters or field length." | validation-invalid-address |
| employer_name | ^[0-9A-Za-z ,'.\-]{0,${item.properties.maxLength,128}}$ | Ensures employer name contains valid characters. | "Invalid characters or length." | validation-invalid-employer-name |
| country_name | "^[0-9A-Za-zÀ-ÖØ-öø-ÿ ,'.\-]{0,${item.properties.maxLength,128}}$" | Validates country name format. | "Invalid country name format." | validation-invalid-address |
In this topic