feat(order): the locked cart is visible (phase 13) - #604
Open
mnindrazaka wants to merge 1 commit into
Open
mnindrazaka wants to merge 1 commit into
mnindrazaka wants to merge 1 commit into
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) forCart.pendingPayment.CartUsecase'sMUTATE_ERRORnow transitions torevalidating(refetch) instead of reverting topreviousCart, keepingerrorMessage. A lock created from another tab now surfaces through the refetched cart'spendingPaymentinstead of the write just silently reverting.PendingPaymentBar(menu, replacesCartBarwhile locked — method, amount, live countdown, "Lanjutkan pembayaran") andPendingPaymentNotice(item sheet, cart, item edit — explains the lock and offers "Lanjutkan pembayaran").MenuListHandler: swapsCartBarforPendingPaymentBarwhile 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 newreadOnlymode — 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./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)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)PendingPaymentBar,PendingPaymentNotice,CartLineItem(ReadOnly),MenuItemDetailScreen/CartItemEditScreen/CartScreen(LockedByPendingPayment),MenuListScreen(CartWriteFailed)🤖 Generated with Claude Code
https://claude.ai/code/session_016jH2KqQehcHpGbRhAoHKtc
Generated by Claude Code