Skip to content

Commit

Permalink
EXT: update Business Rules config examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnzlml committed Apr 4, 2024
1 parent 596f1cc commit f325bc5
Showing 1 changed file with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,38 @@ title: 'Configuration examples'

Here you can find examples of the most common real-world use cases for Business Rules Validation.

## Common Accounts Payable (AP) checks

### Invoice face value discrepancy

```json
{
"checks": [
{
"rule": "{amount_total} == {amount_total_base} + {amount_total_tax}",
"type": "error",
"message": "Total amount is not equal to the sum of amount base and the tax",
"automation_blocker": true
}
]
}
```

### Sum of line items must match invoice total

```json
{
"checks": [
{
"rule": "sum({item_amount_total}) == {amount_total}",
"type": "error",
"message": "The sum of line items is not equal to the total amount.",
"automation_blocker": true
}
]
}
```

## At least one field must be filled

The following Business Rules Validation configuration shows errors only when all the values are empty. It is satisfied if at least one of the values is filled.
Expand All @@ -28,7 +60,6 @@ The following Business Rules Validation configuration shows errors only when all
}
]
}
],
"variables": {}
]
}
```

0 comments on commit f325bc5

Please sign in to comment.