Users Table
Component Detail
Data Layer
medium complexity
Shared Component
backendmobile
0
Dependencies
4
Dependents
0
Entities
0
Integrations
Description
Canonical PostgreSQL table storing all user account data: personal fields, language preference, photo URL, and organization memberships. Mirrored in the mobile app's Drift local database for offline-first access. Authoritative source for profile data updated via PATCH /api/v1/users/{id} and reconciled through the mutation outbox on reconnect.
users-table
Responsibilities
- Store and retrieve core user identity fields (name, email, phone, language, photo_url, created_at, updated_at)
- Support partial PATCH-based updates for incremental profile edits
- Provide local Drift mirror for offline read access and optimistic writes
- Link users to organization_memberships rows for multi-organization context display
Interfaces
findById(id: String): Future<User>
update(id: String, patch: Map<String, dynamic>): Future<User>
watchById(id: String): Stream<User>
findByOrganization(orgId: String): Future<List<User>>
upsertLocal(user: User): Future<void>
Relationships
Dependents (4)
Components that depend on this component