Contact Notes Repository
Component Detail
Data Layer
medium complexity
mobilebackend
0
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Data access layer for creating, reading, updating, and deleting contact notes, backed by Supabase with RLS policies restricting note visibility to authorised roles within the same organisation. Caches recent notes locally for offline resilience and synchronises on reconnect.
contact-notes-repository
Responsibilities
- CRUD operations on contact_notes table via Supabase
- Apply RLS-compliant queries scoped to organisation
- Cache notes locally in SQLite for offline access
- Sync pending local changes on reconnect
Interfaces
getNotes(contactId: String)
createNote(contactId: String, authorId: String, body: String)
updateNote(noteId: String, body: String)
deleteNote(noteId: String)
syncPendingNotes()
getCachedNotes(contactId: String)
Related Data Entities (2)
Data entities managed by this component