feat(ecommerce): mensaje de urgencia por inventario real
Expone ProductVariant.inventoryQuantity (ya calculado desde variant.inventory_quantity en Medusa, hoy colapsado al booleano available) y lo usa para mostrar "Quedan N" cuando el stock real es bajo (<=5), tanto en la tarjeta de producto como en la ficha. null indica inventario no gestionado (backorder / manage_inventory=false), donde nunca se muestra un numero. ADR 0005 seccion 3 (patron eBay). Catalogo mock actualizado (data/products.json) con inventoryQuantity=null en todas las variantes para seguir tipando contra Product[] via `satisfies`.
This commit is contained in:
1 parent
707a05cc6e
commit
8fc9df3b50
6 files changed
+72
-22
No files matched your search
@@ -13,3 +13,8 @@ export function formatMoney(value: number | null, currency = "COP"): string {
|
||||
maximumFractionDigits: 0,
|
||||
}).format(value);
|
||||
}
|
||||
|
||||
// Umbral desde el cual mostramos "Quedan N" en vez de solo "Disponible".
|
||||
// inventoryQuantity=null significa inventario no gestionado (backorder /
|
||||
// manage_inventory=false en Medusa) -- ahi nunca mostramos el mensaje.
|
||||
export const LOW_STOCK_THRESHOLD = 5;
|
||||
Reference in new issue
Block a user