cadrumo.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

ProrrataRegisterEntry

Register record populated with the carried-prior-definitive percentage, provenance, and source-observation identity.

ProrrataProvisionalProvenance

Closed provenance axis whose CARRIED_PRIOR_DEFINITIVA member marks the normal LIVA art. 105.Uno seed path.

CalculationObservationRepositoryProtocol

Local observation catalogue scanned for prior Modelo 303 settlement observations.

revision_carry_outcome()

Shared law-determined gate used to re-confirm the stored stamped_revision_id before trusting the carry.

CrossPeriodCleanStateBlocker

Blocker 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: object

A 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: TypeAliasType
stamped_revision_id: TypeAliasType
class ProrrataSeedFinding(code, blocking, message, source_modelo, source_filing_year, source_period, stamped_revision_id, selected_revision_id)[source]

Bases: object

Operator-visible seed/cross-check blocker or advisory.

Parameters:
  • code (str)

  • blocking (bool)

  • message (str)

  • source_modelo (str)

  • source_filing_year (int)

  • source_period (str)

  • stamped_revision_id (RevisionId)

  • selected_revision_id (RevisionId | None)

code: str
blocking: bool
message: str
source_modelo: str
source_filing_year: int
source_period: str
stamped_revision_id: TypeAliasType
selected_revision_id: TypeAliasType | None
property advisory: bool

Whether this finding is a non-blocking advisory.

class ProrrataPriorDefinitivaSeedEvaluation(seed, findings=())[source]

Bases: object

Seed resolution plus any blockers or advisories surfaced while resolving it.

Parameters:
seed: ProrrataPriorDefinitivaSeed | None
findings: tuple[ProrrataSeedFinding, ...]
property blocked: bool

Whether any finding blocks trusting the seed.

evaluate_carried_prior_definitiva_seed(*, ejercicio, observation_repository, operation, sector_id=None)[source]

Evaluate the carried-prior-definitive seed and surface findings.

Divergent or unreconfirmable revision stamps produce a blocking registry_revision_divergence finding and no seed.

Return type:

ProrrataPriorDefinitivaSeedEvaluation

Parameters:
cross_check_prorrata_entry_against_prior_observation(entry, *, observation_repository, operation)[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:

tuple[ProrrataSeedFinding, ...]

Parameters: