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

Description

Local persistence layer for note records on the device. Stores note content, ownership, contact linkage, and timestamps, and exposes CRUD primitives to the services above.

Feature: Notes

note-store

Sources & reasoning

Blueprint explicitly merges notes-list + note-editor into a single 'Notes' feature under the Notes area. Matrix rows in §4 mark notes and basic search across notes as universal needs. Target_release set to 'Core Product' since §4 places Notes in Phase 2 (NICE) and the area is not in the MVP always-on set in §5.

  • | Basic search (contact og notater) | ✓ | ✓ | ✓ | ✓ | ✓ | MUST | 1 | | Notater | ✓ | ✓ | ✓ | ✓ | ✓ | NICE | 2 |
  • | notes | Notes | Notes List, Note Editor |
  • Offline-first persistence (Drift + SQLCipher encrypted local DB, mutation outbox, sync queue with retry/backoff, ID mapping for offline-created entities, conflict resolver)

Responsibilities

  • Persist note records keyed by note id and scoped by user id
  • Maintain created_at and updated_at timestamps on writes
  • Index notes by user id and contact id for efficient lookup
  • Expose CRUD operations to the Note Service and Note Query Service
  • Guarantee per-user isolation so queries never leak across accounts

Interfaces

insert(note: NoteRecord): NoteRecord
update(noteId: string, patch: Partial<NoteRecord>): NoteRecord
delete(noteId: string): void
findById(noteId: string): NoteRecord | null
findByUser(userId: string, filter?: NoteFilter): NoteRecord[]

Related Data Entities (1)

Data entities managed by this component