Repository navigation
Refactor/order app - #664
Merged
Merged
Conversation
* 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
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.
No description provided.