from dataclasses import dataclass, field from uuid import UUID from account.constants.tenants import TenantType @dataclass class Tenant: tenant_uuid: UUID tenant_type: TenantType tenant_hierarchy: list[str] = field(default_factory=lambda: []) def __post_init__(self): """Validate types.""" assert UUID(self.tenant_uuid) assert TenantType(self.tenant_type) @dataclass class Attributes: tenant: Tenant name: str | None @dataclass class DistributorAttributes(Attributes): is_distributor: bool