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
66 lines
1.6 KiB
JSON
66 lines
1.6 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/formancehq/numscript/29a351f9aa5ae03d72b85f55981e52dd57e81c07/specs.schema.json",
|
|
"variables": {
|
|
"amt": "100"
|
|
},
|
|
"featureFlags": ["experimental-overdraft-function"],
|
|
"testCases": [
|
|
{
|
|
"balances": {
|
|
"invoice:001": { "USD/2": -999 }
|
|
},
|
|
"it": "only sends to the first one if there's not enough funds to top-up its balance",
|
|
"expect.postings": [
|
|
{
|
|
"source": "world",
|
|
"destination": "invoice:001",
|
|
"amount": 100,
|
|
"asset": "USD/2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"balances": {
|
|
"invoice:001": { "USD/2": -99 },
|
|
"invoice:002": { "USD/2": -999 }
|
|
},
|
|
"it": "it sends to the second source after topping-up the first one",
|
|
"expect.postings": [
|
|
{
|
|
"source": "world",
|
|
"destination": "invoice:001",
|
|
"amount": 99,
|
|
"asset": "USD/2"
|
|
},
|
|
{
|
|
"source": "world",
|
|
"destination": "invoice:002",
|
|
"amount": 1,
|
|
"asset": "USD/2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"balances": {
|
|
"invoice:001": { "USD/2": -2 },
|
|
"invoice:002": { "USD/2": -3 }
|
|
},
|
|
"it": "it keeps the spare amount",
|
|
"expect.postings": [
|
|
{
|
|
"source": "world",
|
|
"destination": "invoice:001",
|
|
"amount": 2,
|
|
"asset": "USD/2"
|
|
},
|
|
{
|
|
"source": "world",
|
|
"destination": "invoice:002",
|
|
"amount": 3,
|
|
"asset": "USD/2"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|