cadrumo.domain.submission.protocols module¶
Narrow Protocol ports for the submission engine.
The submission engine is composed of read-only sub-systems that the test suite exercises with concrete, hand-rolled Protocol-conforming classes (no mocks, no patches). Each Protocol declares only the surface the engine actually consumes, decoupling submission from the richer surfaces of its sibling subpackages.
AuthProviderProbe— narrow auth-provider surface for the preflight gate.DeadlineWindowChecker— narrow surface overcadrumo.domain.deadlinesused by preflight.ModeloFindingLike/ModeloDraftLike— narrow filing draft surfaces;domain.filing.schema.ModeloDraftstructurally conforms toModeloDraftLike.SubmissionRepositoryProtocol— the read-side persistence port.
Every declaration here is a runtime_checkable Protocol. The record
types these ports carry — ModeloDraftStatus among them — live
beside the other submission records in
cadrumo.domain.submission.models. Finding entries are typed
structurally through ModeloFindingLike; the implementation is
cadrumo.domain.filing.schema.ModeloValidationFinding.
- class AuthProviderProbe(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow submission-facing auth-provider surface.
- describe()[source]¶
Return the active provider’s
core.auth_provider.AuthProviderDescription.- Return type:
- class DeadlineWindowChecker(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow surface over
cadrumo.domain.deadlinesfor the preflight gate.
- class ModeloFindingLike(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow structural port over one
draft.findingsentry.The implementation declares
severityas a REQUIRED field with no default:cadrumo.domain.filing.schema.ModeloValidationFinding. TypingModeloDraftLike.findingsthrough this Protocol (rather thantuple[object, ...]) lets the preflight gate read.severitydirectly instead of through agetattr(..., None)guess – a field rename now fails loud instead of silently excluding every finding from the error-severity gate.- property severity: BaseSeverity¶
Return the severity the preflight error-findings gate reads.
- class ModeloDraftLike(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow surface over a filing draft.
domain.filing.schema.ModeloDraftstructurally conforms to this Protocol so the engine can accept either the real draft or any Protocol-conforming hand-rolled class in tests.Attributes are declared as read-only properties so pyrefly treats them covariantly and frozen pydantic models satisfy the protocol without invariance errors.
- property profile_tax_id: SubjectTaxId¶
Return the NIF / NIE of the taxpayer the draft is built for.
- property status: object¶
Return the draft’s lifecycle status.
Declared as
objectso any draft implementation satisfies the Protocol; the preflight gate compares againstcadrumo.domain.submission.models.ModeloDraftStatus.
- property values: Mapping[str, str] | Iterable[object]¶
Return the draft’s casilla values, keyed or iterable by implementation.
- property findings: tuple[ModeloFindingLike, ...]¶
Return the validation findings the error-severity gate reads.
- class SubmissionRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for the submission engine.
The concrete
SubmissionRepositorylives in the persistence adapter and inherits from the adapter-layerSecureBoundRepository. This Protocol captures only the surface the engine consumes so the domain depends inward on this port, and the application layer constructs the concrete repository and injects it intoSubmissionEngine.- load(record_id, /)[source]¶
Load a persisted
ModeloPresentadoby id, or return None if absent.- Return type:
- Parameters:
record_id (str)
- iter_submissions()[source]¶
Yield every persisted submission in lexicographic id order.
- Return type:
- Returns:
Iterator over
ModeloPresentadorecords.