Skip to content

[B2C][WAITLIST] Slot assignment runs outside the checkout transaction; partial multi-session enrollment on mid-loop failure #834

Description

@teetangh

Problem

lib/waitlist/slot-handler.ts assigns freed slots outside the booking tx, and multi-session class enrollment can fail mid-loop leaving partial enrollment. No unique constraint on the SlotOfAppointment↔User m:n protects against double-assignment.

Fix shape

Move assignment into the same tx as the slot release (or CAS-claim per slot); add the missing unique constraint at the pre-MVP schema reset; make multi-session enrollment all-or-nothing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bookingBooking, scheduling, slots, reschedule, cancellationfinancePayments, refunds, earnings, payouts, invoicing, ledgerlaunch: pre-mvpGates launch — money, data, or a failure we would not detect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions