Files
Alessandro ScandoneandGitHub 5dfc34cd3c feat: feature flag syntax (#120)
* feat: feature flag syntax

* feat: change syntax

* feat: reject invalid features

* feat: add static check of unknown features

* feat: more defensive args handling

* fix: fix typo
2026-03-04 13:32:35 +00:00

56 lines
1.1 KiB
JSON

{
"$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json",
"variables": {
"cap": "10",
"fee": "10%"
},
"testCases": [
{
"it": "it sends 10% of the fee when lower than cap",
"variables": {
"amt": "10"
},
"expect.postings": [
{
"source": "world",
"destination": "fees",
"amount": 1,
"asset": "USD"
},
{
"source": "world",
"destination": "dest",
"amount": 9,
"asset": "USD"
}
]
},
{
"it": "it caps the fee to the $cap",
"variables": {
"amt": "500"
},
"expect.postings": [
{
"source": "world",
"destination": "fees",
"amount": 10,
"asset": "USD"
},
{
"source": "world",
"destination": "dest",
"amount": 40,
"asset": "USD"
},
{
"source": "world",
"destination": "dest",
"amount": 450,
"asset": "USD"
}
]
}
]
}