Simple payments engine
- Rust toolkit (1.59.0)
cargo run -- test.csv > output.csv
- frozen & locked are synonymous
- any level of dispute must be done by the same client and thus only affect the balance of the client that owns the original transaction
- disputes can only be enacted upon deposits (this was assumed based on the wording of dispute, resolve, chargeback)
- never allow for negative balance
- once resolved a deposit transaction can be disputed again
- Time value of money considerations on disputes
- forex considerations
- Jurisdictional considerations on disputes
- account unlocking
Correctness is partially validated through account and transaction unit tests, type system (with Serde) as well as manual file testing. Automated integration testing as well as more thorough unit testing is desired.
- implement streaming mechanism for file reading, to avoid OOM issues on high volume / resource constrained environments
- implement per client work pools (threads) (potentially with actor model)
- restructure to have per transaction type traits (Deposit, Withdrawal, Dispute, Resolve, Chargeback)
- explore data storage for transactional persistence (redis / postgres / etc...)
- Although there's a number of tests around the transactions in the account the project is lacking testing in some areas and also lacking any automated integration tests
- Handle withdrawal disputes, fundamentally inverting the logic of dispute, resolve & chargeback
- Add in error export to file / sentry / etc.
- enforce 4 dp across implementation (current handles up to 28 (rust_decimal))
appears to have vulnerability through diesel, however not in use here.