aeat.application.workflow._deadline_stage module

Deadline resolution helpers for the workflow engine.

The deadline stage projects the active TaxpayerProfile through the domain deadline engine and selects one ModeloDeadline from the computed Schedule. It keeps workflow verification and filing gates aligned with the shared compute_obligation_schedule() producer used by state projections.

See also

WorkflowEngine

Composition root that calls these helpers from the COMPUTING_DEADLINES stage.

WorkflowPurpose

Purpose enum that decides whether a missing or late filing-window obligation aborts the run or remains informational context.

build_pending_obligations()

Projection-side consumer of the same deadline schedule producer.

domain.deadlines

Domain schedule authority that emits the Schedule and ModeloDeadline records selected here.

resolve_deadline_stage_obligation(deadline_engine, profile, *, target_modelo, target_period, today, purpose)[source]

Return the obligation the workflow deadline stage should evaluate.

Parameters:
  • deadline_engine (DeadlineEngineProtocol) – Deadline engine implementation that produces a Schedule.

  • profile (TaxpayerProfile) – The TaxpayerProfile used to compute obligations.

  • target_modelo (str | None) – Optional exact modelo filter for a work-unit target.

  • target_period (Period | None) – Optional exact Period filter for a work-unit target.

  • today (date) – Reference date for deadline status classification.

  • purpose (WorkflowPurpose) – Workflow purpose controlling late-local-file fallback behavior.

Return type:

ModeloDeadline | None

Returns:

The selected ModeloDeadline, or None when no matching obligation exists.

abort_missing_deadline_obligation(*, started, steps)[source]

Record and raise the deadline-stage no-obligation abort.

Return type:

NoReturn

Parameters: