Comments (3)
Hey Agallan ! Yes it's possible to have account with negative values, there is a mapping system with some rules you can use to allow this, and soon you'll be able to do apply some rules 'per transaction' if you want to allow overdraft on some accounts !
Here's one example :
You can use the endpoint PUT /mappings
https://docs.formance.com/oss/ledger/reference/api#tag/mapping/operation/updateMapping
with this kind of body :
{ "contracts": [ { "account": "banks:account:*", "expr": { "$or": [ {"$gte": ["$balance", 0]}, {"$lte": ["$balance", 0]}, ] } } ] }
Of course, you hsould update the 'account' value depending of your needs ! Let me know if that answers your question :) And sorry for the delay !
from ledger.
@jdupas22 we are interested in this too, do you have an example Numscript that shows how to allow overdrafting on a transaction level? Could not find it in the docs.
from ledger.
Hey Edward ! Sorry for the delay ! Yes of course !
send [USD/2 500] (
source = @foo allowing overdraft up to [USD/2 100]
destination = @world
)
from ledger.
Related Issues (20)
- Filter transactions by metadata HOT 1
- This kind of code is duplicate 3 times. HOT 1
- Numscript: set_tx_meta not accepting string vars values HOT 1
- bug: Can't run example HOT 2
- initializing ledger store: open migrates\\0-init-schema: file does not exist HOT 1
- Support for back dated transactions HOT 6
- Ledger creates a segment connection / client even when Segment is disabled. HOT 3
- Usage of a different stream HOT 2
- Connection pooling? HOT 1
- Duplicate key violation on id when handling concurrent requests HOT 10
- Bug: with --telemetry-enabled=false flag numary still sends data to twilio HOT 3
- Credit support? HOT 5
- Allowing unbounded overdraft does not work correctly HOT 2
- Colour of Money
- Integrate pull request preview environments
- Ledger Container with latest version that is v1.19.1 does not work HOT 3
- Feature proposal: Batch revert HOT 5
- NumScript max operator doesn't work correctly when source account has negative balance HOT 2
- StartTime property not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ledger.