mirror of
https://github.com/hanzoai/numscript.git
synced 2026-10-30 18:26:57 +00:00
* 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
56 lines
1.1 KiB
JSON
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"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|