Wayfinder / Case study / Topic detail

Source-derived document; reported behaviour, inference and evidence gaps are identified in the text.

Return to: 4. Journeys and State Machines — topic detail

Order record

In this document

Lifecycle: Order record

An order contains an order number, order date, customer number, instructions, backlog indicator, purchase-order number, ship date, ship weight, ship charge, and paid date. The order-entry forms also expose customer details and repeated item lines. orderform.per gives orders.order_date a default of TODAY; its form-only f019 field is a MONEY running total that includes tax and shipping charges. E0009

Query obtains a customer, iterates through that customer’s orders, displays each order and its items, and lets the user select an order by entering y. Modify is allowed only when chosen = 1; otherwise it displays No order has been chosen. When allowed, it can update dates and replace the order’s items. Delete likewise requires chosen = 1, asks for confirmation, deletes the selected order and its items when the answer is y, and resets chosen to 0. E0009

The order deletion sequence is potentially inconsistent with referential integrity. delete_order() deletes from orders before deleting matching rows from items. If items.order_num references orders.order_num without cascading behavior, the parent deletion may fail. No schema or constraint definitions were supplied, so this remains conditional. The source also shows no explicit transaction or SQL-status handling around the deletion or analogous item-replacement logic, leaving possible partial-state behavior dependent on database and runtime semantics. E0010