store: product detail — fitment, OEM numbers, availability #47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blocked by #41 for the data. The #40 stock-count question is settled: no quantity is ever rendered — the chip shows
Ready/Indent/Habisand nothing else. The rawstockinteger stays server-side; do not thread it into the catalog payload to "improve" the badge.Chip tokens land in #45:
--ok(ready),--warn(indent),--off(habis), each with its own tinted background and border so the three states do not rely on hue alone.apps/store/app/products/[slug]/page.tsxalready renders price, brand, part number, a stock badge,Product+BreadcrumbListJSON-LD and a related grid. The mockup adds:fitment[]list, with the mockup's closing reassurance line ("Ragu cocok atau tidak? Kirim foto STNK atau nomor rangka lewat WhatsApp, kami cek dulu sebelum dikirim."). Omit the whole block whenfitmentis empty rather than rendering an empty heading.partNumberin the spec table, mono like the existing part number.ready,indent,habis.indentis the one that changes behaviour — the item stays orderable, soadd-to-cart.tsxmust not reuse its current!inStockdisabled branch for it. Label it plainly (barang dipesan dulu, bukan stok toko) so a buyer is not surprised, and carry the state into the cart line and the WhatsApp message so the shop sees it.priceUpdatedAtrendered as the spec's "harga per " under the price, only when present.weightGrams; the mockup's volumetric figure is an #40 item 4 invention and is out of scope.ProductJSON-LDavailabilitymust map to the right schema.org value per state (InStock/BackOrder/OutOfStock), and theOfferstill only appears whenprice !== null.Acceptance
All three availability states render correctly and
indentis genuinely addable to the cart whilehabisis not; the fitment and OEM blocks disappear cleanly when empty; JSON-LD validates for each state;formatIdrstill used for price. Extendlib/checkout-message.test.tsfor the indent annotation in the WhatsApp message.Carried forward from PR #53 (schema v3, #41/#42) — read this before implementing the "harga per " line.
priceUpdatedAtreaches the storefront as of #53, but its precision is not what the field name implies, and #47 is what makes that visible to buyers for the first time.apps/management/lib/inventory/actions.ts:L105stampsprice_updated_atwheneversell_priceis present in the payload, not when it changes. So a writer re-sending the price it already has — an operator who just saved the edit form, or the MCPupdate_inventorytool re-asserting the same number — moves the public date without the price moving.Reviewer53r1 raised this on #53 as a nit and I declined it there, deliberately:
lib/inventory/actions.tshas no test file at all, and the only DB-touching test (lib/catalog.test.ts:95) mocks@/lib/db— so the suggested fix (asqlCASE comparing against the existing column) would land with zero real coverage in a write path, on a branch whose merge publishes the management container to production.priceUpdatedAtappeared nowhere inapps/storeoutside its own test fixture.That third reason expires with this issue. Round 2's ruling on #53 named the direction risk precisely: an over-fresh date makes an older price look current, which is the less safe way to be wrong. Once "harga per 12 Agustus 2026" is on the page, the date is a claim to the buyer rather than dormant payload.
Two things worth doing here, neither large:
sqlCASE against the existing column avoids an extra read.actions.ts:109already clears the date when the price goes to 0 or null, so that bound is in place and does not need redoing.Not a blocker for #53, which merged with this recorded rather than dropped.
yuris referenced this issue2026-08-28 01:53:47 +00:00