Append-only record of one order's finalization: the fact that this order,
with exactly these captured values, entered service.
orders is deliberately treated as current state and not as history: it
keeps the present fulfillment status and, from MVP-TASK-024, the currently
edited queue number and note. Because those columns are mutable by design,
they cannot be the only record of what the order originally was, so this
table stores the as-finalized classification, fulfillment metadata, and
queue-entry time and is protected by a BEFORE UPDATE OR DELETE trigger.
Delivering, correcting, or later editing an order therefore adds new facts
elsewhere without ever rewriting this one.
finalized_at is stamped by the database in the same transaction that
inserts the orders row, so it is the same transaction time as
orders.created_at and as the first fulfillment transition can be compared
against. It is not a client clock.
Item snapshots are not duplicated here: order_items already stores the
immutable per-product facts and quantities captured at finalization.
Append-only record of one order's finalization: the fact that this order, with exactly these captured values, entered service.
ordersis deliberately treated as current state and not as history: it keeps the present fulfillment status and, from MVP-TASK-024, the currently edited queue number and note. Because those columns are mutable by design, they cannot be the only record of what the order originally was, so this table stores the as-finalized classification, fulfillment metadata, and queue-entry time and is protected by aBEFORE UPDATE OR DELETEtrigger. Delivering, correcting, or later editing an order therefore adds new facts elsewhere without ever rewriting this one.finalized_atis stamped by the database in the same transaction that inserts theordersrow, so it is the same transaction time asorders.created_atand as the first fulfillment transition can be compared against. It is not a client clock.Item snapshots are not duplicated here:
order_itemsalready stores the immutable per-product facts and quantities captured at finalization.