aeat.application.overview._backlog module¶
Overview backlog: past-due / triage cohort listing.
build_overview_backlog() is the application service backing
aeat app overview backlog. It accepts a
TaxpayerProfile, composes
application.overview.build_overview_calendar() over an
operator-supplied date window (defaulting to the last 365 days through today),
and enumerates every OverviewCalendarEntry whose
adjusted_closes_on precedes today and whose user_state indicates it has
not yet been filed.
The verb is a read model only: it never mutates state and never
contacts AEAT. Lifecycle continuation is owned by
aeat app modelo work resume per the workflow-resumption-semantics ADR.
- class OverviewBacklog(**data)[source]¶
Bases:
BaseModelOutcome of
build_overview_backlog.The model is the backlog-shaped projection of
application.overview.OverviewCalendar. Items retain the originalOverviewCalendarEntryrows, warnings remainCalendarWarningrows from the calendar build, and completeness is the inheritedCalendarCompletenessreport.- Variables:
range – Calendar window the backlog was scoped to.
as_of – Reference date the past-due cohort is computed against.
items – Past-due obligations whose user_state is
LATEand whoseadjusted_closes_onprecedesas_of. Sorted ascending by deadline (oldest first) so operators triage the most-overdue obligations first.late_count – Number of items in
items(cached for renderers that show a header summary without re-walking the list).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
Falsethe backlog 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:
range (OverviewCalendarRange)
as_of (date)
items (tuple[OverviewCalendarEntry, ...])
late_count (int)
generated_at (datetime)
warnings (tuple[CalendarWarning, ...])
completeness (CalendarCompleteness)
coverage (ObligationCoverageReport)
taxpayer_model_declared (bool)
incomplete_reason (str | None)
- range: OverviewCalendarRange¶
- as_of: date¶
- items: tuple[OverviewCalendarEntry, ...]¶
- late_count: int¶
- generated_at: datetime¶
- warnings: tuple[CalendarWarning, ...]¶
- completeness: CalendarCompleteness¶
- coverage: ObligationCoverageReport¶
- taxpayer_model_declared: bool¶
- incomplete_reason: str | None¶
- build_overview_backlog(profile, *, from_date=None, to_date=None, as_of=None, engine=None, raw_values=None, work_units=())[source]¶
Enumerate the operator’s past-due obligations.
- Parameters:
profile (
TaxpayerProfile) – TheTaxpayerProfilewhose filing obligations are evaluated.from_date (
date|None) – Start of the calendar window; defaults to 365 days beforeas_of.to_date (
date|None) – End of the calendar window; defaults toas_of.as_of (
date|None) – Reference date for past-due classification; defaults to today.engine (
DeadlineEngine|None) – OptionalDeadlineEngineoverride.raw_values (
Mapping[str,object] |None) – Optional raw profile values passed through to the engine.work_units (
tuple[WorkUnit,...]) – Optional Modelo work units loaded by the caller. When no explicitfrom_dateis supplied, the default range expands back to the earliest active local work unit so historical in-progress work is not silently excluded by the 365-day lookback.
- Return type:
The default window is the 365 days preceding
as_of(today when omitted), which is wide enough to surface every backlog item that survived a full annual filing cycle without overflowing the underlying deadline-engine schedule.Past-due classification uses the
application.overview.OverviewPeriodStatetaxonomy: an obligation is in the backlog iff itsadjusted_closes_onprecedesas_ofAND itsuser_stateisLATE. Filed obligations are excluded by the state mapping; the engine surfaces them asFILEDrather thanOVERDUE.Returns an
OverviewBacklogwith the backlog items and the calendar range used for the computation.