aeat.domain.submission._preflight module¶
Preflight gating for the filing submission engine.
Preflight runs four ordered gates against a
aeat.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)[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: gates 1, 2, and 4 still confirm draft soundness and auth-provider readiness, while the redundant AEAT submission-window check remains disabled for paths that do not submit to AEAT.
- Raises:
SubmissionPreflightError – If any gate fails. The exception message identifies the failing gate.
- Return type: