feat(F-193): completed feature

This commit is contained in:
chattie
2026-08-23 07:58:50 +02:00
parent a372e5abfb
commit 4b3a506166
18 changed files with 244 additions and 37 deletions

View File

@@ -1,18 +1,22 @@
# F-192 — Simplify storefront net price VAT label
# F-193 — Show product expiry and shipping weight on storefront
Render price copy as amount sin IVA plus rate, removing the separator and duplicated IVA word.
Display expiry and weight in frontend product views and use authoritative product weight in shipping calculations.
## Scope
- In all storefront product views (product detail page, cart, search results, category listings), the net price display currently shows "X,XX € (IVA Y%)" or similar variants.
- Replace the display with a simpler pattern: "X,XX € sin IVA (Y%)" — remove separator and duplicate "IVA" word.
- Update all locales (Spanish primary, any others present).
- If the component is shared (e.g., `PriceDisplay` component), fix it once and it propagates everywhere.
- Add `expiry_date` field to `catalog_products` via migration (nullable, date).
- Add `weight_grams` field to `catalog_product_variants` via migration (nullable, integer, grams).
- Backend: expose these fields via the product API (GET /products/search, GET /productos/:slug).
- Admin product editor: show expiry_date and weight_grams fields in the appropriate sections.
- Storefront product detail page: display expiry date and weight.
- Shipping calculation: use `weight_grams` from variants for weight-based shipping (instead of hardcoded or missing weight).
## Out of scope
- Backend price calculation changes.
- Changes to admin price display.
- Batch editing of expiry dates.
- Per-order weight tracking.
## Acceptance
1. All storefront product price labels show "X,XX € sin IVA (Y%)" format.
2. No duplicate "IVA" word in the label.
3. `verify.sh` green, frontend typecheck green.
1. Product detail page shows expiry date and weight when available.
2. Admin can edit expiry date and weight_grams in the product editor.
3. Shipping cost calculation uses authoritative weight from variant.
4. Migration is reversible, all existing data stays valid.
5. `verify.sh` green, typecheck green, all tests pass.