aeat.application.overview._agenda module¶
Overview agenda: upcoming-deadline ranking with a top-of-payload next_due.
build_overview_agenda() is the application service backing
aeat app overview agenda. It accepts a
TaxpayerProfile and composes
application.overview.build_overview_calendar() over a window anchored
on the operator’s as_of date, then partitions the resulting
OverviewCalendarEntry rows into overdue / due_today /
due_soon cohorts. The earliest future obligation becomes next_due so
the CLI can render a single “what is the next thing I have to do” answer
without re-walking the calendar.
Local-only: never contacts AEAT. Pure aggregator over the deadline engine, the festivos table, and the operator’s profile values.
- class OverviewAgenda(**data)[source]¶
Bases:
BaseModelOutcome of
build_overview_agenda.The model is the agenda-shaped projection of
application.overview.OverviewCalendar: cohorts retain the originalOverviewCalendarEntryrows, warnings areCalendarWarningvalues inherited from the calendar build, and completeness is the sameCalendarCompletenessreport.- Variables:
as_of – Date the agenda is rendered against.
horizon_days – Forward window the due_soon cohort honours.
next_due – Single earliest future obligation (closest
adjusted_closes_on >= as_of);Nonewhen no future obligation falls inside the lookahead window.due_today – Entries whose
adjusted_closes_onequalsas_of.due_soon – Entries whose
adjusted_closes_onfalls in(as_of, as_of + horizon_days].overdue – Entries whose
adjusted_closes_onprecedesas_ofand whose user_state isLATE(filed obligations are excluded — the engine’sFILEDflag suppresses them via the state mapping).generated_at – UTC timestamp of when the aggregator ran.
warnings – Calendar warnings inherited from the underlying calendar build (under-specified profile keys).
completeness – Calendar completeness inherited from the underlying calendar build.
taxpayer_model_declared – Whether the profile carries a usable three-axis taxpayer model. When
Falseevery cohort is empty and the operator must declare their taxpayer type first.incomplete_reason – “declare your taxpayer type first” guidance, present only when
taxpayer_model_declaredisFalse.
- Parameters:
as_of (date)
horizon_days (int)
next_due (OverviewCalendarEntry | None)
due_today (tuple[OverviewCalendarEntry, ...])
due_soon (tuple[OverviewCalendarEntry, ...])
overdue (tuple[OverviewCalendarEntry, ...])
generated_at (datetime)
warnings (tuple[CalendarWarning, ...])
completeness (CalendarCompleteness)
coverage (ObligationCoverageReport)
taxpayer_model_declared (bool)
incomplete_reason (str | None)
- as_of: date¶
- horizon_days: int¶
- next_due: OverviewCalendarEntry | None¶
- due_today: tuple[OverviewCalendarEntry, ...]¶
- due_soon: tuple[OverviewCalendarEntry, ...]¶
- overdue: tuple[OverviewCalendarEntry, ...]¶
- generated_at: datetime¶
- warnings: tuple[CalendarWarning, ...]¶
- completeness: CalendarCompleteness¶
- coverage: ObligationCoverageReport¶
- taxpayer_model_declared: bool¶
- incomplete_reason: str | None¶
- build_overview_agenda(profile, *, as_of, horizon_days=14, engine=None, raw_values=None)[source]¶
Rank upcoming and past-due obligations around
as_of.- Parameters:
profile (
TaxpayerProfile) – TheTaxpayerProfilewhose obligations are ranked.as_of (
date) – Anchor date for the lookback / lookahead window.horizon_days (
int) – Number of days afteras_ofto include in the lookahead window.engine (
DeadlineEngine|None) – OptionalDeadlineEngineoverride; defaults to the registry-backed engine whenNone.raw_values (
Mapping[str,object] |None) – Optional mapping of registry binding raw values forwarded to the deadline engine for context-sensitive deadlines.
- Return type:
Composes
application.overview.build_overview_calendar()over a window that spansas_of - 90 days(so overdue obligations from the prior quarter surface) throughas_of + horizon_days(so the lookahead matches the operator’s requested--horizon).The returned
next_dueis the single entry with the smallestadjusted_closes_on >= as_of; if multiple obligations close on the same date, the deterministic calendar ordering(closes_on, modelo, period)resolves the tie.Returns an
OverviewAgenda.