cadrumo.domain.submission.preflight module¶
Preflight gating for the filing submission engine.
Preflight runs four ordered gates against a
cadrumo.domain.submission.protocols.ModeloDraftLike before any
browser work begins. Every failure raises
SubmissionPreflightError; the happy path is silent.
See also
SubmissionEnginePublic read-only engine that owns this preflight runner.
DeadlineWindowCheckerGate-3 protocol used only when the caller has not skipped the filing window check.
WorkflowPurposeApplication policy input that decides whether workflow callers pass
skip_deadline_windowfor local verification or filing.
- class Preflight(*, deadline_checker, auth_provider)[source]¶
Bases:
objectFour-gate validator for a
ModeloDraftLike.Gates run in order:
Draft status is
ModeloDraftStatus.APROBADO.No
ERROR-severity entries indraft.findings.Deadline window is open via
DeadlineWindowChecker.is_window_open().Auth provider describes itself cleanly via
AuthProviderProbe.describe().
The validator is pure: no I/O beyond the injected Protocol calls, no state beyond its dependencies.
- Variables:
deadline_checker – Protocol implementation used for gate 3.
auth_provider – Protocol implementation used for gate 4.
- Parameters:
deadline_checker (DeadlineWindowChecker)
auth_provider (AuthProviderProbe)
- check(draft, *, today, skip_deadline_window=False, skip_auth_readiness=False)[source]¶
Run the four preflight gates against
draft.- Parameters:
draft (
ModeloDraftLike) – TheModeloDraftLiketo validate.today (
date) – Reference date for the deadline-window gate.skip_deadline_window (
bool) – WhenTrue, gate 3 (the AEAT filing-window check) is skipped. Workflow callers use this for local VERIFY and local FILE purposes: the redundant AEAT submission-window check remains disabled for paths that do not submit to AEAT.skip_auth_readiness (
bool) – WhenTrue, gate 4 (auth-provider readiness) is skipped. Auth binds only live/AEAT-touching purposes (pull, reconcile, a live session): the whole local artefact flow — build, calculate, VERIFY, local FILE, export — completes with no auth provider configured, because the human uploads at the AEAT portal themselves. Callers that perform an actual AEAT read/submission leave the gate enabled (the default).
- Raises:
SubmissionPreflightError – If any gate fails. The exception message identifies the failing gate.
- Return type: