aeat.application.prorrata_register._seed module¶
Seed the cross-period prorrata register from stamped prior observations.
The LIVA art. 105.Uno normal provisional percentage is the prior ejercicio’s definitive prorrata. This module locates that percentage in the prior Modelo 303 settlement observation and trusts it only after the observation’s registry revision stamp re-confirms against the law-determined revision for the source period.
See also
ProrrataRegisterEntryRegister record populated with the carried-prior-definitive percentage, provenance, and source-observation identity.
ProrrataProvisionalProvenanceClosed provenance axis whose
CARRIED_PRIOR_DEFINITIVAmember marks the normal LIVA art. 105.Uno seed path.CalculationObservationRepositoryLocal observation catalogue scanned for prior Modelo 303 settlement observations.
select_revision()Law-determined revision resolver used to re-confirm the stored
stamped_revision_idbefore trusting the carry.CrossPeriodCleanStateBlockerBlocker vocabulary reused for revision-divergent seed findings.
- class ProrrataPriorDefinitivaSeed(entry, source_modelo, source_filing_year, source_period, source_casilla_id, stamped_revision_id)[source]¶
Bases:
objectA re-confirmed prior-year definitive percentage ready to seed the register.
- Parameters:
entry (ProrrataRegisterEntry)
source_modelo (str)
source_filing_year (int)
source_period (str)
source_casilla_id (CasillaId)
stamped_revision_id (str | None)
-
entry:
ProrrataRegisterEntry¶
-
source_casilla_id:
TypeAliasType¶
- class ProrrataSeedFinding(code, blocking, message, source_modelo, source_filing_year, source_period, stamped_revision_id, selected_revision_id)[source]¶
Bases:
objectOperator-visible seed/cross-check blocker or advisory.
- Parameters:
- class ProrrataPriorDefinitivaSeedEvaluation(seed, findings=())[source]¶
Bases:
objectSeed resolution plus any blockers or advisories surfaced while resolving it.
- Parameters:
seed (ProrrataPriorDefinitivaSeed | None)
findings (tuple[ProrrataSeedFinding, ...])
-
seed:
ProrrataPriorDefinitivaSeed|None¶
-
findings:
tuple[ProrrataSeedFinding,...]¶
- evaluate_carried_prior_definitiva_seed(*, ejercicio, observation_repository=None, sector_id=None)[source]¶
Evaluate the carried-prior-definitive seed and surface blocker/advisory findings.
Divergent or unreconfirmable revision stamps produce a blocking
registry_revision_divergencefinding and no seed. A missing legacy stamp is a non-blocking advisory: the prior observation can seed the register, but the operator-visible finding records that the legacy source could not be re-confirmed.- Return type:
- Parameters:
ejercicio (int)
observation_repository (CalculationObservationRepository | None)
sector_id (str | None)
- seed_carried_prior_definitiva_entry(*, ejercicio, observation_repository=None, sector_id=None)[source]¶
Build a carried-prior-definitive register entry from a stamped prior observation.
The seed is available only when the prior ejercicio has a Modelo 303 settlement-period observation carrying
iva.prorrata-porcentajeand that observation’sstamped_revision_idstill matches the law-determined revision selected for its source(M303, ejercicio - 1, settlement period). Divergent or unreconfirmable observations are not trusted. Callevaluate_carried_prior_definitiva_seed()when the caller needs the operator-facing blocker/advisory findings that explain why a seed did or did not resolve.- Parameters:
ejercicio (
int) – Ejercicio whose provisional prorrata entry is being seeded.observation_repository (
CalculationObservationRepository|None) – Observation repository to scan. Defaults to the active runtime repository.sector_id (
str|None) – Optional sector axis for future sectores-diferenciados entries.Noneseeds the whole-entity register entry.
- Return type:
- Returns:
A
ProrrataPriorDefinitivaSeedwhen a stamped prior settlement observation re-confirms, otherwiseNone.
- cross_check_prorrata_entry_against_prior_observation(entry, *, observation_repository=None)[source]¶
Cross-check a register entry against the prior definitive observation.
A carried-prior-definitive entry must match the prior Modelo 303 settlement observation because art. 105.Uno is the normal carry rule. AEAT-authorised and inicio-de-actividades entries are regulated alternatives: when they differ from the prior definitive, the difference is surfaced as a non-blocking notice that names the provenance rather than being silenced.
- Return type:
- Parameters:
entry (ProrrataRegisterEntry)
observation_repository (CalculationObservationRepository | None)