aeat.domain.modelos._protocols module¶
Domain-level repository Protocols for the modelos aggregate.
Application-layer code that persists or loads modelo work-unit catalogues, filing records, calculation results, or verification reports depends on these Protocols, not on the concrete adapter-backed repository classes. This keeps the domain layer free of adapter imports while still providing typed port surfaces.
The work-unit, calculation-revision, filing-record, and verification-report
protocols return WorkUnitCatalogue,
CalculationRevisionCatalogue, ModeloRecordCatalogue, and
VerificationReportCatalogue instances while keeping application code
independent of concrete storage adapters.
- class WorkUnitCatalogueRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for the work-unit catalogue.
Any object that provides
exists,load, andsaveover a per-bucketWorkUnitCataloguesatisfies this protocol. The concrete secure-object-backed implementation isWorkUnitCatalogueRepository.- load()[source]¶
Return the persisted
WorkUnitCatalogueor an empty catalogue if absent.- Return type:
- save(catalogue)[source]¶
Persist
catalogueas the encrypted singleton object.- Return type:
- Parameters:
catalogue (WorkUnitCatalogue)
- class CalculationRevisionCatalogueRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for calculation revisions.
Any object that provides
exists,load, andsaveover a per-bucketCalculationRevisionCataloguesatisfies this protocol. The concrete secure-object-backed implementation isCalculationRevisionCatalogueRepository.- exists()[source]¶
Return whether a calculation-revision catalogue object has been persisted.
- Return type:
- load()[source]¶
Return the persisted catalogue or an empty catalogue if absent.
- Return type:
- Returns:
The
CalculationRevisionCatalogueloaded from storage.
- save(catalogue)[source]¶
Persist
catalogueas the encrypted singleton object.- Return type:
- Parameters:
catalogue (CalculationRevisionCatalogue)
- to_secure_object_write(catalogue)[source]¶
Return the
SecureObjectWriteforcataloguewithout committing it.- Return type:
- Parameters:
catalogue (CalculationRevisionCatalogue)
- save_with_secure_object_writes(catalogue, extra_writes)[source]¶
Persist
catalogueplus co-emitted secure-object writes atomically.- Return type:
- Parameters:
catalogue (CalculationRevisionCatalogue)
extra_writes (tuple[SecureObjectWrite, ...])
- class ModeloRecordCatalogueQueryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolQuery contract exposed by loaded modelo filing-record catalogues.
- current_for(*, bucket_id, modelo, filing_year, period, member_nif=None)[source]¶
Return the current
ModeloRecordfor a filing tuple and optional group member.
- class ModeloRecordCatalogueRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for modelo filing records.
Any object that provides
exists,load, andsaveover a per-bucketModeloRecordCataloguesatisfies this protocol. The concrete secure-object-backed implementation isModeloRecordCatalogueRepository. The loaded catalogue supports member-scopedcurrent_forandhistory_forlookups for grupo fan-in filings.- load()[source]¶
Return the persisted
ModeloRecordCatalogueor an empty catalogue if absent.- Return type:
- save(catalogue)[source]¶
Persist
catalogueas the encrypted singleton object.- Return type:
- Parameters:
catalogue (ModeloRecordCatalogue)
- to_secure_object_write(catalogue)[source]¶
Return the
SecureObjectWriteforcataloguewithout committing it.- Return type:
- Parameters:
catalogue (ModeloRecordCatalogue)
- save_with_secure_object_writes(catalogue, extra_writes)[source]¶
Persist
catalogueplus co-emitted secure-object writes atomically.- Return type:
- Parameters:
catalogue (ModeloRecordCatalogue)
extra_writes (tuple[SecureObjectWrite, ...])
- class VerificationReportCatalogueRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for verification reports.
Any object that provides
exists,load, andsaveover a per-bucketVerificationReportCataloguesatisfies this protocol. The concrete secure-object-backed implementation isVerificationReportCatalogueRepository.- exists()[source]¶
Return whether a verification-report catalogue object has been persisted.
- Return type:
- load()[source]¶
Return the persisted catalogue or an empty catalogue if absent.
- Return type:
- Returns:
The
VerificationReportCatalogueloaded from storage.
- save(catalogue)[source]¶
Persist
catalogueas the encrypted singleton object.- Return type:
- Parameters:
catalogue (VerificationReportCatalogue)
- class TransactionParticipationIndexRepositoryProtocol(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow domain-facing repository contract for the participation index.
The participation index is a per-transaction, derived-and-rebuildable read-side cache mapping a ledger transaction to the calculation revisions it participates in. Unlike the singleton catalogue repositories, its objects are keyed by
transaction_id. Any object that providesexists,load, andsaveover aTransactionRevisionParticipationIndexsatisfies this protocol; the concrete secure-object-backed implementation isTransactionParticipationIndexRepository. Lifecycle correctness never depends on this cache’s freshness — it is rebuilt from the revision catalogue — so the port is a navigation/read seam, not a source of truth.- exists(transaction_id)[source]¶
Return whether a participation-index object exists for
transaction_id.
- load(transaction_id)[source]¶
Return the persisted index for
transaction_idor an empty index if absent.- Return type:
- Parameters:
transaction_id (str)