aeat.domain.iva._errors module¶
Domain errors for the aeat.domain.iva subpackage.
Every failure mode raised by the IVA substrate inherits from
IvaError, which in turn inherits from
aeat.core.errors.AeatError. Downstream callers catch the base class
when they want to treat the substrate as an opaque unit, or the specific
subclass when they need to distinguish missing-rate from missing-category or
corpus load failures.
- exception IvaError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorBase error for every
aeat.domain.ivafailure mode.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception IvaRateNotFoundError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
IvaErrorRaised when
aeat.domain.iva.lookup_rate()cannot resolve a rate.The lookup fails either because the requested member state is absent from
aeat.domain.iva.IVA_RATE_TABLE, because no rate of the requestedaeat.domain.iva.IvaRateKindis registered for that member state, or because every registered rate’s effective window excludes the requested date.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception IvaCategoryNotFoundError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
IvaErrorRaised when a lookup against a resolved IVA catalogue misses.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception IvaCatalogueError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
IvaErrorRaised when a IVA catalogue cannot be loaded, resolved, or validated.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception IvaRateOverlapError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
IvaErrorRaised when two
aeat.domain.iva.IvaRateRecordrecords share a window.The substrate enforces that for every
(member_state, kind)partition ofaeat.domain.iva.IVA_RATE_TABLEno two records have overlappingeffective_from/effective_untilranges. Adding a new record that violates this invariant raises this error at module import time so the regression surfaces in CI rather than silently affectingaeat.domain.iva.lookup_rate()results.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception IvaClassificationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
IvaErrorRaised when
aeat.domain.iva.classify_iva()cannot return a deterministic match.The classifier exposes a closed first-match-wins table; the only structural failure is when the input criteria cannot be represented under the closed enum set, which is caught at construction time by pydantic. This error is reserved for future extensions such as ambiguous rule rankings.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception IvaValidationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
IvaError,ValueErrorRaised on invalid IVA field values. Inherits from ValueError for Pydantic.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception ProrrataError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
IvaErrorBase error for IVA prorrata calculation failures (LIVA arts. 101-103).
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception ProrrataInputError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
ProrrataError,ValueErrorRaised when prorrata inputs violate domain invariants.
Inherits from
ValueErrorso pydantic surfaces it as aValidationErrorwhen raised from a model validator.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception ProrrataSectorError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
ProrrataErrorRaised when sectoral-separation inputs are inconsistent.
Examples: a sector references an unknown id, two sectors share an activity code, or the sector list is empty when sectoral separation is required (LIVA art. 9.1.c).
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶