User
Represents a user account in the system. This is the central entity that uniquely identifies every person who has access to the application. It stores basic identity information like username and email, along with language and timezone preferences. Sensitive information like passwords are stored separately in UserAuthentication for security reasons. Each user can have multiple active sessions, multiple two-factor authentication methods, and can create API keys for programmatic access. The user entity tracks the lifecycle of an account from registration through activation, suspension, and eventual deletion. It's the main reference point for all user-related operations in the system.
Properties
| Property | Type | Mode | Description | Required |
|---|---|---|---|---|
| userId | uuid | stored | Unique universal identifier for the user | Required |
| username | string | stored | Unique username for login, cannot be changed once set Example: | Required |
| string | stored | Primary email address used for account recovery and notifications Example: | Required | |
| emailVerified | boolean | stored | Whether the email address has been verified through confirmation link | Optional |
| emailVerifiedAt | DateTime | stored | Timestamp when the email was verified | Optional |
| person | Person | stored | Reference to personal information (name, date of birth, address, etc.) | Optional |
| status | string | enum | Current status of the user account Values: Example: | Optional |
| statusReason | string | stored | Human-readable explanation for the current status | Optional |
| statusChangedAt | DateTime | stored | When the status was last changed | Optional |
| locale | string | stored | User's preferred language and region for UI display Example: | Optional |
| timezone | string | stored | User's timezone for displaying dates and scheduling Example: | Optional |
| registeredAt | DateTime | stored | When the user first signed up | Required |
| registrationSource | string | enum | How the user account was created Values: Example: | Optional |
| registrationIp | string | stored | IP address used during registration for security tracking | Optional |
| activatedAt | DateTime | stored | When the account was activated and became usable | Optional |
| deactivatedAt | DateTime | stored | When the account was deactivated | Optional |
| deletedAt | DateTime | stored | Soft delete timestamp - account is hidden but not removed from database | Optional |
| version | integer | stored | Version number to prevent concurrent update conflicts | Optional |
| createdAt | DateTime | stored | When this record was created in the database | Required |
| updatedAt | DateTime | stored | When this record was last modified | Optional |
Examples
Example 1
{
"@type": "User",
"userId": "550e8400-e29b-41d4-a716-446655440000",
"username": "sarah.johnson",
"email": "sarah.johnson@techcorp.com",
"emailVerified": true,
"emailVerifiedAt": "2024-01-15T10:30:00Z",
"status": "active",
"statusReason": null,
"locale": "en-US",
"timezone": "America/Los_Angeles",
"registeredAt": "2024-01-15T09:00:00Z",
"registrationSource": "web",
"registrationIp": "192.168.1.100",
"activatedAt": "2024-01-15T10:30:00Z"
}Example 2
{
"@type": "User",
"userId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"username": "admin.system",
"email": "admin@company.com",
"emailVerified": true,
"emailVerifiedAt": "2023-06-01T08:00:00Z",
"status": "locked",
"statusReason": "Too many failed login attempts from unknown location",
"statusChangedAt": "2024-03-15T14:22:00Z",
"locale": "en-GB",
"timezone": "Europe/London",
"registeredAt": "2023-06-01T08:00:00Z",
"registrationSource": "admin",
"registrationIp": "10.0.0.50",
"activatedAt": "2023-06-01T08:00:00Z"
}