Event Repository
Component Detail
Data Layer
medium complexity
mobilebackend
0
Dependencies
0
Dependents
4
Entities
0
Integrations
Description
Data access layer for events and event participants, providing CRUD operations and query methods backed by Supabase with RLS policies enforcing organization-scoped access. Exposes a real-time subscription stream for the event_participants table.
event-repository
Responsibilities
- Persist and retrieve events with organization-scoped RLS
- Manage event_participants join table entries
- Provide debounced contact search for participant selection
- Expose real-time Supabase stream for participant updates
Interfaces
createEvent(event)
getEventById(eventId)
updateEvent(eventId, fields)
deleteEvent(eventId)
listEventsByOrganization(orgId)
addParticipant(eventId, userId)
removeParticipant(eventId, userId)
getParticipants(eventId)
searchContacts(query, orgId)
watchEventParticipants(eventId)
getEventCountsByPeriod(orgId, startDate, endDate)
Related Data Entities (4)
Data entities managed by this component