aeat.application.overview package

Application read models for aeat app overview.

The package owns the typed DTOs and pure builders behind the overview status, calendar, agenda, backlog, and explain surfaces. CLI adapters supply the active profile or bucket state, already-persisted live-read snapshots, local filing records, and query dates; these builders do not contact AEAT and do not mutate storage.

overview status delegates to application.state_projection.build_operator_state_projection() and projects the canonical application.state_projection.OperatorStateProjection through overview_status_report_from_projection() into OverviewStatusReport. overview calendar composes the existing domain.deadlines.DeadlineEngine over the requested year window, returning OverviewCalendarEntry obligation rows, additive OverviewCalendarEvent observations, and OverviewCalendarFilingEvidence rows.

Calendar evidence deliberately keeps OverviewLocalFilingState separate from OverviewAeatSubmissionState: a local ready/filed record never implies an AEAT submission, and an observed AEAT submission is not a verified justificante until persisted receipt metadata proves the CSV/model/year/period/taxpayer match. Raw profile values may also produce typed CalendarWarning and CalendarCompleteness records through build_filing_obligation_advisories() so deadline-engine defaults are visible rather than silent.

See also

application.state_projection

Canonical producer for the application.state_projection.OperatorStateProjection consumed by overview status.

domain.deadlines

Deadline engine and domain.deadlines.Schedule authority used by calendar, agenda, backlog, and explain read models.

application.live

Read-only capture surface that persists the live evidence this package can display without opening AEAT again.

domain.modelos

Local domain.modelos.ModeloRecord and domain.modelos.ExternalEvidence records projected into overview calendar evidence.

application.workflow

Active-profile and pending-obligation state that remains upstream of overview rendering.

build_filing_obligation_advisories(raw_values, *, filing_year=None)[source]

Derive overview-status advisory locale keys from raw profile values.

The helper feeds OverviewStatusReport and stays on the local read-model path. It implements the Art. 96.2.a)/96.3 LIRPF multiple-pagadores rule through domain.deadlines.evaluate_multiple_pagadores_obligation(): when the operator has declared irpf.pagadores_count >= 2 and irpf.pagadores_secondary_income > 1500, the work-income exemption limit drops from the general €22,000 to the per-year reduced limit, and Modelo 100 filing is mandatory when irpf.pagadores_total_work_income exceeds that reduced limit. When the total work income is undeclared, the advisory surfaces conservatively rather than granting a false clear.

Parameters:
  • raw_values (Mapping[str, object] | None) – Profile raw values mapping, or None.

  • filing_year (int | None) – The income year selecting the dated reduced limit; when None the latest known reduced limit is used (the current figure for a year-agnostic operator surface).

Return type:

tuple[str, ...]

Returns a tuple of tr()-resolvable locale keys, empty when no evidence of a mandatory obligation is present. Malformed raw values are logged only by profile-field name and exception type.

build_unsupported_work_create_modelos(raw_values)[source]

Return modelos whose local work-create path is unsupported.

The result feeds OverviewStatusReport and uses canonical core.Modelo identifiers. Non-resident IRNR profile state currently advertises Modelo 210 because the local work-create path is not available for that filing.

Return type:

tuple[str, ...]

Parameters:

raw_values (Mapping[str, object] | None)

overview_status_report_from_projection(projection, *, raw_values=None)[source]

Project the canonical state projection into the overview status emit shape.

The OverviewStatusReport is a CLI emit shape derived from the one application.state_projection.OperatorStateProjection; it is not a second state-assembly path. Both the declaration-draft domain.filing.ModeloDraft count and the domain.modelos.WorkUnitCatalogue count are carried distinctly.

Parameters:
  • projection (OperatorStateProjection) – The canonical state projection to project.

  • raw_values (Mapping[str, object] | None) – Optional profile raw values mapping. When supplied, used to evaluate filing-obligation advisories (e.g., the Art. 96.3 LIRPF multiple-pagadores rule).

Return type:

OverviewStatusReport

Returns:

An OverviewStatusReport derived from the projection.

build_overview_status_report(*, state=None, raw_values=None)[source]

Build and return the OverviewStatusReport used by root and overview status.

Consumes the canonical application.state_projection.build_operator_state_projection() and projects it through overview_status_report_from_projection(); the bespoke per-surface store assembly this function once carried is deleted. overview status therefore reports the same counters as every other operator surface — including the modelo work work units the old assembly never read.

Return type:

OverviewStatusReport

Parameters:

Submodules