Event Participation Service
Component Detail
Description
Business logic layer handling participant registration and cancellation for events. Executes POST /api/v1/events/{id}/participants for sign-up and DELETE /api/v1/events/{id}/participants/{userId} for cancellation, routing mutations through the Drift outbox when the device is offline. Validates coordinator JWT org scope before accepting proxy sign-up or cancellation requests with an explicit user_id parameter.
event-participation-service
Sources & reasoning
Encapsulates all participant mutation logic including offline outbox queuing and coordinator proxy validation. Isolating this in a service layer keeps optimistic mutation rollback and org-scope enforcement testable independently of the UI widget.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Post self sign-up to REST API with offline outbox fallback
- Execute cancellation via DELETE endpoint with same optimistic pattern
- Handle coordinator proxy operations by sending explicit user_id and validating org scope
- Surface server-side unique constraint violations as user-facing duplicate sign-up errors
- Update local event_participants table on successful sync resolution
Interfaces
signUp(eventId: String) -> Future<ParticipantRecord>
cancelSignUp(eventId: String) -> Future<void>
proxySignUp(eventId: String, targetUserId: String) -> Future<ParticipantRecord>
proxyCancel(eventId: String, targetUserId: String) -> Future<void>
fetchParticipants(eventId: String) -> Future<List<ParticipantRecord>>
Relationships
Related Data Entities (2)
Data entities managed by this component