Skip to content

URS-043 · Link shipments to orders with LOT numbers

Status: PASS  ·  Duration: 44s  ·  Run Date: April 21, 2026


PASS

Step 1: Orders list shows ZBO-2025-001


PASS

Step 2: BO detail shows both LOT numbers


PASS

Step 3: Packages list


PASS

Step 4: Package items reference source BO


Step 5: Tracking + carrier visible on shipment

Section titled “Step 5: Tracking + carrier visible on shipment”
PASS

Step 5: Tracking + carrier visible on shipment


PASS

Step 6: Package → Order reference


PASS

Step 6: BO detail LOTs re-confirmed

Bill-Only Order carries the expected LOT numbers

Section titled “Bill-Only Order carries the expected LOT numbers”
PASS

ZBO-2025-001 should own 2 line items with LOTs LOT-FL-2024-0334, LOT-SP-2024-0891, owned by the ZuriMED manufacturer org.

SELECT bo.order_number, bo.manufacturer_organization_id, boi.lot_number, op.sku AS product_sku
FROM billing_orders bo
JOIN billing_order_items boi ON boi.billing_order_id = bo.id
JOIN org_products op ON op.id = boi.product_id
WHERE bo.id = $1
ORDER BY boi.created_at, boi.id
order_numbermanufacturer_organization_idlot_numberproduct_sku
ZBO-2025-001a1b2c3d4-e5f6-7890-abcd-ef1234567890LOT-SP-2024-0891SP019N1A
ZBO-2025-001a1b2c3d4-e5f6-7890-abcd-ef1234567890LOT-FL-2024-0334FL516SNA

Shipping Package items reference the Bill-Only Order by text linkage

Section titled “Shipping Package items reference the Bill-Only Order by text linkage”
PASS

MAN-2025-0156 should have 2 items with order_number=ZBO-2025-001 and order_line_number ∈ (1, 2).

SELECT sp.manifest_id, spi.order_number, spi.order_line_number, spi.quantity
FROM shipping_packages sp
JOIN shipping_package_items spi ON spi.package_id = sp.id
WHERE sp.id = $1
ORDER BY spi.order_line_number
manifest_idorder_numberorder_line_numberquantity
MAN-2025-0156ZBO-2025-00115
MAN-2025-0156ZBO-2025-00123

Shipping Package surfaces carrier + tracking number

Section titled “Shipping Package surfaces carrier + tracking number”
PASS

MAN-2025-0147 should report tracking_number=775899342290, carrier=FedEx, status=in_transit.

SELECT manifest_id, tracking_number, carrier, status
FROM shipping_packages
WHERE id = $1
manifest_idtracking_numbercarrierstatus
MAN-2025-0147775899342290FedExin_transit

Section titled “Traceability join: BO ↔ Shipping Package links resolve to LOT-bearing rows”
PASS

Joining billing_order_items ↔ shipping_package_items on order_number should yield 4 rows (2 BO lines × 2 package lines for ZBO-2025-001), every row carrying a LOT, covering LOT-SP-2024-0891, LOT-FL-2024-0334.

SELECT bo.order_number,
boi.lot_number,
sp.manifest_id,
spi.order_line_number,
spi.quantity
FROM billing_orders bo
JOIN billing_order_items boi
ON boi.billing_order_id = bo.id
JOIN shipping_package_items spi
ON spi.order_number = bo.order_number
JOIN shipping_packages sp
ON sp.id = spi.package_id
WHERE bo.id = $1
AND sp.id = $2
ORDER BY spi.order_line_number, boi.created_at, boi.id
order_numberlot_numbermanifest_idorder_line_numberquantity
ZBO-2025-001LOT-SP-2024-0891MAN-2025-015615
ZBO-2025-001LOT-FL-2024-0334MAN-2025-015615
ZBO-2025-001LOT-SP-2024-0891MAN-2025-015623
ZBO-2025-001LOT-FL-2024-0334MAN-2025-015623