aeat.domain.deadlines._plazo module

Registry lookup for filing window close dates (plazo voluntario).

Provides a profile-free function to ask “when does the plazo voluntario close for this modelo + filing year + period?” directly from the registry deadline windows. The result feeds the extemporaneidad detection surface in aeat.entrypoints.cli._modelo._work_unit_plazo_lines() and in the anti-tautology test suite.

resolve_filing_closes_on(modelo, filing_year, period)[source]

Return the close date of the plazo voluntario for a modelo+year+period.

Queries the validated registry authority for filing_year and returns the closes_on of the first matching DeadlineWindowDefinition.

Matching rule: the registry window period must carry the same filing year and bare registry period token as the supplied WorkUnit period (e.g. "1T", "0A", "01").

Returns None when the registry carries no window for the combination — either the modelo has no deadline windows registered for that year, or the period token does not match any window. None is a benign data-gap signal; callers should degrade gracefully rather than treating it as fatal.

Parameters:
  • modelo (str) – AEAT modelo code (e.g. "130", "303").

  • filing_year (int) – Tax year for which the work unit was created.

  • period (Period) – WorkUnit bare registry period token (e.g. "1T", "0A", "01").

Return type:

date | None

Returns:

The date on which the filing window closes, or None if not found.