Add lesson booking registration flow (offering, questions, policies) #20
Reference in New Issue
Block a user
Delete Branch "feature/registration-flow"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #3 (Lesson booking) — the registration flow tying offerings, intake questions, and booking-scoped policy acceptance together. (Group classes #4 follow as the next PR, reusing the gate.)
Backend
us_lessons+=offering_id,recurrence,series_id,payment_id.Lesson: new fields +RECURRENCE_SINGLE/WEEKLY.BookingRepository::insertSeries()builds a weekly series sharing aseries_id;AvailabilityRepository::findUnbookedInGroup()reserves the recurring group.RegistrationGate(src/Registration/):validate()+record()for required intake answers and booking-scoped policy acceptances — shared with group enrolment (#4).BookingEndpoint::book(): acceptsoffering_id,recurrence,answers,accepted_policy_version_ids; books a single lesson or a weekly series; records answers + acceptances (typelesson).GET /policies?scope=bookingfilter.Front end
booking.js: slot → load offering questions + booking policies → form (questions, required policy checkboxes, optional weekly) →POST /bookings.Payment seam
Payment is deferred to #7. A booking lands
status = pending,payment_id = null; the instructor confirms viaPATCH /bookings/{id}/status. The pay→confirm + receipt step plugs into this seam later.Tests
Lesson,BookingRepository(incl. weekly series), andRegistrationGate(validate/record).WP_Errorstub added totests/bootstrap.php(the gate returnsWP_Error).composer test(110 tests),composer cs, PHPStan level 6, and no-debug all pass.Refs #3
🤖 Generated with Claude Code