aeat.domain.user_profile._schema module¶
Strict Pydantic records for the centralized user-profile schema.
Each schema section declares a SensitivityClass that governs
the encryption tier applied when the section’s data is persisted to the
secure DB backend.
- class ProfileFieldType(*values)[source]¶
Bases:
StrEnumClosed catalogue of field types allowed by the profile schema TOML.
- STRING¶
- BOOLEAN¶
- INTEGER¶
- DECIMAL¶
- MONEY¶
- DATE¶
- EMAIL¶
- ENUM¶
- ARRAY¶
- OBJECT¶
- class ProfileSnapshotPolicy(*values)[source]¶
Bases:
StrEnumAccepted profile snapshot stale-check policies.
- IMMUTABLE_SECURE_SNAPSHOT_HASH¶
- class ProfileRemovePolicy(*values)[source]¶
Bases:
StrEnumAccepted profile removal policies.
- LIVE_PROFILE_TOMBSTONE_RETAIN_SNAPSHOTS¶
- class ProfileFieldDefinition(**data)[source]¶
Bases:
BaseModelOne field declared inside a user-profile schema section.
- Parameters:
key (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=64, pattern=^[a-z][a-z0-9_]*$, ascii_only=None)])
type (ProfileFieldType)
required (bool)
nullable (bool)
sensitivity (SensitivityClass)
effective_dated (bool)
description (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=512, pattern=None, ascii_only=None)])
model_selectors (tuple[Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=256, pattern=None, ascii_only=None)], ...])
export_headers (tuple[Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=256, pattern=None, ascii_only=None)], ...])
schedule_predicates (tuple[Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=256, pattern=None, ascii_only=None)], ...])
legal_refs (tuple[Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=512, pattern=None, ascii_only=None)], ...])
minimum (Decimal | None)
maximum (Decimal | None)
- key: _FieldKey¶
- type: ProfileFieldType¶
- required: bool¶
- nullable: bool¶
- sensitivity: SensitivityClass¶
- effective_dated: bool¶
- description: _Description¶
- enum_values: tuple[str, ...]¶
- model_selectors: tuple[_Selector, ...]¶
- export_headers: tuple[_Selector, ...]¶
- schedule_predicates: tuple[_Selector, ...]¶
- legal_refs: tuple[_Description, ...]¶
- minimum: Decimal | None¶
- maximum: Decimal | None¶
- class ProfileSectionDefinition(**data)[source]¶
Bases:
BaseModelA top-level section in the user-profile schema.
- Parameters:
key (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=64, pattern=^[a-z][a-z0-9_]*$, ascii_only=None)])
title (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=512, pattern=None, ascii_only=None)])
sensitivity (SensitivityClass)
effective_dated (bool)
repeatable (bool)
fields (tuple[ProfileFieldDefinition, ...])
- key: _SectionKey¶
- title: _Description¶
- sensitivity: SensitivityClass¶
- effective_dated: bool¶
- repeatable: bool¶
- fields: tuple[ProfileFieldDefinition, ...]¶
- class ProfileSchemaDefinition(**data)[source]¶
Bases:
BaseModelThe committed centralized user-profile schema.
- Parameters:
id (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=128, pattern=^[a-z][a-z0-9_.-]*$, ascii_only=None)])
version (int)
title (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=512, pattern=None, ascii_only=None)])
snapshot_policy (ProfileSnapshotPolicy)
remove_policy (ProfileRemovePolicy)
sections (tuple[ProfileSectionDefinition, ...])
- id: _SchemaId¶
- version: int¶
- title: _Description¶
- snapshot_policy: ProfileSnapshotPolicy¶
- remove_policy: ProfileRemovePolicy¶
- sections: tuple[ProfileSectionDefinition, ...]¶
- section(key)[source]¶
Return a
ProfileSectionDefinitionby canonical section key.- Return type:
- Parameters:
key (str)
- field(path)[source]¶
Return a field by canonical dotted path.
- Return type:
- Returns:
The
ProfileFieldDefinitionfor the given path.- Parameters:
path (Annotated[str, StringConstraints(strip_whitespace=True, to_upper=None, to_lower=None, strict=None, min_length=3, max_length=160, pattern=^[a-z][a-z0-9_]*(?:\.[a-z0-9_]+)+$, ascii_only=None)])