aeat.application.review._aggregator module¶
Cross-source review-queue aggregator.
Provides ReviewQueue, which combines the per-source adapters
in aeat.application.review._adapters into one deterministically
sorted tuple of aeat.application.review.ReviewItem values.
- class ReviewQueue[source]¶
Bases:
objectStatic collector that aggregates pending review items across sources.
Combines the per-source adapters (
transactions_pending(),invoices_pending(),drafts_pending()) into one deterministically sorted tuple. Severity is the primary sort key;sinceanditem_idprovide stable tiebreakers.- static collect(settings, *, bucket_id, kinds=None, modelo=None, state=ReviewState.PENDING, confidence_below=None)[source]¶
Return every pending review item that matches the filters.
- Parameters:
settings (
Settings) – Loadedaeat.core.config.Settings.bucket_id (
str) – Active bucket identifier used to scope the query to the correct operator profile.kinds (
frozenset[ReviewItemKind] |None) – Optional set ofReviewItemKindto include.None(default) means every kind. The argument is afrozensetso callers cannot mutate it after passing.modelo (
str|None) – Optional modelo filter. When set, items whose wrapped record has no modelo concept are excluded.state (
ReviewState) –ReviewState.PENDING(default) orReviewState.ALL.ALLreturns the same set asPENDINGwhile the adapters emit pending review items.confidence_below (
Decimal|None) – Optional decision-confidence threshold. When set, the queue replaces the default transactions-pending source withtransactions_low_confidence(): classified transactions whoseclassification_confidenceis non-None and strictly less than the threshold. Other review kinds (invoices, findings) cannot satisfy a decision-confidence predicate and are excluded while this filter is active.
- Return type:
tuple[TransactionReviewItem|InvoiceReviewItem|FindingReviewItem,...]- Returns:
A tuple sorted by
(severity desc, since asc, item_id asc).