Data Layer medium complexity mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations

Description

Data-access layer that handles reading and writing event records to both the local SQLite store and the remote backend API. It abstracts storage details from the service layer and manages synchronisation state for records created while offline. The repository exposes a consistent async interface regardless of whether the operation targets local or remote storage.

Feature: Event Creation

event-repository

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-296
    Bottom 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

  • Persist new event records to the remote API and local cache
  • Store offline-created events locally and mark them as pending sync
  • Retrieve events by ID, owner, or date range from local or remote sources
  • Handle conflict resolution when offline records are synced to the server
  • Expose CRUD operations typed against the Event entity schema

Interfaces

save(event: EventDraft): Promise<Event>
findById(eventId: string): Promise<Event | null>
findByOwner(userId: string): Promise<Event[]>
findByDateRange(from: Date, to: Date): Promise<Event[]>
syncPending(): Promise<SyncResult>

Related Data Entities (1)

Data entities managed by this component