User
Source: src/data/user/
Service
The user service is a stub (export {}). Not yet implemented.
Repository
UserRepository
| Method | Parameters | Returns |
|---|---|---|
| getById | (ctx: RequestContext, id: string) | Promise<UserRecord | null> |
| listByTenant | (ctx: RequestContext) | Promise<UserRecord[]> |
| create | (ctx: RequestContext, record: UserRecord) | Promise<void> |
| update | (ctx: RequestContext, id: string, patch: Partial<Omit<UserRecord, 'id' | 'tenantId'>>) | Promise<UserRecord> |
| delete | (ctx: RequestContext, id: string) | Promise<void> |
UserRecord
| Field | Type |
|---|---|
| id | string |
| tenantId | string |
| createdAt | Date |
| updatedAt | Date |
| data | Record<string, unknown> (optional) |
Validators
userSchema
| Field | Type | Required | Default |
|---|---|---|---|
| tenantId | string | Yes | — |
| username | string | Yes | — |
| displayName | string | Yes | — |
string (email) | No | — | |
| avatarUrl | string (URL) | No | — |
| discordId | string | No | — |
| roles | string[] | No | [] |
| isAdmin | boolean | No | false |
| customerId | string | No | — |
| primaryCustomerId | string | No | — |
| createdAt | Date (coerced) | Yes | — |
| updatedAt | Date (coerced) | Yes | — |
discordIdis a deprecated field kept for migration compatibility.
Inferred Types
User—z.infer<typeof userSchema>