Source code for aeat.domain.fincas._source_readiness
"""Fincas calculation-source readiness.Declares whether the fincas domain may act as a calculation source that feedsregistry bindings. The fincas rendimiento and amortization aggregates are computedin-domain (:mod:`~domain.fincas`), but they are not yet persisted through thecanonical secure-storage revision boundary, so enrolling fincas as a livecalculation source would resolve bindings against non-canonical state. Until thatpersistence is hardened, fincas readiness is NOT ready and the aggregation resolvermust refuse visibly (a blocked-readiness diagnostic) rather than resolve a silentblank.The readiness is deliberately a pure, context-independent domain fact: fincas isunready regardless of the modelo or period being calculated.See Also: :mod:`~domain.fincas` Public domain facade for the finca aggregates that are not yet canonical calculation-source state. :mod:`~application.aggregation._source_fincas` Blocked resolver adapter that turns this readiness fact into a source-mesh diagnostic. :class:`~application.aggregation.CalculationSourceDiagnostic` Shared diagnostic carrier emitted while the source remains blocked."""from__future__importannotationsfrompydanticimportBaseModel,Fieldfrom...coreimportSTRICT_FROZEN_CONFIGFINCAS_SOURCE_KIND="fincas"
[docs]classFincasSourceReadiness(BaseModel):"""Whether the fincas domain is ready to act as a calculation source."""model_config=STRICT_FROZEN_CONFIGready:boolsource_kind:str=Field(min_length=1,max_length=64)reason:str=Field(min_length=1,max_length=512)
[docs]deffincas_source_readiness()->FincasSourceReadiness:"""Return the current fincas calculation-source readiness. Fincas is not yet a calculation source: its rendimiento and amortization aggregates are not persisted through the canonical secure-storage revision boundary, so a resolver enrolled today would read non-canonical state. The surface is provisioned but blocked until fincas persistence is hardened. Returns: A :class:`~domain.fincas.FincasSourceReadiness` with ``ready = False`` and the blocking reason, until fincas persistence is canonical. """returnFincasSourceReadiness(ready=False,source_kind=FINCAS_SOURCE_KIND,reason=("fincas is not yet a calculation source: its rendimiento and ""amortization aggregates are not persisted through the canonical ""secure-storage revision boundary"),)