Skip to content

feat(events): RSVP enrollment end-to-end #240

@danielhe4rt

Description

@danielhe4rt

Parent

#237

What to build

Implement the RSVP enrollment flow end-to-end: participant clicks "Confirm presence" → system creates enrollment with status confirmed → transition is recorded in audit trail → participant sees their enrollment in the App panel.

Action: EnrollUserAction

  • Accepts event + user + enrollment method context
  • For rsvp and rsvp_checkin methods: creates enrollment with status confirmed (capacity validation comes in the next slice)
  • Wraps in DB::transaction
  • Records transition in events_enrollment_transitions (from_status=null, to_status=confirmed, triggered_by=user)
  • Returns the created enrollment

Domain event (fire-and-forget, for future listeners):

  • Dispatches EnrollmentConfirmed implementing ShouldDispatchAfterCommit
  • Payload: enrollment_id, event_id, user_id, xp_reward_rsvp (from policy)
  • No listener in this slice — just the event dispatch

App panel (participant view):

  • "My Events" page listing user's enrollments with status badges
  • Event detail page with "Confirm Presence" button (visible when enrollment_method is rsvp or rsvp_checkin and user is not yet enrolled)
  • Button dispatches EnrollUserAction

Admin panel (organizer view):

  • Enrollments RelationManager on Event resource showing all enrollments with status, enrolled_at
  • Read-only for now (management actions come in later slices)

Validation rules:

  • User cannot enroll twice in same event (UNIQUE constraint)
  • Event must be active and not past (starts_at > now())
  • Enrollment method must be rsvp or rsvp_checkin (application flow is a separate slice)

Acceptance criteria

  • Participant can RSVP to an event from the App panel
  • Enrollment is created with status confirmed and enrolled_at timestamp
  • Transition record is written to events_enrollment_transitions
  • EnrollmentConfirmed domain event is dispatched after transaction commit
  • Duplicate enrollment attempt returns appropriate error (409 or validation error)
  • Enrolling in a past event is rejected
  • Admin panel shows enrollments per event
  • Participant sees their enrollments in "My Events" page
  • Feature tests cover: successful enrollment, duplicate prevention, past event rejection
  • Pint passes

Blocked by

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions