aeat.domain.filing._protocols module¶
Cross-module Protocols consumed by application.filing.
Every upstream collaborator (modelo identity, casilla schemas, deadline
engine) is represented by a typing.Protocol so the filing
application package does not take a hard import on any sibling subpackage.
Concrete implementations are wired at runtime by the entrypoint.
These Protocols are intentionally minimal: they describe only the
attributes application.filing actually consumes. They do not
attempt to model the full surface of the upstream subpackages.
- class CasillaSchema(*args, **kwargs)[source]¶
Bases:
ProtocolThe minimal casilla schema surface consumed by builders.
- Variables:
casilla_id – Stable canonical
casilla.id(e.g."01").value_type – One of
"decimal","int","str","bool","date".required – Whether the casilla must be present in a valid draft.
formula – ID of the formula declared on this casilla, or
Nonefor literal casillas.formula_input_casilla_ids – Tuple of casilla IDs this casilla depends on. Empty for literal casillas.
legal_refs – Regulatory citations grounding this casilla’s definition (BOE / AEAT permalinks).
source_refs – Source-material citations backing this casilla.
max_value (min_value /) – Inclusive
Decimalbounds for numeric casillas;Noneif unbounded.default – Default value used when the casilla is required and no input was supplied.
- property casilla_id: CasillaId¶
Return the canonical
casilla.ididentifier.
- property formula_input_casilla_ids: tuple[CasillaId, ...]¶
Return the casilla IDs this casilla’s formula depends on.
- property legal_refs: tuple[LegalRefId, ...]¶
Return the regulatory citation IDs grounding this casilla.
- class CasillaCollection(*args, **kwargs)[source]¶
Bases:
ProtocolA collection of casilla schemas keyed by ID.
- get(casilla_id)[source]¶
Return the
CasillaSchemaforcasilla_id, orNone.- Return type:
- Parameters:
casilla_id (CasillaId)
- all()[source]¶
Return every casilla schema in the collection.
- Return type:
- Returns:
Sequence of every
CasillaSchemain the collection.
- class CasillaSchemaProvider(*args, **kwargs)[source]¶
Bases:
ProtocolResolves a casilla collection for a given modelo.
- get_collection(modelo)[source]¶
Return the casilla collection for
modelo.- Return type:
- Returns:
The
CasillaCollectionfor the given modelo code.- Parameters:
modelo (str)
- class DeadlineStatus(*args, **kwargs)[source]¶
Bases:
ProtocolResult of a deadline check for a (modelo, period) tuple.
- class DeadlineChecker(*args, **kwargs)[source]¶
Bases:
ProtocolChecks the filing deadline for a typed modelo period.
- check(modelo, period)[source]¶
Return the
DeadlineStatusformodeloandperiod.- Return type:
- Parameters:
- class ModeloProfile(*args, **kwargs)[source]¶
Bases:
ProtocolThe taxpayer profile a draft is built for.
Only the attributes
application.filingactually consumes are declared here; downstream callers may use richer profile objects as long as they expose these attributes.- property tax_id: SubjectTaxId¶
Return the taxpayer’s NIF / NIE.
- class ModeloDraftRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing contract for the filing-draft repository.
ModeloDraftRepositorystructurally conforms to this Protocol; domain service code that only needs to load or save drafts should depend inward on this port.
- class ModeloAmendmentRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing contract for the filing-amendment repository.
ModeloAmendmentRepositorystructurally conforms to this Protocol; domain service code that only needs to load, save, or list amendments should depend inward on this port.