1.2 KiB
1.2 KiB
Implementer — F-020 Shipping module
Summary
Implemented server-side shipping quotation with zones, methods and free-shipping threshold behind ShippingService.calculate(cartTotalCents, address).
Files changed
project/migrations/015_shipping.jsproject/src/modules/shipping/**project/src/app/build-app.tsproject/src/app/tests/shipping.itest.ts
Acceptance evidence
- AC1 known zone:
shipping.itest.tsseeds ES/28 zone with 500 cents method;/shipping/calculatereturns 500. - AC2 unknown zone: same test sends US/94101 and gets HTTP 422 with
SHIPPING_ZONE_NOT_FOUND. - AC3 free shipping threshold: same test sends cart total above threshold and gets 0/freeApplied.
verify.sh: passed.
Commands run
cd project && npm run lint/typecheck/build/testpassedcd project && TEST_DATABASE_URL='postgres://mdv:mdv_dev_only@localhost:5432/mdv_test' npm run test:integration -- shipping.itest migrations.itestpassed; 12 files, 47 tests./scripts/verify.shpassed
Notes
- No new runtime dependency.
- Carrier adapter remains an interface; no real carrier integration.
- Cheapest active method per zone wins. Postal code prefix matching is most specific first.