cadrumo.domain.calculations.registry.inventory_bindings module

Typed registry selector contract for the Modelo 100 inventory projection.

This module declares only the binding selector and its accumulating shape validator. Source resolution, readiness, valuation, provenance, and registry enrollment are owned by later integration steps; a selector declaration cannot make an inventory schedule authoritative or complete.

The filing year is deliberately NOT pinned here. Which years carry an inventory projection is a revision-owned fact, declared by the bindings the authoring tree ships, so a later revision adding one must be an authoring change rather than an edit to this file. Today only the Modelo 100 2025 revision declares them.

The operation-to-casilla identity below is a structural invariant of the projection vocabulary: an operation names WHICH figure it produces, so its destination is what the operation means, not a value the law re-sets per year.

class InventoryProvider(**data)[source]

Bases: BaseModel

One immutable operation template expanded over runtime activity rows.

complete_acquisition_cost names the legally complete acquisition-cost fact, never the existing IVA-exclusive purchase subtotal. The two stock variation operations name non-negative magnitudes in opposite directions, so no generic signed variation can enter the selector vocabulary.

Parameters:

data (Any)

kind: Literal[BindingSourceKind.INVENTORY]
modelo: Literal['100']
temporal: BindingTemporalSelector
projection_grain: Literal['taxpayer_year_activity']
fact: Literal['row_field']
record: Literal['inventory_activity']
grouping: Literal['per_inventory_activity']
row_field: InventoryProjectionOperation
target_casilla_id: CasillaId
validate_inventory_binding(binding)[source]

Validate the inventory operation invariants for snapshot build.

The operation-to-destination identity is re-run here through the shared selector gate rather than trusted to have happened earlier: a snapshot is built from provider objects that may reach this boundary without having passed model validation, and an operation silently landing on another operation’s casilla is a filing-grade misdeclaration, not a shape detail. The identity itself is never restated here – the union member owns it.

Return type:

list[str]

Parameters:

binding (BindingDefinition)