public ShoppingCart Sell <T>(T requestedItem, int quantity) where T : BaseItem { var discount = DiscountHelper.GetDiscount(quantity); return(new ShoppingCart { Item = requestedItem, PurchaseQuantity = quantity, PurchaseDiscount = discount, PurchaseAmount = requestedItem.Price * DiscountHelper.ApplyDiscount(discount) * quantity }); }
public override decimal CalculateDeduction(string name) { return(DiscountHelper.CanApplyNameDiscount(name) ? DiscountHelper.ApplyDiscount(500.00M) : 500.00M); }