aeat.application.review._adapters module¶
Read-only source adapters for the unified review queue.
Each adapter loads pending items from one on-disk source and emits a
tuple of typed ReviewItem records. Adapters are pure and
stateless; they tolerate missing source files by returning an empty
tuple. Severity is derived per source via a first-match-wins predicate table.
The transaction adapter loads a TransactionCatalogue via
TransactionCatalogueRepository; the invoice adapter loads an
InvoiceCatalogue via InvoiceCatalogueRepository. Draft
findings are sourced from the ModeloDraft store via the review imports.
- transactions_pending(settings, *, bucket_id, catalogue=None)[source]¶
Return one
TransactionReviewItemper pending-review transaction.catalogueis an optionalTransactionCatalogueoverride; the repository is loaded whenNone.Skips fully-classified rows (BUSINESS / PERSONAL / MIXED), rows explicitly skipped by rule (
SKIPPED_BY_RULE), and rows the operator reviewed and deliberately excluded (REVIEWED_EXCLUDED) — those have a final disposition and do not want the operator’s attention.- Return type:
- Parameters:
settings (Settings)
bucket_id (str)
catalogue (TransactionCatalogue | None)
- transactions_low_confidence(settings, *, bucket_id, threshold, catalogue=None)[source]¶
Return transactions whose decision confidence sits below a threshold.
- Parameters:
settings (
Settings) – Active application settings.bucket_id (
str) – Stable bucket identifier for the ledger to inspect.threshold (
Decimal) – Minimum acceptable confidence; transactions strictly below this value are included.catalogue (
TransactionCatalogue|None) – OptionalTransactionCatalogueoverride; whenNonethe catalogue is loaded from the encrypted store.
- Return type:
Surfaces every transaction whose
classification_confidenceis non-None and strictly less than the threshold, regardless of classification state. Transactions withNoneconfidence are excluded because they have no claim to filter against.Each element in the returned tuple is a
TransactionReviewItem.
- invoices_pending(settings, *, bucket_id, catalogue=None)[source]¶
Return
InvoiceReviewItemrecords for unmatched / disputed / pending invoices.- Parameters:
settings (
Settings) – Active application settings.bucket_id (
str) – Stable bucket identifier for the invoice catalogue to inspect.catalogue (
InvoiceCatalogue|None) – OptionalInvoiceCatalogueoverride; the repository is loaded whenNone.
- Return type:
- drafts_pending(settings, *, bucket_id, drafts=None)[source]¶
Return
FindingReviewItemrecords for findings + unready drafts.- Parameters:
settings (
Settings) – Active application settings.bucket_id (
str) – Stable bucket identifier for the draft repository to inspect.drafts (
tuple[tuple[Path,ModeloDraft],...] |None) – Optional pre-loaded sequence of(path, draft)pairs where each draft is aModeloDraft; whenNonedrafts are loaded from that bucket’s secure storage.
- Return type:
A draft whose
profile_tax_iddoes not match the active profile’s tax id is not the active profile’s data and is skipped. Callers see only drafts owned by the active profile.