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
}
}