Skip to main content

BusinessTransaction

A BusinessTransaction is a unified business document. The same model represents rentals, purchase orders, transfers, RMAs, and sales — the kind field discriminates.

FieldTypeNotes
idinteger
kindenumRENTAL, PURCHASE_ORDER, TRANSFER, RMA, SALE, QUARANTINE
numberstringTenant-scoped sequence (e.g. RNT-2026-00042)
current_statestringFrom the configured state machine
from_party_idintegerSource party (role depends on kind)
to_party_idintegerDestination party
from_location_idinteger
to_location_idinteger
expected_attimestampWhen fulfilment is expected
due_attimestampDue/return date
completed_attimestampWhen the lifecycle ended
metadataobjectPer-vertical fields

Lines

Each transaction has one or more business_transaction_lines:

FieldTypeNotes
product_idintegerThe "what"
instance_idintegerOptional — pinned to a specific instance
requested_qtynumberWhat was asked for
allocated_qtynumberWhat the allocator picked (projection)
fulfilled_qtynumberWhat was actually moved (projection)
returned_qtynumberFor rentals (projection)
lost_qtynumberFor rentals (projection)

Lifecycle

The lifecycle (states + allowed transitions) is defined per tenant per kind in a configurable state machine. Default machines are shipped in the vertical packs and can be overridden per tenant.

Mapping by kind

Kindfrom_partyto_partyWhat it means
RENTALtenantrenterItems rented out
PURCHASE_ORDERsuppliertenantItems ordered in
TRANSFERtenanttenantInternal location move
RMArenter / customertenantReturn / replacement
SALEtenantcustomerOne-way sale
QUARANTINEtenanttenantHeld pending QC (pharma)