aeat.application.user_profile._validation module¶
Schema-driven validation service for user-profile lifecycle commands.
ProfileValidationService validates a UserProfileRecord
against a loaded schema definition and returns structured
ProfileValidationIssue entries for every constraint violation.
- class ProfileValidationService(*, schema)[source]¶
Bases:
objectValidate a profile record against a loaded schema.
Stateless. Constructed with a loaded
ProfileSchemaDefinitionso the same instance can validate many records or commands.- Parameters:
schema (ProfileSchemaDefinition)
- property schema: ProfileSchemaDefinition¶
- validate_record(record)[source]¶
Validate every fact on a profile against the schema.
- Parameters:
record (
UserProfileRecord) – TheUserProfileRecordwhose facts are validated.- Return type:
Returns a
ProfileValidationReport.
- validate_facts(profile_id, facts)[source]¶
Validate a free-standing collection of facts.
Returns a
ProfileValidationReport.- Return type:
- Parameters:
profile_id (str)
facts (Iterable[UserProfileFact])