cadrumo.domain.iva_compensation.errors module

Typed error classes for the IVA-compensation domain.

These guard-violation errors are raised by the pure carry-forward, reconciliation, and balance logic. Each uses the canonical registered CadrumoError ancestry, so the failure reaches the typed error registry with a stable code and structured context. Pydantic validators translate a registered failure to ValueError at their narrow validator boundary when scalar validation or coercion crosses that protocol.

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

Bases: CadrumoError

Raised when IVA compensation carry-forward lots violate policy.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
exception IvaCompensationSeedConflictError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

Raised when a seed is attempted for a period that already has a stored state.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
exception IvaCompensationYearRangeError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

Raised when a filing_year or as_of_year falls outside the supported range [2000, 2099].

Replaces bare ValueError at the year-range guards in iva_compensation_period_key() and build_iva_compensation_carry_forward_report(). Its canonical registered ancestry is CadrumoError; a Pydantic validator translates it to ValueError at its narrow boundary when these scalar checks are performed there.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
exception IvaCompensationDecimalParseError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

Raised when a casilla value cannot be coerced to Decimal.

Replaces the bare ValueError re-raised from InvalidOperation inside the casilla-decimal coercion helper. Its canonical registered ancestry is CadrumoError; a Pydantic validator translates it to ValueError at its narrow boundary while the direct helper chains the original InvalidOperation cause.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
exception IvaCompensationCasillaReferenceError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

Raised when IVA compensation input uses a noncanonical casilla reference.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
exception IvaCompensationReconciliationInputError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

Raised when IVA compensation wallet reconciliation inputs are invalid.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
exception IvaWalletReconciliationError(message=None, *, context=None, translated_message=None)[source]

Bases: CoreError

Raised when an IVA wallet reconciliation invariant is violated.

Covers pre-condition checks on the reconciliation inputs that fall outside pydantic model validation — for example, a negative max_wallet_age_days argument supplied to the staleness predicate. Raising a typed CoreError subclass instead of a bare ValueError ensures the failure propagates through the error registry and produces a structured envelope with a stable error code.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code