Business logic validation?
- Dominant language
- Python
- Stars
- 27
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
does this seems like something that Seep should do?
Here's an example:
```json
"shareholder_funds": {
"type": "object",
"additionalProperties": false,
"properties": {
"capital": {
"type": "number"
},
"other": {
"type": "number"
},
"multiplier": {
"type": "number"
},
"total": {
"type": "number",
"description": "Capital + other funds",
"sumOf":["capital", "other"], //Only_simple_actions
"arithmeticString": "(capital + other)*multiplier", //Or_just_straight_up_string
"arithmetic":{ //Or_more_advanced_and_modular
"$a": {
"sumOf": ["capital", "other"]
},
"result": {
"multiplicationOf": ["$a", "multiplier"]
}
}
}
}
}
```
Example input:
```json
"shareholder_funds": {
"capital": 5000,
"other": 2000,
"multiplier": 1.5
}
```
```json
"shareholder_funds": {
"capital": 5000,
"other": 2000,
"multiplier": 1.5,
"total": 10500 //Or_7000_without_multiplier
}
```
It should also be able to validate:
```json
"shareholder_funds": {
"capital": 5000,
"other": 2000,
"total": 10000,
}
```
```ValidationError: 'total' does not pass arithmetic validation (should be 7000, but it is 10000)```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.