cadrumo.domain.bienes_inversion.regularizacion_parameters module

Registry-resolved LIVA art-107/109 figures for the capital-goods regularización.

A registry parameter is hosted on a REVISION, and only the filing context names one. This domain package holds no filing context and performs no revision selection – no domain package in the tree does – so it cannot read these figures for itself. The accepted placement decision resolves them at the application boundary, which already holds the compiled revision it selected, and passes the result in as BienesInversionRegularizacionParameters.

The bundle carries no defaults and has one legitimate constructor, resolve_bienes_inversion_regularizacion_parameters(), which reads the validated authority. A calculator therefore cannot be called without resolved values, and a missing parameter leaves the bundle unconstructable rather than silently zero or silently equal to yesterday’s law.

BienesInversionParameterProvenance travels with the values into every result. Without it, handing the same bundle to a producer and to its oracle would make a WRONG bundle self-consistent and cost the oracle its independence; with it, a replay can refuse a result whose provenance disagrees with the bundle it was handed.

See also

domain.bienes_inversion.register

The art-109 and art-110 computations that consume the bundle.

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

Bases: CadrumoError

Raised when a revision cannot supply the whole art-107/109 figure set.

Refusing here rather than substituting a default is the point: an incomplete set means the revision does not govern this arithmetic, and a partial bundle would regularise a capital good on figures nothing grounded.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code
class BienesInversionParameterProvenance(**data)[source]

Bases: BaseModel

Which registry declaration produced a bundle’s values.

Variables:
  • modelo_id – Modelo whose revision hosts the parameters.

  • revision_id – The hosting revision’s canonical id.

  • parameter_ids – Every parameter read, in bundle field order.

  • resolved_on – The filing-period date the values were selected for.

Parameters:

data (Any)

modelo_id: str
revision_id: str
parameter_ids: tuple[str, ...]
resolved_on: date
class BienesInversionRegularizacionParameters(**data)[source]

Bases: BaseModel

The LIVA art-107/109 figures one revision declares, resolved.

Every field is required. There is no default anywhere in this model, so an instance can only exist because a validated revision supplied every value.

Variables:
  • ventana_anos_mueble – Art. 107.Uno window for a non-real-property good.

  • ventana_anos_inmueble – Art. 107.Tres window for terrenos o edificaciones.

  • divisor_mueble – Art. 109.3a divisor for a non-real-property good.

  • divisor_inmueble – Art. 109.3a divisor for terrenos o edificaciones.

  • umbral_puntos – Art. 107.Uno de-minimis difference in percentage points.

  • umbral_comparison – Whether the de-minimis is exceeded strictly or not. Registry data rather than a fixed operator, because a redaction changing “superior a” to “igual o superior a” would change the arithmetic without changing the number.

  • provenance – The declaration these values came from.

Parameters:

data (Any)

ventana_anos_mueble: int
ventana_anos_inmueble: int
divisor_mueble: Decimal
divisor_inmueble: Decimal
umbral_puntos: Decimal
umbral_comparison: ThresholdComparison
provenance: BienesInversionParameterProvenance
regularizacion_applies(diferencia_puntos)[source]

Whether the art-107.Uno de-minimis gate admits a regularisation.

The comparison direction is registry data rather than a hardcoded operator, so the day a redaction changes it the change lands in the declaration and not in this file.

Return type:

bool

Parameters:

diferencia_puntos (Decimal)

resolve_bienes_inversion_regularizacion_parameters(revision, *, modelo_id, filing_period_date)[source]

Build the bundle from one compiled revision’s declared parameters.

Parameters:
  • revision (ModeloRevision) – The compiled revision the application layer selected.

  • modelo_id (str) – Modelo the revision belongs to, recorded in provenance.

  • filing_period_date (date) – Date on the filing_period axis to select values for.

Return type:

BienesInversionRegularizacionParameters

Returns:

The fully resolved BienesInversionRegularizacionParameters.

Raises:

BienesInversionParameterResolutionError – When the revision declares none of the family, only part of it, or a value that does not resolve for filing_period_date.

Core types: ModeloRevision.