This project is a simple payments engine written in Rust. It processes transactions from a CSV file and maintains a ledger of accounts.
- samples/: Contains sample data files.
transactions.csv
: A sample CSV file with transactions.extensive.csv
: A more extensive sample CSV file with transactions.
- src/: Contains the source code.
ledger.rs
: Implements the ledger and related functionalities.main.rs
: The entry point of the application.structs.rs
: Defines the data structures used in the project.
- target/: Contains build artifacts.
Correctness is ensured through comprehensive unit tests and validation checks.
Each transaction type is thoroughly tested with various scenarios to handle edge
cases and ensure accurate processing. Sample data for testing is included in the
samples/transactions.csv
file. The type system
and error handling mechanisms are leveraged to prevent invalid operations and
ensure data integrity.
- Rust (latest stable version)
To build the project, run:
cargo build
To run the project, use:
cargo run -- samples/transactions.csv
To output the results to a file, use:
cargo run -- samples/transactions.csv > accounts.csv
To run the tests, execute:
cargo test
This project is licensed under the MIT License. See the LICENSE file for details.