aeat.domain.attachments package¶
Public facade for content-addressed attachment evidence.
This package owns the immutable Attachment manifest and in-memory
AttachmentCatalogue records used by ledger and filing evidence flows.
Each manifest is keyed by the stored bytes’ SHA-256
(attachment_id == sha256) and records AttachmentKind,
AttachmentSource, the source reference, MIME type, byte size, capture
timestamp, owning bucket, linked transaction/invoice ids, metadata, and notes.
Link-only URI-list manifests are rejected: an attachment evidence record must
represent document bytes, not an external pointer.
Persistence is a protocol boundary. Domain helpers accept an
AttachmentStoreProtocol; the concrete
adapters.persistence.storage.AttachmentStore lives in the
adapter layer and stores encrypted blob rows plus manifest
adapters.persistence.storage.Envelope rows through
adapters.persistence.storage.SecureObjectRepository at FINANCIAL
adapters.persistence.storage.SensitivityClass.
This package does not own a plaintext or on-disk repository implementation.
Service helpers add_attachment() and add_attachment_bytes() hash
file or in-memory bytes, write them through the supplied store, build the
manifest, and persist it; load_attachment() and
list_attachments() read manifests back through the same protocol.
link_attachment_invoice() re-persists an already-stored manifest with an
invoice id appended to Attachment.linked_invoice_ids, for the case
where the invoice is minted only after the evidence is already captured
(e.g. confirming an extracted invoice draft).
DocumentLinkSource narrows operator doclink channels, but a document
link must be resolved to bytes before add_attachment_bytes(); there is no
link-only attachment path.
Callers must import public models, errors, enums, protocols, and service
helpers from aeat.domain.attachments and must not reach into private
underscore modules inside this package.
See also
application.ledgerLedger lifecycle that verifies attachment existence, byte custody, and bucket ownership before a transaction claims attachment evidence.
domain.invoicesPurchase-invoice evidence records that remain distinct from generic encrypted attachment bytes while sharing ledger evidence workflows.
application.aggregationCalculation-source and evidence-advisory surfaces that consume transaction evidence links without reading plaintext files from disk.
adapters.persistence.storageSecure-object and encrypted blob storage that implements
AttachmentStoreProtocol.
Submodules¶
- aeat.domain.attachments._enums module
- aeat.domain.attachments._errors module
- aeat.domain.attachments._ids module
- aeat.domain.attachments._models module
is_link_only_mime_type()AttachmentAttachment.attachment_idAttachment.kindAttachment.sourceAttachment.source_referenceAttachment.sha256Attachment.mime_typeAttachment.bytes_sizeAttachment.captured_atAttachment.linked_transaction_idsAttachment.linked_invoice_idsAttachment.bucket_idAttachment.captured_byAttachment.source_commandAttachment.metadataAttachment.notes
AttachmentCatalogue
- aeat.domain.attachments._protocols module
- aeat.domain.attachments._service module