aeat.application.modelo._data_inventory module¶
Data-inventory checklist composer for one modelo / filing-year / period.
Composes the registry-authoritative facts an operator needs before they can calculate a modelo: which manual casillas are required, which are optional, which are populated automatically from the bucket ledger, and which are populated from the active taxpayer profile (with a per-binding readiness flag so an unset profile fact — e.g. the home-office usage ratio — surfaces as an actionable gap rather than a silent blank downstream).
This module owns the read-only composition over
authority_via_resources()
(the registry snapshot for the casilla/binding declarations) and
profile_resolvable_binding_ids()
(the profile-fact resolution already used by the bindings list --missing
surface), so the CLI requires command stays a thin projection layer. No new
aggregation path is introduced: the same registry snapshot and profile-binding
resolver the calculate path uses are read, not re-derived.
See also
required_input_casilla_ids_for_revision()Sibling helper returning only the bare required/optional id tuples (used by amendment completeness checks); this module composes the richer operator-facing checklist over the same snapshot.
profile_resolvable_binding_ids()Profile-fact binding resolver reused here to flag missing coefficients.
- class DataInventoryCasilla(casilla_id, number, label, localized_labels=<factory>, legal_refs=(), source_refs=(), binding_id=None, binding_source=None)[source]¶
Bases:
objectOne casilla entry on a data-inventory checklist.
- Parameters:
-
casilla_id:
TypeAliasType¶
- class DataInventoryChecklist(modelo, revision_id, filing_year, period, required_manual, optional_manual, ledger_derivable, profile_derivable, unresolved_profile_bindings, profile_checked)[source]¶
Bases:
objectComposed “what data do I need” checklist for one modelo/year/period.
required_manualandoptional_manualare the casillas an operator must (or may) hand-enter.ledger_derivableare casillas the ledger aggregation mesh populates automatically once the relevant transactions are imported and classified — the operator imports these rather than typing them.profile_derivableare casillas populated from the active taxpayer profile (coefficients such as the home-office usage ratio);unresolved_profile_bindingsnames the subset of those bindings the active profile has not yet supplied a fact for, so the checklist can warn the operator before they calculate and hit a missing-binding refusal.- Parameters:
modelo (str)
revision_id (str)
filing_year (int)
period (str)
required_manual (tuple[DataInventoryCasilla, ...])
optional_manual (tuple[DataInventoryCasilla, ...])
ledger_derivable (tuple[DataInventoryCasilla, ...])
profile_derivable (tuple[DataInventoryCasilla, ...])
unresolved_profile_bindings (tuple[BindingId, ...])
profile_checked (bool)
-
required_manual:
tuple[DataInventoryCasilla,...]¶
-
optional_manual:
tuple[DataInventoryCasilla,...]¶
-
ledger_derivable:
tuple[DataInventoryCasilla,...]¶
-
profile_derivable:
tuple[DataInventoryCasilla,...]¶
- data_inventory_checklist(*, modelo, filing_year, period, bucket_id)[source]¶
Compose the data-inventory checklist for one modelo / year / period.
Reads the resolved
RegistrySnapshotfor(modelo, filing_year, period)and classifies every casilla:input_kind == MANUALcasillas split intorequired_manual/optional_manualby theirrequiredflag.input_kind == BOUNDcasillas are classified by their binding’sBindingSourceKind: ledger-aggregation sources becomeledger_derivable;profilesources becomeprofile_derivable. Every other bound source (previous-filing carry, relation prefill, live observation, constant value, …) requires no operator data-gathering action and is intentionally omitted from the checklist.COMPUTEDandINFORMATIONALcasillas need no source data and are omitted.
When
bucket_idnames an active profile,profile_derivablebindings are cross-checked againstprofile_resolvable_binding_ids()and any binding the profile has not yet resolved is surfaced inunresolved_profile_bindings— the coefficient-missing warning the issue calls for (e.g. an unset home-office ratio).profile_checkedisFalsewhen nobucket_idwas supplied or the check could not run; callers should not read an emptyunresolved_profile_bindingsas “all clear” in that case.- Raises:
RegistrySnapshotError – When the registry has no revision covering
(modelo, filing_year, period).- Return type:
- Returns:
- Parameters: