ores.iam.tenant

Table of Contents

Core entity for multi-tenancy support. Each tenant represents an isolated organisation with its own users, roles, and data. The system tenant (UUID all zeros) is a special tenant used for shared reference data and system administration.

Tenants are identified by:

Flags

Primary key

UUID uniquely identifying this tenant.

The system tenant has UUID 00000000-0000-0000-0000-000000000000. In SQL, tenant_id = id for tenant records.

Natural keys

code

Unique code for stable referencing.

Examples: 'system', 'acme', 'demo'.

std::string(faker::word::noun()) + "_tenant"

Columns

name

Human-readable display name for the tenant.

std::string(faker::company::name())

type

Tenant type classification (FK to tenant_types).

"organisation"

description

Detailed description of the tenant.

std::string(faker::lorem::sentence())

hostname

Unique hostname for tenant routing.

std::string(faker::word::noun()) + ".example.com"

status

Tenant lifecycle status (FK to tenant_statuses).

"active"

SQL

Flags

C++

Flags

Repository

Domain includes

#include <chrono>
#include <string>
#include <optional>
#include <boost/uuid/uuid.hpp>

Entity includes

#include <string>
#include "sqlgen/Timestamp.hpp"
#include "sqlgen/PrimaryKey.hpp"

Conventions

Table display

column header
code Code
name Name
type Type
hostname Hostname
status Status
modified_by Modified By
version Version

Qt

Detail fields

field label widget type is_key is_required placeholder
code Code codeEdit line_edit true true Enter tenant code
name Name nameEdit line_edit   true Enter display name
type Type typeEdit line_edit     Enter tenant type
hostname Hostname hostnameEdit line_edit     Enter hostname
status Status statusEdit line_edit     Enter status

Columns (Qt model)

enum_name field header type width
Code code Code string 120
Name name Name string 200
Type type Type string 100
Hostname hostname Hostname string 180
Status status Status string 100
Version version Version int 80
ModifiedBy modified_by Modified By string 120
RecordedAt recorded_at Recorded At timestamp 150

Custom repository methods

See also

  • ores.iam — component group overview.

Emacs 29.1 (Org mode 9.6.6)