cadrumo.application.ledger.review_advisories module

One enumeration of everything a pending draft carries that blocks nothing.

Two advisories exist over a draft — the party-attribution one and the country-vocabulary one — and each already knows how to say its own piece on the one-document surface. What neither could say is the thing a QUEUE needs: not the prose, but which KINDS this document carries, as a closed value a caller can count, group and filter on.

The queue is where a non-blocking condition is either seen or lost. An operator who never opens a document never meets an advisory attached only to review view, and the conditions on this axis are exactly the ones that reach the record without stopping anything — so “reachable from the detail view” is indistinguishable from unreachable for any document the operator had no reason to open. Counting them on the queue row is what makes the reason to open it.

One authority, two consumers. The queue and the one-document surface derive their kinds from this function rather than each classifying the advisories themselves. A second derivation is a second answer: a queue that decides a draft carries an attribution advisory while the detail view shows none sends the operator to a document to look for something that is not there, and they stop trusting the count.

The kinds are counted, never merged. A code only a registry commit can close and a typo the operator fixes off the page are different work, and a single has-advisories flag would make an operator who can only do one of them unable to find the documents they can act on.

See also

party_attribution_advisory()

The attribution advisory this projects.

country_vocabulary_advisory()

The country-vocabulary advisory this projects.

ReviewAdvisoryKind

The closed axis the kinds are drawn from.

ConfirmationBlockReason

The blocking sibling axis, which answers the other half of a queue row.

review_advisory_kinds(draft, *, operation)[source]

Return every non-blocking advisory kind one pending draft carries.

Parameters:
  • draft (InvoiceDraft) – The pending draft, exactly as the review surfaces hold it.

  • operation (PinnedAuthorityOperation) – Caller-owned pinned authority operation retained by both advisory projections.

Returns:

the attribution kind first, then the country kinds in the axis’s own declaration order. Empty when the draft carries nothing advisory, which is an honest empty rather than a claim that the draft was not checked.

Return type:

The kinds present, each at most once and in a stable order

Raises:

IvaCatalogueError – When the bundled country vocabulary cannot be read, propagated on the terms the country advisory states — a corrupt bundled table is a defect, not an unadvised draft.