Skip to content

Comments

feat: implement ticket booking flow API#116

Open
tusharshah21 wants to merge 1 commit intoGatheraa:mainfrom
tusharshah21:feat/ticket-booking-flow-api
Open

feat: implement ticket booking flow API#116
tusharshah21 wants to merge 1 commit intoGatheraa:mainfrom
tusharshah21:feat/ticket-booking-flow-api

Conversation

@tusharshah21
Copy link

Summary

Implements the complete ticket booking flow API (closes #28) — cart management, seat selection with optimistic locking, dynamic pricing, reservation timeout, booking confirmation/cancellation, and promo code application.

Changes

  • Add Seat, Booking, BookingItem entities with @VersionColumn for optimistic locking
  • Add CartService — Redis-backed cart with 15-minute TTL
  • Add SeatService — availability queries, reservation, inventory management (mark available/unavailable)
  • Add PricingService — dynamic pricing with promo code support via existing CouponService
  • Add BookingService — saga-pattern flow (reserve → price → persist → clear cart), confirmation, cancellation, @Cron reservation expiry
  • Add BookingController — 16 REST endpoints under /booking
  • Register BookingModule in AppModule

Endpoints

Method Path Purpose
POST /booking/cart Add seats to cart
GET /booking/cart/:eventId View cart
DELETE /booking/cart Remove seats from cart
DELETE /booking/cart/:eventId Clear cart
POST /booking/seats Create seats (organizer/admin)
GET /booking/seats Query seats
GET /booking/seats/availability/:eventId Availability summary
POST /booking/seats/unavailable Mark seats unavailable
POST /booking/seats/available Mark seats available
POST /booking/price Calculate price
POST /booking Create booking
POST /booking/confirm Confirm booking
POST /booking/cancel Cancel booking
POST /booking/promo Apply promo code
GET /booking/:id Get booking
GET /booking Get user's bookings

Scope

  • No existing modules, entities, or services were modified.
  • No new npm dependencies — all packages already in package.json.
  • All changes are directly traceable to issue Implement Ticket Booking Flow API #28 requirements.

Verification

  • 9 files changed, 1439 insertions, 1 deletion
  • Follows existing code patterns (guards, decorators, TypeORM, Redis)
  • All acceptance criteria covered: cart ✓ seats ✓ pricing ✓ reservations expiring ✓ cancellations ✓

@tusharshah21 tusharshah21 changed the title feat: implement ticket booking flow API (#28) feat: implement ticket booking flow API Feb 24, 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.

Implement Ticket Booking Flow API

1 participant