aeat.application.workflow._engine_helpers module

Private helpers for workflow-engine formatting and deadline metadata.

class DeadlineRole(*values)[source]

Bases: StrEnum

Role of a deadline within workflow step metadata.

INFORMATIONAL
BINDING
class FilingWindowState(*values)[source]

Bases: StrEnum

State of the filing window for a given (modelo, period) at workflow time.

ABSENT
FUTURE
OPEN
CLOSED
registry_period_token(period)[source]

Resolve a Period to (filing_year, registry_period).

Return type:

tuple[int, str]

Parameters:

period (Period)

registry_filing_year(period)[source]

Return the filing year from a typed Period.

Return type:

int

Parameters:

period (Period)

classify_cert_expiry(*, not_after, today, warn_days, critical_days)[source]

Classify a certificate’s expiry window against operator thresholds.

Return type:

tuple[Literal['OK', 'WARN', 'CRITICAL', 'EXPIRED'], int]

Parameters:
summary_text(en)[source]

Build a workflow summary string.

Return type:

str

Parameters:

en (str)

enum_value(value)[source]

Return Enum.value when present, otherwise str(value).

Return type:

str

Parameters:

value (object)

draft_blocking_finding_descriptions(draft)[source]

Summarise the ERROR/WARNING findings that keep a built draft out of the ready state.

The BUILDING_DRAFT gate aborts with DRAFT_HAS_ERRORS whenever the builder hands back a draft still below LISTO_PARA_PRESENTAR. Without the underlying findings the abort is opaque (operators see only status=BORRADOR), so this projects each blocking finding to a compact severity:code (casilla) description the abort step can surface.

Return type:

tuple[str, ...]

Parameters:

draft (object)