Skip to content

created api for bookings - #3

Merged
prepwave merged 1 commit into
mainfrom
development
Jul 18, 2026
Merged

created api for bookings#3
prepwave merged 1 commit into
mainfrom
development

Conversation

@prepwave

@prepwave prepwave commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added booking creation with restaurant validation, duplicate booking prevention, and pending status.
    • Added authenticated endpoints for viewing personal bookings and canceling bookings.
    • Added booking routes to the server API.

@prepwave
prepwave merged commit 4d1aea1 into main Jul 18, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ad87b39-316a-452b-a434-99d1cceb7577

📥 Commits

Reviewing files that changed from the base of the PR and between d9fe2f4 and 4906fd2.

📒 Files selected for processing (3)
  • server/controllers/bookingController.ts
  • server/routes/booking.routes.ts
  • server/server.ts

📝 Walkthrough

Walkthrough

Adds an authenticated booking API with duplicate prevention and restaurant validation for booking creation. It also registers placeholder handlers for retrieving and canceling bookings, wires their routes, and mounts the router under /api/bookings.

Changes

Booking API

Layer / File(s) Summary
Booking creation controller
server/controllers/bookingController.ts
Validates the authenticated user and restaurant, prevents duplicate pending or confirmed bookings, creates pending bookings, populates restaurant data, and returns HTTP responses.
Authenticated booking routes
server/controllers/bookingController.ts, server/routes/booking.routes.ts
Adds authenticated create, current-user booking, and cancellation routes; retrieval and cancellation controllers remain stubs.
Server route mounting
server/server.ts
Mounts the booking router at /api/bookings.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant bookingRouter
  participant protect
  participant createBooking
  participant Booking
  Client->>bookingRouter: POST /api/bookings
  bookingRouter->>protect: Authenticate request
  protect->>createBooking: Pass authenticated user
  createBooking->>Booking: Validate and create pending booking
  Booking-->>createBooking: Return populated booking
  createBooking-->>Client: Return 201 response
Loading

Possibly related PRs

  • prepwave/QuickDine#2: Adds restaurant endpoints that query the same booking model and status values used by this booking flow.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch development

Comment @coderabbitai help to get the list of available commands.

This was referenced Jul 20, 2026
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