users
Component Detail
Data Layer
low complexity
Shared Component
backend
0
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Relational table storing user account records including profile fields, invitation status, activation status flag, and organization membership. Deactivation sets a status flag rather than deleting rows, preserving historical activity data and the audit trail.
users
Sources & reasoning
The users table is the foundational data store for this feature, holding all user records with soft-delete semantics. It is also shared with profile-management and authentication features, making it a genuine cross-feature shared data component.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Persist user identity and profile fields (name, email, status)
- Track invitation state (pending, accepted) via status field
- Support soft-deactivation via status flag without row deletion
- Serve as the foreign-key anchor for user_organization_roles and sessions
Interfaces
findByOrg(orgId: string): User[]
findById(userId: string): User | null
findByEmail(email: string): User | null
create(data: NewUser): User
update(userId: string, patch: Partial<User>): User
setStatus(userId: string, status: UserStatus): void