Workshop Todo Service
Component Detail
Service Layer
low complexity
mobile
1
Dependencies
1
Dependents
1
Entities
0
Integrations
Description
Handles CRUD operations for workshop to-do items, coordinating between the Riverpod provider, the Drift local cache, and the mutation outbox for offline-first writes. Validates that assigned coordinators belong to the same organization before persisting.
workshop-todo-service
Sources & reasoning
Service layer required to separate business logic (assignee validation, optimistic mutation, outbox coordination) from the UI widget and data repository, consistent with the Riverpod provider pattern used throughout the mobile app.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Create to-do items with title, optional description, and optional assignee
- Toggle completion state with optimistic mutation queued to outbox
- Validate assignee is a coordinator within the same organization
- Stream to-do items for a given workshop_id from Drift cache
Interfaces
createTodo(workshopId: String, title: String, description: String?, assignedTo: String?) → Future<void>
toggleComplete(todoId: String, isCompleted: bool) → Future<void>
watchTodos(workshopId: String) → Stream<List<WorkshopTodo>>
deleteTodo(todoId: String) → Future<void>