ORD-000001
Paid Invoice INV-000001| Item | Unit price | Qty | Line |
|---|---|---|---|
| Nanosecond (11.8 inches of wire) (live listing) | $4.00 | 20 | $80.00 |
| On Computable Numbers (annotated) (live listing) | $32.00 | 1 | $32.00 |
| Total | $112.00 |
Unit prices and titles are snapshots — copies of the product's Money and Text at checkout — so a later price change leaves this order alone.
Ships to
12 Ada Lovelace Ln
Perth WA 6000
AU
Billed to
PO Box 1815
Perth WA 6001
AU
History — the State component's transitions log
How this works
Checkout copied the customer's shipping and billing addresses into this order's own
Address slots, and each product's title and price onto the order's lines. These are
copies, not links, so editing the product or the profile later leaves this order alone.
Mark shipped transitions the State in slot fulfilment,
which appends to its transitions log. Checkout's request key is stored here too, but this
page never shows it, so it is never read.
The declaration · app/entities/order.rb
component Identifier, prefix: :checkout_request
component Identifier, prefix: :order_number # order.order_number
component Money, prefix: :total # order.total_money
component State, prefix: :fulfilment, states: STATES # order.fulfilment_state
component Address, prefix: :shipping # order.shipping_address
component Address, prefix: :billing # order.billing_address
relates_to :customer, User
has_many :items, "OrderItem", via: :order, dependent: :destroy # order.items
has_one :invoice, via: :order # order.invoice
The rows behind it
| Where | Row |
|---|---|
entities |
|
identifiers
slot checkout_request
|
Not read by this page, so not queried |
identifiers
slot order_number
|
|
monies
slot total
|
|
states
slot fulfilment
|
|
addresses
slot shipping
|
|
addresses
slot billing
|
|
relationships
slot customer
|
|
Every slot row also has id, entity_id (this
entity's id) and timestamps. Ids are cut to their first block. The rows are the ones this page loaded,
so the panel adds no queries.