cadrumo.application.filing._envelope_modelo_policy module

Per-modelo policy the modelo-agnostic filing-envelope renderer dispatches to.

The envelope GRAMMAR is one contract for every modelo – prefix roles, relative closer, emitted-byte total – and lives in the generic renderer. What is not shared is tax law: which records apply to which taxpayer, and which operator elections a modelo’s records make mandatory. Those stay per modelo, and they arrive here as a registered row rather than as a branch inside the renderer.

Registering a modelo is therefore additive: a new row, and (where the modelo has conditional records) its own applicability module. A modelo with no row is not refused – it simply carries no extra constraint beyond the generic ones the renderer already proves – because “this modelo declares no conditional record family” is a legitimate state, not an unfinished one.

class FilingEnvelopeModeloPolicy(**data)[source]

Bases: BaseModel

The per-modelo constraints one registered modelo adds to envelope render.

Parameters:
  • requiresprior_domiciliation_election (bool)

  • applicability_gate (FilingEnvelopeApplicabilityGate | None)

requiresprior_domiciliation_election: bool

Whether the modelo’s records make the operator’s prior-domiciliation election a mandatory explicit input rather than a defaulted one.

applicability_gate: FilingEnvelopeApplicabilityGate | None

The modelo’s own exhaustive applicability gate, where it declares one.

validate_applicability(*, period, registry_snapshot, layout, producer_snapshot)[source]

Run the modelo’s own applicability gate, where it registered one.

Core types: RegistrySnapshot.

Return type:

None

Parameters:
filing_envelope_modelo_policy(modelo)[source]

Return the registered policy for modelo, or the empty one.

Return type:

FilingEnvelopeModeloPolicy

Parameters:

modelo (Modelo)