import type { PoolClient } from 'pg'; import { pool } from '../../../../lib/postgres/connection.js'; import type { ShipmentRow, ShipmentItemRow } from '../../../../types/db/index.js'; import type { OrderShipmentRollup } from '../../types/orderShipmentRollup.js'; export interface ShipmentWithItems extends ShipmentRow { items: ShipmentItemRow[]; } export interface UnshippedItem { order_item_id: number; uuid: string; product_sku: string; product_name: string; qty_ordered: number; qty_unshipped: number; } /** * Return every shipment on the order with its items embedded. Ordered by * `created_at ASC, shipment_id ASC` so consumers get deterministic order — the * deprecated singular `Order.shipment` resolver picks `[0]`. */ export declare function getShipmentsForOrder(orderIdOrUuid: number | string, connection?: PoolClient | typeof pool): Promise; /** * Items that still have remaining qty to ship — joined against * non-canceled-non-pending shipment_item rows. `pending` and `canceled` * shipments contribute zero, so their items count as unshipped (canceled * shipments release their items back to the pool; pending shipments are * pre-pack and haven't actually shipped yet). * * Filtered to `no_shipping_required = false` so digital items NEVER appear — * the admin UI driving createShipment never has the chance to try shipping * them. */ export declare function getUnshippedItems(orderIdOrUuid: number | string, connection?: PoolClient | typeof pool): Promise; /** * Compute the order's rolled-up shipment status (one of the six * `OrderShipmentRollup` values). Pure read; same answer the cached * `order.shipment_status` column should hold if recomputes have kept up. */ export declare function getOrderShipmentRollup(orderIdOrUuid: number | string, connection?: PoolClient | typeof pool): Promise;