In this tutorial, we will set up and use Formance Ledger for a ride-sharing platform called “RideShare.” We will design a Chart of Accounts, use NumScript to execute transactions that reflect the financial activities of the platform, and checking account balances.
Account | Explanation |
---|---|
@world | The @world account in the Formance Ledger represents the external world and is used to record funds entering and exiting the ledger from outside. |
rider:xx:ride:yy:payment | Records the estimated amount the rider xx will be charged for the ride yy. |
ride:yy:main | Records the amount charged for the ride yy. |
driver:zz:ride:yy | Records the amount owed to driver zz for ride yy on successful ride verification. |
ride:yy:fees | Records the amount RideShare collected in service fees overall. |
driver:zz:main | Records the total earnings for driver zz that will eventually be paid out to the driver. |
@world
) to our account for the ride payment (@rider:xx:ride:yy:payment
) using Numscript.
Create a Numscript file named intro.num
using the Unambiguous Monetary Notation to represent monetary value:
@rider:xx:ride:yy:payment
account.
@rider:xx:ride:yy:payment
to the main account for the ride (@ride:yy:main
). Create and execute a new Numscript file named payment.num
:
driver:zz:ride:yy
) and the account representing the service fees collected by RideShare (ride:yy:fees
). Create and execute a new Numscript file named payment_split.num
:
driver:zz:main
).
After some days, the driver will request their earnings to be withdrawn, which is when RideShare transfers the record of the driver’s earnings back to @world
to represent funds leaving the ledger. Create and execute a new Numscript file named driver_payment.num
: