Service Layer medium complexity mobilebackend
1
Dependencies
1
Dependents
2
Entities
0
Integrations

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.

Feature: Event Sign-up

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

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component

Related Data Entities (2)

Data entities managed by this component