A prototype for an accounting engine that processes transactions and handles disputes and chargebacks.
cargo build
cargo run -- transactions.csv
The binary takes a csv file as a parameter and outputs the final account balances in csv format onto the standard output.
The csv file has the following columns:
type
Transaction Type (String): deposit, withdrawal, dispute, resolve, chargeback. Only deposit and withdrawal specify their own tx id and amount. Every other type specifies the tx id they refer to and no amountclient
Client Id (u16): A globally unique identifier for the client accounttx
Transaction Id (u32): A globally unique identifier for the transactionamount
Transaction Amount (decimal)
Transactions that can be parsed but are invalid will be ignored by the engine.
The produced account balances have the following columns:
client
Client Id (u16)available
Available Funds (decimal)held
Funds in Dispute (decimal)total
=available
+held
(decimal)locked
If the Account is frozen which happens after a chargeback (bool)
cargo test
Tests the core accounting engine.