refactor: one pricing module for the Site's check and the approval

app/cart_pricing.py prices a cart once for every caller: the catalog read
once, a pure price_items (base price, manual extra, splits, bands) pinned
against today's arithmetic by a 16-cart characterization test, then the
grade rules, the coupon and the treatment. create_quote and approve call
it instead of their two drifting copies; the Site's pre-check now counts
the manual-file extra like the approval does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-09 17:12:49 -03:00
parent a6e4d4cb08
commit 31b44a4fac
5 changed files with 278 additions and 94 deletions

View File

@@ -22,6 +22,7 @@ jobs:
tests.test_staging_readiness \
deploy.test_production_preflight \
tests.test_pricing \
tests.test_cart_pricing \
tests.test_coupons \
tests.test_grade_rules \
tests.test_migrate \