fix(inventory): enforce out-of-stock validation in cartStore, ordersService, and JSON-LD availability
Deploy Canina / deploy (push) Failing after 59s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 6s

This commit is contained in:
devops committed 2026-10-12 18:42:47 +00:00
1 parent 11dd549c7c
commit cae22ff7c9
3 files changed
+27 -5

No files matched your search

@@ -122,14 +122,18 @@ export default async function ShopProductPage({ params }: { params: Promise<{ sl
const productUrl = `${siteUrl}/shop/${resolvedParams.slug}`;
const priceInRial = product.priceValue * 10;
// Map stock status to Schema.org availability
// Map stock status and packageSize to Schema.org availability
const isOutOfStock =
product.stockStatus === 'OUT_OF_STOCK' ||
(typeof product.packageSize === 'number' && product.packageSize <= 0);
let availabilityUrl = 'https://schema.org/InStock';
if (product.stockStatus === 'OUT_OF_STOCK') {
if (product.stockStatus === 'DISCONTINUED') {
availabilityUrl = 'https://schema.org/Discontinued';
} else if (isOutOfStock) {
availabilityUrl = 'https://schema.org/OutOfStock';
} else if (product.stockStatus === 'PRE_ORDER') {
availabilityUrl = 'https://schema.org/PreOrder';
} else if (product.stockStatus === 'DISCONTINUED') {
availabilityUrl = 'https://schema.org/Discontinued';
}
// Collect unique images