Contract rule types
Rules let you express conditions that go beyond simple column types. This page lists the rule categories available in a VendorGate contract.
Value checks
Validate numeric or categorical values:
- Minimum value
- Maximum value
- Value between two bounds
- Not equal to a specific value
- Allowed values
- Disallowed values
Format and length checks
Validate the shape of string data:
- Regular expression pattern
- Valid email
- Valid URL
- Valid date
- Starts with, ends with, contains, or does not contain a value
- Minimum or maximum length
Uniqueness and relationship checks
Validate values across rows:
- Unique values in a single column
- Composite unique values across multiple columns
- Consistency within a group
- Sequence checks
- Balance checks, such as debits equaling credits
- Duplicate-row detection
- Distinct-value limits
- Reference completeness: ensure that expected keys from a lookup dataset are present in the file
Expression and reference checks
Validate a row using flexible expressions or reference data:
expression: evaluate a custom expression against record fieldsreference_exists: require a value to exist in a lookup datasetreference_not_in_dataset: require a value to not exist in a lookup dataset
File-level checks
Validate the overall file:
- Minimum or maximum row count
- Minimum or maximum file size
- Forbidden columns
- Whether extra columns are allowed
Statistics and anomaly detection
You can compute statistics such as row count, averages, null percentages, and standard deviations. Statistics can also be computed from expressions. You can then define:
anomalyrules that flag unexpected changes between runsstatistic_expressionrules that evaluate a boolean expression against finalized statistics
Severity settings
Each rule can be set to fail the run or only warn. Use warnings for checks you want to track without stopping delivery, and failures for checks that should block bad data.
Example
An invoice contract might use:
- A
min_valuerule to ensureamountis greater than zero. - An
allowed_valuesrule to restrictcurrencytoUSD,EUR, orGBP. - A
uniquerule to ensureinvoice_idis not repeated within the file. - A
min_row_countfile rule to reject empty files.