aeat.domain.buckets package¶
Public facade for bucket-scoped append-only event history.
A bucket is the storage slice associated with the active profile.
Material workflow transitions (modelo calculation / verification /
filing, ledger imports, profile lifecycle, etc.) emit immutable
BucketEvent records into a bucket-scoped history so the
operator can reconstruct how current state was reached, not only
what it is now. The history is audit context, not the source of
relational truth for ledger, profile, modelo, or filing state.
Those domains keep their current-state catalogues; bucket history preserves the
structured transition record and object references that tie them together.
Each BucketEvent is content-addressed by bucket id,
BucketEventType, occurrence time, actor,
BucketEventObjectType, object id, and payload. payload_version
tracks the per-event payload contract, while the closed event and object
taxonomies prevent emitters from persisting ad-hoc strings.
Public surface:
BucketEvent— one append-only event record.BucketEventType— closed catalogue of event kinds.BucketEventObjectType— closed catalogue of affected object kinds.BucketEventHistoryCatalogue— frozen mapping of every event in storage, with bucket / object / type queries.BucketEventHistoryRepositoryProtocol— narrow read/write port over the catalogue; the concrete encrypted-SQL implementation (adapters.persistence.profile.buckets.BucketEventHistoryRepository) lives in the persistence adapter and stores aFINANCIALadapters.persistence.storage.Envelopesingleton throughadapters.persistence.storage.SecureObjectRepository.derive_bucket_event_id()— deterministic SHA-256 event id.append_bucket_event()— pure helper to insert one event into a catalogue (idempotent on identical content).
The adapter repository also exposes a to_secure_object_write method so
sibling catalogue updates can co-emit the same encrypted event-history write.
Ordinary operators consume this history through profile and application services
such as application.bucket_maintenance; this domain facade does not create
an operator-facing bucket command root.
See also
BucketEventAppend-only event record emitted by workflow, modelo, ledger, profile, and bucket-maintenance transitions.
BucketEventHistoryRepositoryProtocolNarrow read/write port for the append-only history; its concrete encrypted per-bucket implementation lives in the persistence adapter.
BucketEventHistoryPersistenceErrorStorage-boundary error raised when the encrypted catalogue cannot be loaded or persisted safely.
application.bucket_maintenanceApplication facade that composes profile lifecycle operations and emits bucket-maintenance events through this domain history.
application.workflowActive-profile state and bucket-pointer workflows that provide the current storage slice observed by bucket event consumers.
application.modeloWork-unit calculation, verification, filing, import, export, and reconciliation services that emit modelo events while persisting modelo catalogues separately.
application.ledgerLedger transaction lifecycle that emits bucket events for imports, edits, classifications, evidence attachment, and removal.
application.invoicesInvoice import, reconciliation, and ledger-link workflows whose events reference invoice and transaction objects without replacing catalogues.
Submodules¶
- aeat.domain.buckets._errors module
- aeat.domain.buckets._event module
BucketActorLabelBucketEventTypeBucketEventType.MODELO_CALCULATION_CREATEDBucketEventType.MODELO_VERIFICATION_PASSEDBucketEventType.MODELO_VERIFICATION_REFUSEDBucketEventType.MODELO_FILEDBucketEventType.MODELO_FILED_SUPERSEDEDBucketEventType.MODELO_AMENDEDBucketEventType.MODELO_FILING_IMPORTEDBucketEventType.MODELO_LIVE_EVIDENCE_STAMPEDBucketEventType.MODELO_RECONCILEDBucketEventType.MODELO_EXPORTEDBucketEventType.MODELO_IVA_WALLET_CORRECTEDBucketEventType.MODELO_IVA_WALLET_OVERRIDE_RECORDEDBucketEventType.MODELO_145_COMMUNICATION_CREATEDBucketEventType.MODELO_145_COMMUNICATION_EXPORTEDBucketEventType.MODELO_145_COMMUNICATION_DELIVERED_TO_PAYERBucketEventType.MODELO_145_COMMUNICATION_LOCALLY_COMPLETEDBucketEventType.MODELO_WORK_UNIT_CREATEDBucketEventType.MODELO_WORK_UNIT_DISCARDEDBucketEventType.MODELO_WORK_UNIT_RENAMEDBucketEventType.PROFILE_BUCKET_CREATEDBucketEventType.PROFILE_SELECTEDBucketEventType.PROFILE_VALUES_UPDATEDBucketEventType.PROFILE_VALUES_CLEAREDBucketEventType.PROFILE_TOMBSTONEDBucketEventType.PROFILE_REACTIVATEDBucketEventType.PROFILE_DUPLICATEDBucketEventType.PROFILE_RENAMEDBucketEventType.PROFILE_EXPORTEDBucketEventType.PROFILE_IMPORTEDBucketEventType.PROFILE_ACTIVATEDBucketEventType.CENSO_REFRESHEDBucketEventType.CENSO_APPLIEDBucketEventType.CENSO_DEPENDENT_STAMPED_STALEBucketEventType.MODELO_LEDGER_DEPENDENT_STAMPED_STALEBucketEventType.CENSO_DECLARATION_ALTABucketEventType.CENSO_DECLARATION_MODIFICACIONBucketEventType.CENSO_DECLARATION_BAJABucketEventType.BUCKET_EXPORTEDBucketEventType.BUCKET_IMPORTEDBucketEventType.BUCKET_RENAMEDBucketEventType.BUCKET_DELETEDBucketEventType.BUCKET_ARCHIVEDBucketEventType.BUCKET_RESTOREDBucketEventType.BUCKET_MERGEDBucketEventType.LEDGER_RATIOS_SETBucketEventType.LEDGER_RATIOS_UNSETBucketEventType.LEDGER_RATIOS_CENSO_OVERRIDE_WARNINGBucketEventType.AUTH_PROVIDER_CONFIGUREDBucketEventType.CONFIG_ENV_UPDATEDBucketEventType.AUTH_CERTIFICATE_SOURCE_REGISTEREDBucketEventType.AUTH_CERTIFICATE_SOURCE_SELECTEDBucketEventType.AUTH_CERTIFICATE_SOURCE_REMOVEDBucketEventType.AUTH_CERTIFICATE_SOURCE_SECRET_SETBucketEventType.AUTH_CERTIFICATE_SOURCE_SECRET_ROTATEDBucketEventType.AUTH_CERTIFICATE_SOURCE_SECRET_REMOVEDBucketEventType.LEDGER_TRANSACTION_CREATEDBucketEventType.LEDGER_TRANSACTION_IMPORTEDBucketEventType.LEDGER_IMPORT_DIAGNOSTIC_RECORDEDBucketEventType.LEDGER_TRANSACTION_UPDATEDBucketEventType.LEDGER_TRANSACTION_CLASSIFIEDBucketEventType.LEDGER_TRANSACTION_LLM_SUGGESTION_REJECTEDBucketEventType.LEDGER_TRANSACTION_ALLOCATEDBucketEventType.LEDGER_TRANSACTION_REMOVEDBucketEventType.LEDGER_TRANSACTION_ARCHIVEDBucketEventType.LEDGER_TRANSACTION_STASHEDBucketEventType.LEDGER_TRANSACTION_RESTOREDBucketEventType.LEDGER_TRANSACTION_REVIEWED_EXCLUDEDBucketEventType.LEDGER_TRANSACTION_EXPORTEDBucketEventType.LEDGER_TRANSACTION_SPLITBucketEventType.LEDGER_TRANSACTION_MERGEDBucketEventType.LEDGER_CATALOGUE_RESETBucketEventType.LEDGER_SANITIZATION_COMPLETEDBucketEventType.PURCHASE_INVOICE_EVIDENCE_ATTACHEDBucketEventType.PURCHASE_INVOICE_EVIDENCE_REPLACEDBucketEventType.PURCHASE_INVOICE_EVIDENCE_DETACHEDBucketEventType.PAYABLE_INVOICE_CREATEDBucketEventType.PAYABLE_INVOICE_UPDATEDBucketEventType.PAYABLE_INVOICE_REMOVEDBucketEventType.COLLECTIBLE_INVOICE_CREATEDBucketEventType.COLLECTIBLE_INVOICE_UPDATEDBucketEventType.COLLECTIBLE_INVOICE_REMOVEDBucketEventType.LEDGER_INVENTORY_CREATEDBucketEventType.LEDGER_INVENTORY_MOVEMENT_ADDEDBucketEventType.LEDGER_INVENTORY_VALUATION_PREVIEWEDBucketEventType.LEDGER_INVENTORY_REMOVEDBucketEventType.MODELO_AUDIT_VERIFIEDBucketEventType.MODELO_AUDIT_EXPORTEDBucketEventType.MODELO_AUDIT_REPLAYEDBucketEventType.LIVE_NOTIFICATIONS_SNAPSHOT_CAPTUREDBucketEventType.LIVE_EXPEDIENTES_SNAPSHOT_CAPTUREDBucketEventType.LIVE_VERIFY_NIF_IVA_CHECKEDBucketEventType.LIVE_VERIFY_TGVI_CHECKEDBucketEventType.LIVE_BORRADOR100_SNAPSHOT_CAPTUREDBucketEventType.ATTACHMENT_LINKEDBucketEventType.ATTACHMENT_REMOVEDBucketEventType.WORKFLOW_STATE_RESETBucketEventType.LEDGER_TRANSACTION_CORRECTION_APPLIEDBucketEventType.LEDGER_PURCHASE_INVOICE_EVIDENCE_CORRECTION_APPLIEDBucketEventType.LEDGER_PAYABLE_INVOICE_CORRECTION_APPLIEDBucketEventType.LEDGER_COLLECTIBLE_INVOICE_CORRECTION_APPLIEDBucketEventType.LEDGER_RENTAL_INCOME_CORRECTION_APPLIEDBucketEventType.LEDGER_RENTAL_EXPENSE_CORRECTION_APPLIEDBucketEventType.COLLAB_RECIPIENT_REGISTEREDBucketEventType.COLLAB_RECIPIENT_REMOVEDBucketEventType.COLLAB_PACKAGE_ENCRYPTED_FOR_RECIPIENTBucketEventType.COLLAB_PACKAGE_DECRYPTEDBucketEventType.COLLAB_REVIEW_ONLY_WORKSPACE_OPENEDBucketEventType.COLLAB_PACKAGE_COUNTER_SIGNED
BucketEventObjectTypeBucketEventObjectType.WORK_UNITBucketEventObjectType.CALCULATION_REVISIONBucketEventObjectType.VERIFICATION_REPORTBucketEventObjectType.FILING_RECORDBucketEventObjectType.COMMUNICATION_RECORDBucketEventObjectType.PROFILEBucketEventObjectType.BUCKETBucketEventObjectType.LEDGER_TRANSACTIONBucketEventObjectType.LEDGER_IMPORT_BATCHBucketEventObjectType.LEDGER_CATALOGUEBucketEventObjectType.LEDGER_EXPORTBucketEventObjectType.PURCHASE_INVOICE_EVIDENCEBucketEventObjectType.PAYABLE_INVOICEBucketEventObjectType.COLLECTIBLE_INVOICEBucketEventObjectType.ATTACHMENTBucketEventObjectType.WORKFLOW_STATEBucketEventObjectType.RECIPIENT
derive_bucket_event_id()BucketEventBucketEventHistoryCatalogue
- aeat.domain.buckets._event_repository module
- aeat.domain.buckets._protocols module