aeat.application.overview._calendar_models module¶
Typed DTOs for the overview calendar read model.
The models separate legal obligation rows
(OverviewCalendarEntry), observed local events
(OverviewCalendarEvent), and filing evidence
(OverviewCalendarFilingEvidence). Filing evidence keeps
OverviewLocalFilingState distinct from
OverviewAeatSubmissionState so local readiness, AEAT submission,
and justificante verification remain auditable independent axes.
These DTOs are consumed by application.overview.build_overview_calendar()
and serialized by the overview CLI payload layer. Period-bearing models hydrate
serialized Period values back into typed periods so merge
keys stay aligned with the registry-token authority.
- class OverviewPeriodState(*values)[source]¶
Bases:
StrEnumClosed user-facing state derived from deadline obligation status.
- DUE¶
- LATE¶
- FILED¶
- UNKNOWN¶
- class OverviewCensoEnrolmentState(*values)[source]¶
Bases:
StrEnumLive Modelo 036 / censo provenance state for one calendar obligation.
- NOT_CHECKED¶
- NOT_REQUIRED¶
- UNVERIFIED¶
- VERIFIED¶
- class OverviewCalendarEntrySource(*values)[source]¶
Bases:
StrEnumOrigin of one overview calendar row.
- REGISTRY_DEADLINE¶
- LOCAL_WORK_UNIT¶
- class OverviewLocalFilingState(*values)[source]¶
Bases:
StrEnumLocal application-side filing axis for one calendar obligation.
These values describe the application’s internal filing lifecycle only. They are intentionally separate from
OverviewAeatSubmissionStateso a ready or imported local record cannot imply official AEAT submission.- NOT_READY_TO_FILE¶
- READY_TO_FILE¶
- EXTERNAL_BASELINE_IMPORTED¶
- class OverviewAeatSubmissionState(*values)[source]¶
Bases:
StrEnumObserved AEAT-side submission evidence for one calendar obligation.
OverviewAeatSubmissionState.NOT_OBSERVEDis the default until already-loaded official evidence proves a submitted, accepted, or justificante-verified state. Overview calendar commands never create this evidence by contacting AEAT.- NOT_OBSERVED¶
- SUBMITTED_OBSERVED¶
- ACCEPTED¶
- JUSTIFICANTE_VERIFIED¶
- user_state_for(obligation_status)[source]¶
Return the
OverviewPeriodStatefor a deadline engine status.- Return type:
- Parameters:
obligation_status (ObligationStatus)
- class OverviewCalendarRange(**data)[source]¶
Bases:
BaseModelInclusive date window for the
overview calendarquery.application.overview.build_overview_calendar()expands the window to the covered filing years and filters legal obligation rows back to this inclusive range.- from_date: date¶
- to_date: date¶
- class OverviewCalendarFilingEvidence(**data)[source]¶
Bases:
BaseModelFiling evidence attached to one legal calendar obligation.
The local fields describe the application’s filing-record axis; the AEAT fields describe observed submission evidence from persisted official sources. Validators require
justificante_verifiedandverified_justificante_csvto agree exactly withOverviewAeatSubmissionState.JUSTIFICANTE_VERIFIED, preventing a malformed event from claiming receipt verification without CSV evidence.- Parameters:
modelo (str | None)
filing_year (int | None)
period (Period | None)
local_filing_state (OverviewLocalFilingState)
local_filing_record_id (str | None)
local_calculation_revision_id (str | None)
local_filed_at (datetime | None)
aeat_submission_state (OverviewAeatSubmissionState)
aeat_submitted_at (datetime | None)
aeat_reference_id (str | None)
aeat_snapshot_id (str | None)
aeat_evidence_kind (str | None)
verified_justificante_csv (str | None)
justificante_required (bool)
justificante_verified (bool)
evidence_source (str | None)
- modelo: str | None¶
- filing_year: int | None¶
- period: _Period | None¶
- local_filing_state: OverviewLocalFilingState¶
- local_filing_record_id: str | None¶
- local_calculation_revision_id: str | None¶
- local_filed_at: datetime | None¶
- aeat_submission_state: OverviewAeatSubmissionState¶
- aeat_submitted_at: datetime | None¶
- aeat_reference_id: str | None¶
- aeat_snapshot_id: str | None¶
- aeat_evidence_kind: str | None¶
- aeat_evidence_conflict_reference_ids: tuple[str, ...]¶
- verified_justificante_csv: str | None¶
- justificante_required: bool¶
- justificante_verified: bool¶
- evidence_source: str | None¶
- class OverviewCalendarEntry(**data)[source]¶
Bases:
BaseModelOne legal
(modelo, period)row in the calendar view.The deadline fields mirror
ModeloDeadline. The optionalOverviewCalendarFilingEvidencerow attaches local and AEAT evidence without changing the legal deadline status from the deadline engine.- Parameters:
modelo (str)
period (Period)
opens_on (date)
closes_on (date)
adjusted_closes_on (date)
shift_reason (str)
jurisdictions (tuple[HolidayJurisdiction, ...])
payment_cutoff_on (date | None)
status (ObligationStatus)
user_state (OverviewPeriodState)
recovery (Recovery | None)
filing_year (int | None)
censo_enrolment_state (OverviewCensoEnrolmentState)
filing_evidence (OverviewCalendarFilingEvidence)
source (OverviewCalendarEntrySource)
local_work_unit_id (str | None)
local_work_unit_name (str | None)
local_work_unit_revision_id (str | None)
- modelo: str¶
- period: _Period¶
- opens_on: date¶
- closes_on: date¶
- adjusted_closes_on: date¶
- shift_reason: str¶
- holiday_refs: tuple[str, ...]¶
- jurisdictions: tuple[_HolidayJurisdiction, ...]¶
- payment_cutoff_on: date | None¶
- status: _ObligationStatus¶
- user_state: OverviewPeriodState¶
- recovery: _Recovery | None¶
- filing_year: int | None¶
- censo_enrolment_state: OverviewCensoEnrolmentState¶
- filing_evidence: OverviewCalendarFilingEvidence¶
- source: OverviewCalendarEntrySource¶
- local_work_unit_id: str | None¶
- local_work_unit_name: str | None¶
- local_work_unit_revision_id: str | None¶
- class OverviewCalendarEventType(*values)[source]¶
Bases:
StrEnumObserved event categories shown alongside legal filing windows.
- FILING¶
- MESSAGE¶
- class OverviewCalendarEvent(**data)[source]¶
Bases:
BaseModelOne observed local event attached to an overview calendar range.
Filing events may carry
OverviewAeatSubmissionStatewhen a persisted snapshot already observed it. Messages and unverified filings remain event-only observations and do not implyOverviewCalendarFilingEvidenceor receipt verification.post_filing_kindcarries the fine-grainedPostFilingEventKindprocedural category (requerimiento, propuesta de liquidación, diligencia de embargo, …) classified from the pulled notification / expediente, so the coarseevent_typeaxis does not collapse a demand for documents and an informational comunicación onto the samemessagerow.- Parameters:
event_type (OverviewCalendarEventType)
post_filing_kind (PostFilingEventKind | None)
event_date (date)
source (str)
summary (str)
reference_id (str)
snapshot_id (str | None)
modelo (str | None)
filing_year (int | None)
period (Period | None)
status (str | None)
source_url (str | None)
authenticated_identity (str | None)
aeat_submission_state (OverviewAeatSubmissionState | None)
aeat_submitted_at (datetime | None)
justificante_verified (bool | None)
verified_justificante_csv (str | None)
- event_type: OverviewCalendarEventType¶
- post_filing_kind: _PostFilingEventKind | None¶
- event_date: date¶
- source: str¶
- summary: str¶
- reference_id: str¶
- snapshot_id: str | None¶
- modelo: str | None¶
- filing_year: int | None¶
- period: _Period | None¶
- status: str | None¶
- source_url: str | None¶
- authenticated_identity: str | None¶
- aeat_submission_state: OverviewAeatSubmissionState | None¶
- aeat_submitted_at: datetime | None¶
- justificante_verified: bool | None¶
- verified_justificante_csv: str | None¶
- class CalendarWarning(**data)[source]¶
Bases:
BaseModelOne under-specified-profile warning attached to a calendar query.
- code: str¶
- message: str¶
- fix_command: str¶
- affected_modelos: tuple[str, ...]¶
- class CalendarCompleteness(**data)[source]¶
Bases:
BaseModelBreakdown of explicit profile values versus deadline-engine defaults.
- Parameters:
- explicitly_set_keys: tuple[str, ...]¶
- defaulted_keys: tuple[str, ...]¶
- computable_modelos: tuple[str, ...]¶
- defaulted_modelos: tuple[str, ...]¶
- class SuppressedCalendarEntry(**data)[source]¶
Bases:
BaseModelOne non-applicable obligation retained by
--show-suppressed.- Parameters:
modelo (str)
period (Period)
verdict (ApplicabilityVerdict)
reason (str)
- modelo: str¶
- period: _Period¶
- verdict: ApplicabilityVerdict¶
- reason: str¶
- class OverviewCalendar(**data)[source]¶
Bases:
BaseModelResult of an
aeat app overview calendarquery.entriescontains legal filing windows,eventscontains additive local observations, andsuppressed_entriespreserves filtered applicability rows only when the caller explicitly requests them.coverageis the always-populated reconciliation of the full registry modelo set againstentries: itsadvisedbucket names every filing obligation the surface would otherwise have silently dropped, so a machine consumer never has to infer coverage from the presence or absence of a row.- Parameters:
range (OverviewCalendarRange)
entries (tuple[OverviewCalendarEntry, ...])
generated_at (datetime)
warnings (tuple[CalendarWarning, ...])
completeness (CalendarCompleteness)
taxpayer_model_declared (bool)
incomplete_reason (str | None)
suppressed_entries (tuple[SuppressedCalendarEntry, ...])
events (tuple[OverviewCalendarEvent, ...])
coverage (ObligationCoverageReport)
- range: OverviewCalendarRange¶
- entries: tuple[OverviewCalendarEntry, ...]¶
- generated_at: datetime¶
- warnings: tuple[CalendarWarning, ...]¶
- completeness: CalendarCompleteness¶
- taxpayer_model_declared: bool¶
- incomplete_reason: str | None¶
- suppressed_entries: tuple[SuppressedCalendarEntry, ...]¶
- events: tuple[OverviewCalendarEvent, ...]¶
- coverage: ObligationCoverageReport¶
- class OverviewStatusReport(**data)[source]¶
Bases:
BaseModelCurrent active-profile readiness counters for
overview status.Produced from
OperatorStateProjectionbyapplication.overview.overview_status_report_from_projection().- Parameters:
- active_profile: str | None¶
- active_profile_name: str | None¶
- transactions: int¶
- invoices: int¶
- drafts: int¶
- work_units: int¶
- discarded_work_units: int¶
- calculation_revisions: int¶
- unreadable_rows: int¶
- filing_obligation_advisories: tuple[str, ...]¶
- unsupported_work_create_modelos: tuple[str, ...]¶