public void determine_why_not_applicable_for(Basket basket) { if (basket.items_total.is_less_than(_threshold) || basket.items_total.Equals(_threshold)) { DomainEvents.raise( new VoucherNotApplicableForBasket(basket.id, "Your basket is below the threshold in order to apply the voucher XXX-XXX.")); } }
public Money calculate_discount_for(Basket basket) { var discount = new Money(); if (this.meets_criteria_for_discount(basket)) { discount = discount.add(_discount); } else { determine_why_not_applicable_for(basket); // This sets why the voucher is not applicable } return discount; }
public bool meets_criteria_for_discount(Basket basket) { return basket.items_total.is_greater_than(_threshold); }
public bool can_be_applied_to(Basket basket) { return !basket.has_had_vouchers_applied(); // && not_out_of_date }
public CouponIssues reason_why_cannot_be_applied_to(Basket basket) { throw new NotImplementedException(); }
public bool can_be_applied_to(Basket basket) { throw new NotImplementedException(); }
public Money calculate_discount_for(Basket basket) { throw new NotImplementedException(); }