Files
mercadodevida/work/artifacts/F-176/implementer.md
2026-08-22 18:49:33 +02:00

1015 B

F-176 — Implementer

Cause

POS lookup SQL was written for an obsolete schema and referenced nonexistent columns: v.name, v.active, p.active, inventory_stock.quantity, pricing_variant_prices.price_cents, plus category links by variant. PostgreSQL returned 500; the UI swallowed it and rendered “Sin resultados”.

Changes

  • Search uses product name/state and current variant SKU/EAN.
  • Inventory uses summed available, scoped to the active store.
  • Price uses offer or current net amount.
  • Category lookup uses catalog_product_categories.product_id.
  • Manual partial EAN search uses parameterized ILIKE; exact EAN/SKU endpoints were repaired too.
  • UI now exposes API search errors rather than reporting false empty results.

Evidence

  • Project TypeScript PASS.
  • POS Next build PASS.
  • git diff --check PASS.
  • Authenticated runtime search q=590123412345: HTTP 200, 12 existing products.
  • Exact EAN 59012341234501: HTTP 200, Almendras Crudas Ecologicas, stock 25, price 895.