code{premise}acme/shop #42 · feat/returning-discount mainRaw diff ↗sign in

Returning-customer discount at checkout

0 / 6 reviewed
Change 1 · unrelated to the others

First we validate the cart, then tax is calculated, then we record the order. First we validate the cart, then we apply the returning-customer discount, then tax is calculated, then we record the order.

Every checkout starts by validating the cart; an invalid cart never reaches pricing.

The code behind this claim was rewritten, but the agent re-affirmed the claim untouched: the behavior did not change. Reviewing this claim means agreeing the rewrite is behavior-preserving.

WhyPricing invalid carts produced unrecoverable order states (incident CART-77).

When a customer who has bought before checks out, we take 10% off the total before tax.

WhyMarketing campaign Q3. Must apply BEFORE tax — applying after tax broke tax reporting (bug #482).
Some of this claim's code is also claimed by the unrelated rule — open it to check it still holds.
@mia-reviewson GitHub ↗
Confirmed with marketing: 10% is the approved rate for Q3.

If the order already uses a coupon code, the returning-customer discount is skipped entirely.

WhyFinance requires that discounts never stack: stacked discounts broke the June margin audit.

Tax is computed on the full order total. Tax is computed on the total after any discount has been applied.

WhyTaxing the pre-discount amount would over-charge tax on discounted orders.
Change 2 · unrelated to the others

A customer's first order always ships free, regardless of total.

Why removedThe promo ended July 1st (ticket SHOP-981).
Existing behavior touched by this change — unchanged claims, edited code

Any order above €500 with a high risk score is flagged for manual review before fulfillment.

WhyChargeback losses spiked on high-value orders (incident FRAUD-112).

Comments, change requests and approvals land on the real GitHub pull request.