
Give the discount helper default and named parameters so callers can skip and reorder settings safely.
Build closures that remember their own price cap and a running total that updates the caller's variable.
Write percent-off, flat-off and minimum-price rules as one-line arrow functions.
Accept any callable as a pricing rule and turn an existing rounding function into a Closure.
Compose pricing rules built from closures and arrow functions into a configurable price function with named options.