cadrumo.application.overview._calendar_evidence_sources module¶
Source-specific reconciliation for calendar filing evidence.
These adapters project already-loaded local, filed-declaration, calculation, and justificante-capture observations. The calendar evidence facade owns precedence, merging, and event enrichment; this module owns source-shape validation and evidence-row construction.
- justificantes_by_csv(justificantes)[source]¶
Index loaded justificante metadata by CSV/reference identifier.
- Return type:
dict[str,tuple[Justificante,...]]- Parameters:
justificantes (tuple[Justificante, ...])
- justificante_csv_key(csv)[source]¶
Return the canonical lookup key for AEAT CSV identifiers.
Delegates to the one comparison form rather than restating it. This site previously casefolded, which produced a lowercase key that the canonical uppercase contract refuses – so one identifier had two keys depending on which surface built it.
- filing_evidence_from_modelo_record(record, *, justificantes_by_csv, expected_tax_id)[source]¶
Project one local Modelo filing record into calendar evidence.
Core types:
ModeloRecord.- Return type:
- Parameters:
record (ModeloRecord)
justificantes_by_csv (Mapping[str, tuple[Justificante, ...]])
expected_tax_id (str | None)
- filing_axes_from_modelo_record(record, *, justificantes_by_csv, expected_tax_id)[source]¶
Return the local and AEAT filing axes for one Modelo filing record.
Core types:
ModeloRecord.- Return type:
- Parameters:
record (ModeloRecord)
justificantes_by_csv (Mapping[str, tuple[Justificante, ...]])
expected_tax_id (str | None)
- filing_evidence_from_observed_event(event, *, expected_tax_id)[source]¶
Project an active filing event into AEAT-side obligation evidence.
- Return type:
- Parameters:
event (OverviewCalendarEvent)
expected_tax_id (str | None)
- filing_evidence_from_filed_declaration_observation(observation, *, expected_tax_id, verified_artefact_refs, verified_artefact_csv_by_ref)[source]¶
Project one captured filed-declaration observation into evidence.
The observation must belong to the expected authenticated identity and must be an active
ALTAregister row. Justificante verification is granted only when the storage layer has already verified and supplied the encrypted justificante artefact reference and CSV.- Return type:
- Parameters:
- is_active_aeat_filing_status(status)[source]¶
Return whether an AEAT register row represents the current accepted filing.
- filing_evidence_from_calculation_observation(payload, *, expected_tax_id, justificantes_by_csv)[source]¶
Project official calculation observations into AEAT-submitted evidence.
Only official AEAT source kinds with active register metadata are accepted. A matching loaded
Justificanteupgrades the row toOverviewAeatSubmissionState.JUSTIFICANTE_VERIFIED; otherwise the row remains submitted-observed evidence.- Return type:
- Parameters:
payload (ObservationEnvelopePayload)
expected_tax_id (str | None)
justificantes_by_csv (Mapping[str, tuple[Justificante, ...]])
- filing_evidence_from_justificante_capture_snapshot(snapshot, *, justificantes_by_csv, expected_tax_id)[source]¶
Project one verified live justificante capture into AEAT-side evidence.
The persisted snapshot is accepted only when it is active, carries a typed
Period, and resolves to loadedJustificantemetadata for the same filing target.- Return type:
- Parameters:
snapshot (JustificanteCaptureSnapshot)
justificantes_by_csv (Mapping[str, tuple[Justificante, ...]])
expected_tax_id (str | None)