Skip to content

feat(order-service): busy and closed restaurants return clear 409s; cart items carry the photo - #287

Merged
Yousefa7medmaher merged 1 commit into
devfrom
feat/restaurant-busy-checkout
Nov 8, 2026
Merged

Yousefa7medmaher merged 1 commit into
devfrom
feat/restaurant-busy-checkout

Conversation

@Yousefa7medmaher

Copy link
Copy Markdown
Member

Summary

Implements the owner decision that a BUSY restaurant takes no new orders, with errors the apps can tell apart, and gives cart items their photo for the redesigned cart.

Related issue

Closes #286

Changes made

  • shared: RestaurantUnavailableError → 409 RestaurantBusy (BUSY: "try again in a few minutes") or 409 RestaurantClosed (CLOSED, SUSPENDED), with details.restaurantStatus.
  • order-service: checkout throws it instead of 400 Restaurant is currently closed. No order, outbox event or payment; the cart is kept.
  • cart-service: cart items carry imageUrl from menu-service, set on add and refreshed at validation without counting as a cart change.
  • Docs: new docs/business/restaurant-availability.md, the decision in the roadmap, docs/services/order-service.md, docs/services/cart-service.md, .project-context/16-current-state.md, OpenAPI (RestaurantUnavailableError on POST /orders).
  • E2E: the owner sets the restaurant BUSY → checkout is 409 RestaurantBusy, the cart is kept and no order is created → reopened, and the main flow continues.

Testing performed

  • npm run verify (lint, all workspace tests, build) passes.
  • Unit tests: BUSY / CLOSED / SUSPENDED each return the right code and create nothing; a photo is stored on add and refreshed at validation.
  • npm run openapi:validate passes.

Breaking changes

POST /orders for a restaurant that isn't OPEN is now 409 instead of 400. The customer app handles both codes in its matching PR.

Documentation changes

See above.

Checklist

  • Tests and build pass locally
  • No secrets or generated artifacts are included
  • API and event contract changes are documented
  • Security and authorization impact was considered (none: read-only status check)
  • Docker or configuration changes were validated (none)

Generated by Claude Code

…art items carry the photo

Owner decision: a BUSY restaurant takes no new orders. Checkout answers 409 RestaurantBusy (try again in a few minutes) or 409 RestaurantClosed with details.restaurantStatus, creating nothing and keeping the cart. Cart items now carry the menu item's imageUrl, refreshed silently at validation. Business rule, service docs, OpenAPI, current state and an E2E check updated.
@Yousefa7medmaher
Yousefa7medmaher requested a review from a team as a code owner November 8, 2026 01:12
@Yousefa7medmaher
Yousefa7medmaher merged commit 8af2646 into dev Nov 8, 2026
23 checks passed
@Yousefa7medmaher
Yousefa7medmaher deleted the feat/restaurant-busy-checkout branch November 8, 2026 01:25
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.

Checkout: busy and closed restaurants return clear 409s; cart items carry the photo

1 participant