Tenant
Source: src/data/tenant/
Service
The tenant service is a stub (export {}). Not yet implemented.
Repository
TenantRepository
| Method | Parameters | Returns |
|---|---|---|
| getById | (ctx: RequestContext, id: string) | Promise<TenantRecord | null> |
| listByTenant | (ctx: RequestContext) | Promise<TenantRecord[]> |
| create | (ctx: RequestContext, record: TenantRecord) | Promise<void> |
| update | (ctx: RequestContext, id: string, patch: Partial<Omit<TenantRecord, 'id' | 'tenantId'>>) | Promise<TenantRecord> |
| delete | (ctx: RequestContext, id: string) | Promise<void> |
TenantRecord
| Field | Type |
|---|---|
| id | string |
| tenantId | string |
| createdAt | Date |
| updatedAt | Date |
| data | Record<string, unknown> (optional) |
Validators
tenantSchema
| Field | Type | Required | Default |
|---|---|---|---|
| tenantId | string | Yes | — |
| name | string | Yes | — |
| ownerUserId | string | Yes | — |
| adminUserIds | string[] | No | [] |
| createdAt | Date (coerced) | Yes | — |
| updatedAt | Date (coerced) | Yes | — |
adminUserIdsis deprecated for authorization checks; retained for backward compatibility.
Inferred Types
Tenant—z.infer<typeof tenantSchema>