EventRegistrationRepository
Component Detail
Description
Manages persistence and retrieval of event registration records in both local storage and the remote backend. Provides the offline-first data layer that buffers mutations when the device has no connectivity. Ensures consistency between local optimistic state and server-confirmed registration records.
event-registration-repository
Sources & reasoning
The source doc highlights follow-up and participation tracking as a pain point (line 116, HLF survey finding). Event sign-up is the mobile mechanism that enables structured participation records without manual coordinator effort. The blueprint assigns [v1.0], consistent with the Phase 2 roadmap scope (Fase 2: Bufdir-rapportering, oppfølging); it extends the MVP event creation and listing foundation rather than replacing it.
-
docs/source/likeperson.md · line 116Oppfølging av likepersoner: 40 % var ikke fornøyd med oppfølgingen i spørreundersøkelse. Scenariobaserte push-meldinger og kalendersynkronisering.
Responsibilities
- Store and retrieve registration records from local SQLite or equivalent mobile store
- Sync confirmed registration state from the backend REST API
- Expose CRUD operations for registration entities with conflict resolution logic
- Maintain an offline mutation queue for registrations pending network availability
- Return current registration status for a given event and user pair
Interfaces
create(registration: EventRegistration): Promise<EventRegistration>
delete(eventId: string, userId: string): Promise<void>
findByEventAndUser(eventId: string, userId: string): Promise<EventRegistration | null>
findAllByEvent(eventId: string): Promise<EventRegistration[]>
queueOfflineMutation(mutation: RegistrationMutation): Promise<void>
flushOfflineQueue(): Promise<FlushResult>
Related Data Entities (2)
Data entities managed by this component