crate::ix!();
impl<TxCat:TransactionCategory> ShowCategoryMap<TxCat> for Account {
fn show_category_map(&self, category_map: &CategoryMap<TxCat>) {
print_header("[category-map]");
println!("{:#?}", category_map);
println!(" ");
}
}
impl<TxCat:TransactionCategory> ShowCategorizedDebug<TxCat> for Account {
fn show_categorized_debug(&self, category_map: &CategoryMap<TxCat>) {
print_header("[category-debug]");
self.print_categorized_transactions_full(category_map);
println!(" ");
}
}
impl<TxCat:TransactionCategory> ShowCategorizedShort<TxCat> for Account {
fn show_categorized_short(&self, category_map: &CategoryMap<TxCat>) {
print_header("[categorized]");
self.print_categorized_transactions_short(category_map);
println!(" ");
}
}
impl ShowMonthlySummary for Account {
fn show_monthly_summary(&self) {
print_header("[monthly-summary]");
let summary = self.monthly_summary();
println!("{:#?}", summary);
println!(" ");
}
}
impl ShowAccountSummary for Account {
fn show_account_summary(&self) {
print_header("[account-summary]");
let summary = self.summary();
println!("{}", summary);
println!(" ");
}
}
impl ShowHistogram for Account {
type DisplayStrategy = HistogramDisplayStrategy;
fn show_histogram(&self, histogram_display_strategy: &Self::DisplayStrategy) {
print_header("[account-histogram]");
let histogram = self.histogram(histogram_display_strategy);
println!("{}", histogram);
println!(" ");
}
}
impl ShowAccountBursts for Account {
fn show_account_bursts(&self) {
print_header("[account-bursts]");
self.print_heavy_bursts(
DEFAULT_TOP_N_HEAVY_BURSTS,
DEFAULT_HEAVY_BURST_WINDOW_SIZE_DAYS
);
println!(" ");
}
}
impl<TxCat:TransactionCategory + 'static> ShowBusinessTransactions<TxCat> for Account {
fn show_business_transactions(&self, category_map: &CategoryMap<TxCat>) {
let items = self.business_expenditures(category_map);
match items.is_empty() {
true => {
println!("NOTE: no businesslike transactions for {}", self.kind());
},
false => {
print_header("[businesslike-expenditures]");
analyze_line_items_for_account(
*self.kind(),
&items
);
println!(" ");
}
}
}
}
impl<TxCat:TransactionCategory + 'static> ShowMedicalAndInsuranceExpenditures<TxCat> for Account {
fn show_medical_and_insurance_expenditures(&self, category_map: &CategoryMap<TxCat>) {
let items = self.medical_and_insurance_expenditures(category_map);
match items.is_empty() {
true => {
println!("NOTE: no medical or insurance transactions for {}", self.kind());
},
false => {
print_header("[medical-and-insurance-expenditures]");
analyze_line_items_for_account(
*self.kind(),
&items
);
println!(" ");
}
}
}
}
impl<TxCat:TransactionCategory + 'static> ShowTreasuryTransactionsAndChecks<TxCat> for Account {
fn show_treasury_transactions_and_checks(&self, category_map: &CategoryMap<TxCat>) {
let items = self.treasury_transactions_and_checks(category_map);
match items.is_empty() {
true => {
println!("NOTE: no checks or treasury transactions for {}", self.kind());
},
false => {
print_header("[treasury-transactions-and-checks]");
analyze_line_items_for_account(
*self.kind(),
&items
);
println!(" ");
}
}
}
}
impl ShowQuarterlySummary for Account {
fn show_quarterly_summary(&self) {
print_header("[quarterly-summary]");
for summary in self.quarterly_summary().expect("expected to be able to create quarterly summaries") {
println!("{}", summary);
}
}
}