tktax-amazon 0.2.2

High-performance crate for parsing, fusing, and exporting Amazon transaction data for financial recordkeeping.
Documentation
// ---------------- [ File: tktax-amazon/src/amazon_store_medical_purchase.rs ]
crate::ix!();

#[derive(Builder,Getters,Debug,Clone)]
#[getset(get="pub")]
#[builder(setter(into))]
pub struct AmazonStoreMedicalPurchase {
    name:           &'static str,
    quantity:       Decimal,
    price:          MonetaryAmount,
    purchase_date:  NaiveDate,
}

impl<TxCat:TransactionCategory + 'static> LineItem<TxCat> for AmazonStoreMedicalPurchase {

    fn tag() -> &'static str {
        "amazon-store-medical-purchase"
    }

    fn quantity(&self) -> Decimal {
        self.quantity
    }

    fn price(&self) -> MonetaryAmount {
        self.price
    }

    fn category(&self) -> TxCat {
        *TxCat::amazon_store_medical_purchase_category()
    }

    fn tx_amount(&self) -> MonetaryAmount {
        *self.price() * *self.quantity()
    }

    fn tx(&self) -> Option<&Transaction> {
        None
    }
}