Service Layer low complexity mobile
1
Dependencies
1
Dependents
0
Entities
0
Integrations

Description

Riverpod provider scoped to workshop_id that manages note creation, retrieval, and auto-save debounce logic for workshop notes. Debounces writes on 1.5 s of inactivity before persisting to the local Drift database, after which the mutation outbox handles server synchronisation. Exposes a stream of notes for the active workshop to the UI layer.

Feature: Workshop Notes

workshop-notes-service

Sources & reasoning

Auto-save with 1.5 s debounce and scoped Riverpod state management requires a dedicated service layer distinct from the UI. The implementation notes explicitly describe debounce-then-Drift-then-outbox sequencing, which warrants isolating this orchestration logic from the screen component.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Provide a scoped Riverpod state provider for the current workshop's notes
  • Debounce auto-save on 1.5 s inactivity and write draft to local Drift store
  • Expose CRUD operations for workshop notes (create, read, update, delete)
  • Coordinate with the mutation outbox for server sync after local persistence

Interfaces

watchNotes(workshopId: String) → Stream<List<WorkshopNote>>
saveNote(workshopId: String, content: String) → Future<void>
deleteNote(noteId: String) → Future<void>
triggerAutoSave(content: String) → void

Relationships

Dependencies (1)

Components this component depends on

Dependents (1)

Components that depend on this component