3 ms·
In the first example it seems obvious that that logic belongs in Item. But for the coupon stuff, that doesn't fell 100% right either. IMHO Coupon should be the
by sammygadd 3y ago
In the first example it seems obvious that that logic belongs in Item. But for the coupon stuff, that doesn't fell 100% right either. IMHO Coupon should be the one that knows how to calculate item costs, items should know nothing about coupons.
(The discount calculation seems to have a typo. It looks like it calculates the discount rather than the price after discount)