aeat.domain.modelos._calculation_repository module

Domain-side calculation-revision catalogue port surface.

This module owns the pure calculation-revision catalogue vocabulary: the CalculationRevisionPersistenceError raised at the storage boundary, the upsert_calculation_revision() pure mutator, and the namespace / schema-version constants that name the persisted envelope contract. The concrete encrypted SQL repository lives in the persistence adapter CalculationRevisionCatalogueRepository, behind the read-side CalculationRevisionCatalogueRepositoryProtocol; the domain package depends only on the structural port.

exception CalculationRevisionPersistenceError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: ModeloError

Raised when the calculation-revision catalogue cannot be persisted or loaded.

This wraps storage-boundary failures from the persistence adapter’s CalculationRevisionCatalogueRepository while preserving translated recovery context for callers.

Parameters:
  • message (str | None)

  • context (dict[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
upsert_calculation_revision(catalogue, revision)[source]

Return a new CalculationRevisionCatalogue with revision inserted or replaced.

Parameters:
Return type:

CalculationRevisionCatalogue