import type { PoolClient } from 'pg'; /** * Multi-shipment refactor — Phase A1 (additive only). * * Splits the legacy 1:1 `order ↔ shipment` model into a one-to-many model where * each shipment carries its own status and the set of order items it contains. * * Adds: * - shipment.status, shipped_at, delivered_at, canceled_at columns * - shipment_item junction table (shipment × order_item × qty) * * Backfills: * - shipment.status from order.shipment_status (1:1 invariant, legacy) * - shipment.{shipped_at, delivered_at, canceled_at} from shipment.created_at / * updated_at, approximated by the order's stored shipment_status * - shipment_item rows for every existing (shipment × shippable order_item) pair * at full qty. Digital items (no_shipping_required = true) are skipped — they * don't belong in shipment_item per the new model. All-digital orders had a * vestigial shipment row created by the legacy `createShipmentForVirtualProductsOrder` * hook; those shipments end up with zero shipment_item rows, which is fine * because the rollup math short-circuits on items count. * * NO drops in this migration. `order.shipment_status` stays in place until Z1. * * See wiki/multi-shipment-design.md → "Schema" + "Migration plan" Phase A1. */ declare const _default: (connection: PoolClient) => Promise; export default _default;