aeat.domain.deadlines package

Public facade for registry-backed filing deadline computation.

DeadlineEngine is the project’s first user-visible “answer-the-user” surface: given an TaxpayerProfile and a year, it produces a deterministic typed Schedule of every filing the taxpayer profile is obliged to submit, with concrete opens / closes dates and a current ObligationStatus. Each ModeloDeadline may also carry a Recovery payload backed by the Ley 58/2003 art. 27 RecargoBand table when the obligation is overdue.

The engine is read-only — it never touches the storage layer, never files anything, and never mutates its inputs.

The facade also exposes the taxpayer-shape enums consumed by registry applicability predicates (EntityType, LegalEntityForm, IrpfIncomeCategory, IrpfEstimationRegime, FiscalResidency) and the BOE-cited holiday shift substrate (CalendarCCAA, HolidayCalendar, DeadlineShift, shift_deadline(), MODELOS_WITHOUT_SHIFT). Profile mappings enter through taxpayer_profile_from_mapping(); local overview and workflow services consume the resulting Schedule rather than rebuilding deadline or recovery logic.

See also

domain.calculations.registry.ValidatedRegistryAuthority

Registry authority that supplies modelo deadline windows and applicability predicates consumed by DeadlineEngine.

compute_obligation_schedule()

Single producer used by workflow gates and state projections to avoid divergent pending-obligation calculations.

taxpayer_profile_from_mapping()

Profile-value mapper used by application profile projections before calling this domain engine.

application.workflow

Application workflow gate that evaluates deadline obligations before verification and local filing steps.

application.overview

Local overview read model that merges this schedule with stored filing evidence.

Examples

>>> from datetime import date
>>> from aeat.domain.deadlines import (
...     TaxpayerProfile,
...     DeadlineEngine,
...     IVARegime,
...     next_deadline,
... )
>>> profile = TaxpayerProfile(
...     tax_id="X1234567L",
...     iva_regime=IVARegime.GENERAL,
...     has_employees=False,
...     pays_rent_with_retencion=True,
...     does_intracomunitario=False,
...     bienes_extranjero_above_threshold=False,
... )
>>> engine = DeadlineEngine()
>>> schedule = engine.compute(profile, year=2026, today=date(2026, 4, 1))
>>> _ = next_deadline(schedule, today=date(2026, 4, 1))

Submodules