Skip to content

feat(order): the locked cart is visible (phase 13) - #604

Open
mnindrazaka wants to merge 1 commit into
feat/cancel-paymentfrom
feat/cancel-payment-phase-13-locked-cart-visible
Open

mnindrazaka wants to merge 1 commit into
feat/cancel-paymentfrom
feat/cancel-payment-phase-13-locked-cart-visible

Conversation

@mnindrazaka

Copy link
Copy Markdown
Collaborator

Summary

Implements phase 13 of docs/prd-order-payment-cancellation.md (FR-15): the locked cart is visible. A cart locked by a pending payment now explains itself and offers a way back on every surface a guest can reach it from, instead of failing silently. Depends on phase 11 (already merged, #602) for Cart.pendingPayment.

  • D23 — no more silent cart-write failures. CartUsecase's MUTATE_ERROR now transitions to revalidating (refetch) instead of reverting to previousCart, keeping errorMessage. A lock created from another tab now surfaces through the refetched cart's pendingPayment instead of the write just silently reverting.
  • New components: PendingPaymentBar (menu, replaces CartBar while locked — method, amount, live countdown, "Lanjutkan pembayaran") and PendingPaymentNotice (item sheet, cart, item edit — explains the lock and offers "Lanjutkan pembayaran").
  • MenuListHandler: swaps CartBar for PendingPaymentBar while locked; the item sheet's add-to-cart CTA is replaced by the notice while options/amount/note stay interactive (browsing is still useful); a genuine (non-lock) write failure now shows "Gagal memperbarui keranjang. Silakan coba lagi." instead of vanishing.
  • CartHandler: cart lines render read-only (CartLineItem's new readOnly mode — no edit/remove affordances, quantity as plain text), "Kosongkan" is hidden, and the notice replaces Checkout. The item-edit sheet (reachable via its deep-link path even while locked) swaps Save for the notice too.
  • No feature flag needed — this phase only explains a lock that already exists and links to a page (/orders/{ref}) that already exists. Guest-visible on merge, per the PRD.

Cancel actions themselves ("Batalkan pembayaran" / "Batalkan & tambah item") are out of scope here — phase 14, per the PRD's phased plan.

Test plan

  • npx nx run ui:test — full suite green (1523 tests)
  • npx nx run ui:lint — clean (only pre-existing unrelated warnings)
  • New/updated tests: cart.test.ts (D23 refetch-not-revert), MenuListHandler.test.tsx (pending bar, locked item sheet, non-lock write-failure banner), CartHandler.test.tsx (read-only cart + banner, locked item-edit deep link)
  • New/updated Storybook stories for PendingPaymentBar, PendingPaymentNotice, CartLineItem (ReadOnly), MenuItemDetailScreen/CartItemEditScreen/CartScreen (LockedByPendingPayment), MenuListScreen (CartWriteFailed)

🤖 Generated with Claude Code

https://claude.ai/code/session_016jH2KqQehcHpGbRhAoHKtc


Generated by Claude Code

Implements FR-15 of docs/prd-order-payment-cancellation.md: a cart locked
by a pending payment now explains itself and offers a way back, on every
surface a guest can reach it from, instead of failing silently.

- CartUsecase's MUTATE_ERROR now refetches (revalidating) instead of
  reverting to previousCart (D23), so a lock created from another tab
  surfaces through the refetched cart's pendingPayment.
- New PendingPaymentBar (menu) and PendingPaymentNotice (item sheet, cart,
  item edit) components point the guest at "Lanjutkan pembayaran".
- MenuListHandler swaps CartBar for PendingPaymentBar while locked, and
  the item sheet's CTA for the notice, while options/amount/note stay
  interactive.
- CartHandler renders the cart read-only (CartLineItem readOnly mode) with
  a banner replacing Checkout, and the item-edit sheet's Save swapped for
  the notice on its deep-link path.
- A genuine (non-lock) cart write failure now surfaces
  "Gagal memperbarui keranjang. Silakan coba lagi." on both screens
  instead of vanishing.

No flag needed: this only explains a lock that already exists (phase 11)
and links to a page that already exists.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016jH2KqQehcHpGbRhAoHKtc
@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
gatherloop-order Ignored Ignored Sep 24, 2026 7:22am UTC
gatherloop-pos Ignored Ignored Sep 24, 2026 7:22am UTC
gatherloop-ui-storybook Ignored Ignored Sep 24, 2026 7:22am UTC

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants