EventService
Component Detail
Description
Business-logic layer responsible for orchestrating event creation, applying validation rules, and coordinating persistence via EventRepository. It enforces role-based access so only peer mentors and coordinators can create events. The service also queues creation requests for offline support when network connectivity is unavailable.
event-service
Sources & reasoning
The source doc explicitly names an Event wizard in the core mobile navigation (lines 289-296) as part of the Add modal launcher, placing it alongside activity registration in the baseline app shell. The blueprint assigns [MVP] to Event Creation. The navigation description treats events as a first-class creation surface from launch, confirming MVP target.
-
docs/source/likeperson.md ยท line 289-296Bottom nav with 5 tabs: Home, Contacts, Add (modal launcher for Activity and Event wizards), Work, Notifications โฆ Event wizard (multi-step: title โ date โ time โ duration โ location โ summary)
Responsibilities
- Validate complete event payloads against business rules before persistence
- Enforce role-based access control, rejecting requests from unauthorised roles
- Delegate persistence to EventRepository and return the saved event or structured errors
- Enqueue event creation operations in the offline sync queue when the device is offline
- Emit domain events or notifications upon successful event creation
Interfaces
createEvent(payload: CreateEventPayload, userId: string): Promise<Event>
validateEventPayload(payload: CreateEventPayload): ValidationResult
canCreateEvent(userRole: UserRole): boolean
queueOfflineCreate(payload: CreateEventPayload): void
Related Data Entities (2)
Data entities managed by this component