HTTP routes and handlers for tenant management.
Provides REST API endpoints for:
All routes require admin authentication (to be integrated with auth system).
HTTP routes and handlers for tenant management. Provides REST API endpoints for: - Tenant CRUD operations (list, get, create, update, delete) - Tenant provisioning (schema creation, data seeding) - Tenant activation/suspension All routes require admin authentication (to be integrated with auth system).
(activate-tenant-handler tenant-service)Activate suspended tenant.
Activate suspended tenant.
(create-tenant-handler tenant-service)Create new tenant.
Request body:
Create new tenant. Request body: - name: Tenant display name (required) - slug: Tenant slug for URLs (required, unique) - status: Initial status (:active or :suspended, default :active)
(delete-tenant-handler tenant-service)Delete tenant (soft delete).
This marks the tenant as deleted but preserves data for audit purposes.
Delete tenant (soft delete). This marks the tenant as deleted but preserves data for audit purposes.
(get-tenant-handler tenant-service)Get tenant by ID.
Get tenant by ID.
(list-tenants-handler tenant-service)List all tenants with optional filtering and pagination.
Query params:
List all tenants with optional filtering and pagination. Query params: - limit: Number of results (default 20, max 100) - offset: Pagination offset (default 0) - status: Filter by status (:active, :suspended) - search: Search by name or slug
(provision-tenant-handler tenant-service db-context)Provision tenant database schema and initial data.
This creates:
Note: Only works with PostgreSQL multi-tenant setup. Provisioning is idempotent - safe to call multiple times.
Provision tenant database schema and initial data. This creates: - PostgreSQL schema for tenant - Initial database tables (copies structure from public schema) Note: Only works with PostgreSQL multi-tenant setup. Provisioning is idempotent - safe to call multiple times.
(suspend-tenant-handler tenant-service)Suspend tenant (prevents login and access).
Suspend tenant (prevents login and access).
(tenant-routes-normalized tenant-service db-context _config)Create tenant management routes in normalized format for composition.
Args: tenant-service: ITenantService implementation db-context: Database context (required for provisioning) config: Configuration map (reserved for future use)
Returns: Map with :api key containing route definitions
Route structure: {:api [...]} ; API routes under /api/v1/tenants
All routes require admin authentication (to be integrated).
Create tenant management routes in normalized format for composition.
Args:
tenant-service: ITenantService implementation
db-context: Database context (required for provisioning)
config: Configuration map (reserved for future use)
Returns:
Map with :api key containing route definitions
Route structure:
{:api [...]} ; API routes under /api/v1/tenants
All routes require admin authentication (to be integrated).(update-tenant-handler tenant-service)Update existing tenant.
Request body:
Update existing tenant. Request body: - name: New display name (optional) - slug: New slug (optional, must be unique) - status: New status (optional)
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |