Source code for src.module.tenant.domain.value_objects
"""Tenant Context value objects."""
from __future__ import annotations
from dataclasses import dataclass
from uuid import UUID
[docs]
@dataclass(frozen=True, slots=True)
class TenantContext:
"""Immutable snapshot of the current tenant context for a request."""
tenant_id: UUID
tenant_slug: str
schema_name: str
status: str
[docs]
@dataclass(frozen=True, slots=True)
class MembershipInfo:
"""Immutable snapshot of a user's membership in a tenant."""
membership_id: UUID
user_id: UUID
tenant_id: UUID
roles: list[str]
abac_attributes: dict[str, object]
status: str