aeat.domain.fincas._errors module¶
Domain errors for the rental register.
Every subclass is registered in aeat.core.errors._registry._DECLARED_ERROR_CODES
so the __init_subclass__ hook on core.errors.AeatError
can bind a stable core.errors.ErrorCode.
- exception FincaRegisterError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorBase error for the rental-register subpackage.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception FincaNotFoundError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
FincaRegisterErrorRaised when a referenced finca id is not present in the register.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception ContractNotFoundError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
FincaRegisterErrorRaised when a referenced rental contract id is not present in the register.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception TierResolutionError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
FincaRegisterErrorRaised when contract metadata is inconsistent and a tier cannot be resolved.
Examples:
tenant_min_age > tenant_max_age,qualifying_co_tenant_count > tenant_count(also enforced at DB level), or a tier-90-a candidate with no prior-contract data.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception AmortizationLedgerCapExceededError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
FincaRegisterErrorRaised in strict mode when cumulative amortización would exceed the cap.
Default
compute_amortization_for_yearclamps to the remaining cap and never raises. Strict callers (e.g. preflight verifiers that want to flag the surface) opt in viastrict=True.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception FincaAggregationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
FincaRegisterErrorRaised when the rental register cannot produce coherent aggregates.
Surface causes: contract referencing a non-existent finca; income record without a contract; ledger entry whose
cumulative_amortization_through_yearis out of order with surrounding entries (re-stated mid-year accrual without a prior recompute).- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception FincaValidationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
FincaRegisterError,ValueErrorRaised when rental records violate state or shape invariants.
Inherits from ValueError to maintain compatibility with Pydantic validators.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶