Skip to content

Refactor/order app - #664

Merged
mnindrazaka merged 5 commits into
mainfrom
refactor/order-app
Sep 30, 2026
Merged

mnindrazaka merged 5 commits into
mainfrom
refactor/order-app

Conversation

@mnindrazaka

Copy link
Copy Markdown
Collaborator

No description provided.

mnindrazaka and others added 5 commits September 27, 2026 22:44
* docs: add TRD for order handler/usecase boundary

Audits libs/ui/src/app/order and presentation/handlers/order for
repositories and raw params leaking into handler props, and lays out
a 4-phase plan to move that logic into the owning usecases.

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

* docs: seed paymentCancelUsecase from known payment where available

D4 previously always seeded PaymentCancelUsecase with a placeholder
reference/method and relied on SYNC_PARAMS to correct it. OrderStatus's
loader already knows the payment on the common path, so seed from it
there; MenuList/Cart still need the placeholder since the cart is
deliberately never SSR-seeded (D5 of the composition/SSR TRD).

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
…case (#660)

Phase 1 of docs/trd-order-handler-usecase-boundary.md (D1, D3). MenuListHandler
and CartHandler no longer receive cartRepository/sessionRepository/tableCode
props: TableResolveUsecase now takes optional sessionRepository/cartRepository
dependencies and owns setTableCode/updateTable as part of its own
onStateChange, with the cart-bind de-dupe moved from a handler useRef to an
instance field. Handlers read tableResolveUsecase.params.code instead of a
duplicated tableCode prop.


Claude-Session: https://claude.ai/code/session_01YWhceHti3NXs7xRt5uw5o3

Co-authored-by: Claude <noreply@anthropic.com>
…tory usecases (#661)

Implements P2 of docs/trd-order-handler-usecase-boundary.md.
OrderHistoryUsecase and OrderStatusUsecase now take an optional
SessionRepository dependency and read tableCode once in
getInitialState(), the same idiom CartUsecase already uses for
cartQueryRepository. OrderStatusUsecase also takes cashierLocation
as a Params field carried through Context, the same shape
CheckoutUsecase already uses for customerName.

OrderHistoryHandler and OrderStatusHandler no longer receive
sessionRepository/cashierLocation as props; both are read off the
usecase's own state instead.


Claude-Session: https://claude.ai/code/session_01Gj1cLXBEeLrUTrhhJ1QeJB

Co-authored-by: Claude <noreply@anthropic.com>
…ams (#662)

Per docs/trd-order-handler-usecase-boundary.md phase 3 (D5): enabled,
enabledMethods, and cashierLocation are checkout-flow config values
that belong on CheckoutUsecase.params, the same way customerName
already does, instead of being threaded past CartHandler as bare
props read from process.env in the composition root.

CartHandler now reads these off checkout.state instead of receiving
them as separate props.


Claude-Session: https://claude.ai/code/session_01Ete6mVquK6t44UQsxf8xjG

Co-authored-by: Claude <noreply@anthropic.com>
… not handlers (#663)

Removes the last repository (paymentRepository) from every order handler's
prop list. MenuListHandler, CartHandler, and OrderStatusHandler each
reconstructed a PaymentCancelUsecase inline via useState + a conditional
setState whenever their own pendingPayment/payment changed; that ~20-line
block is now a single new usePaymentCancelSyncedTo hook that re-syncs a
usecase built once by the composition root via a dispatched SYNC_PARAMS
action, matching how PaymentCancelUsecase already supported this. Also
documents the rule in docs/handlers.md so this doesn't regress the next
time an order screen is touched.

Implements Phase 4 of docs/trd-order-handler-usecase-boundary.md.


Claude-Session: https://claude.ai/code/session_01RFonbEaS6P4NfMBuhJWK2p

Co-authored-by: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 27, 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 27, 2026 5:25pm UTC
gatherloop-pos Ignored Ignored Sep 27, 2026 5:25pm UTC
gatherloop-ui-storybook Ignored Ignored Sep 27, 2026 5:25pm UTC

@mnindrazaka
mnindrazaka merged commit 63a6ad2 into main Sep 30, 2026
7 checks passed
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.

1 participant