cadrumo.application.workflow.review_models module

Canonical workflow event and review-record contracts.

class WorkflowEvent(**data)[source]

Bases: BaseModel

One operator-visible event emitted by a mutating workflow verb.

Events are appended to bucket_events so the operator can audit which actions ran, when, and against which object. action names the verb (e.g. "profile.created"); reason carries a free-form human-readable annotation; bucket_id and object_id are optional pointers to the affected resource.

Parameters:

data (Any)

action: str
reason: str
bucket_id: BucketId | None
object_id: str | None
at: datetime
class LedgerReviewRecord(**data)[source]

Bases: BaseModel

Workflow attention annotation for one persisted transaction.

Durable transaction facts are not stored here. Classification, category, business percentage, tax fields, evidence references, skip/final-disposition state, and corrections live on the bucket-scoped transaction catalogue.

Parameters:

data (Any)

transaction_id: TransactionId
history: tuple[WorkflowEvent, ...]
updated_at: datetime
class InvoiceReviewRecord(**data)[source]

Bases: BaseModel

Workflow annotations for one persisted invoice.

Parameters:

data (Any)

invoice_id: InvoiceId
fields: dict[str, str]
history: tuple[WorkflowEvent, ...]
updated_at: datetime