# inboundShipmentOpenQuantities

## Overview

BFF query that returns all inbound shipments enriched with total open (remaining) quantity. For each inbound shipment, computes the sum of remaining unreceived quantities across its PO-linked lines: `ordered − sum(received from POSTED inbound shipments)`. Used by the inbound shipment list screen to show delivery progress without expensive nested GQL traversal.

## Modules Commands Used

None (read-only query).

## Exception Handling

None — returns empty `items` array if no inbound shipments exist.

## Return

Returns `{ items: [...] }` where each item has:

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Inbound shipment ID |
| `docNumber` | string | Inbound shipment document number (currently always `""` due to TailorDB serial field constraint on pre-existing records) |
| `status` | string | Inbound shipment status (e.g. `DRAFT`, `POSTED`, `CANCELLED`) |
| `supplierName` | string | Supplier business partner name |
| `poReference` | string | Linked purchase order ID (from first PO-linked line) |
| `receiptDate` | string | Receipt date in `YYYY-MM-DD` format |
| `lineCount` | string | Number of lines on the inbound shipment |
| `totalOpenQuantity` | string | Total remaining unreceived quantity across all PO-linked lines |
