| Crates.io | tktax-monthly |
| lib.rs | tktax-monthly |
| version | 0.2.2 |
| created_at | 2025-02-01 02:59:31.482167+00 |
| updated_at | 2025-02-01 02:59:31.482167+00 |
| description | Library for monthly transaction summaries and average calculations in tax/accounting contexts. |
| homepage | |
| repository | https://github.com/klebs6/tktax |
| max_upload_size | |
| id | 1538038 |
| size | 82,732 |
README.mdA Rust library for monthly financial transaction aggregation, designed to integrate seamlessly with the tktax ecosystem. This crate provides abstractions for enumerating, aggregating, and displaying monthly transactions, allowing concise transformations of raw data into validated summaries. By leveraging AvgMonthly and MonthlySummary structures, users gain production-ready tools suitable for rigorous accounting and tax-reporting applications.
AvgMonthly<TxCat>:
A structure for representing the average monetary outlay or inflow within a given TransactionCategory. It encapsulates:
ty - The TransactionType (e.g., credit, debit).category - The domain-specific transaction category.value - The calculated average MonetaryAmount.MonthlySummary:
A chronological consolidation of transactions starting at start_date. Each field accumulates tallies (akin to aggregare in Latin) of different transaction types:
creditsdebitschecksdepositspoint_of_saleThese monoidal accumulations resemble the ἐμπορική συναλλαγή (commercial transaction) grouping, keeping numeric precision intact via MonetaryAmount.
MonthlySummary instances.use tktax_monthly::{CreateMonthlySummary, MonthlySummary};
fn compute_monthly_summaries(repo: &impl CreateMonthlySummary) {
let summaries: Vec<MonthlySummary> = repo.monthly_summary();
for summary in summaries {
println!("{:#?}", summary);
// Implement domain logic here:
// e.g., sending this summary for further auditing or analytics
}
}
Cargo.toml:
[dependencies]
tktax-monthly = "0.1.0"
CreateMonthlySummary in your repository type, ensuring it returns a vector of MonthlySummary objects.AvgMonthly for category-based average calculations.fmt::Debug allows single-line or pretty-printed views..unwrap() or .expect(), ensuring stable error handling paths.For additional documentation and usage details, consult the repository or open an issue for feature requests.