# TODOs

Deferred work items tracked from plan reviews and implementation.

---

## Lost Shipments: Document Upload (V2)

**What:** Add `LostShipmentDocuments.jsx` component + `POST /admin/lost-shipments/:id/upload` S3 upload endpoint to allow attaching proof-of-shipment, value declarations, and other supporting documents to lost shipment cases.

**Why:** Carrier claims require supporting documents. Without this, staff must track documents outside Arda, breaking the single-pane-of-glass goal.

**Pros:** Complete claim workflow in one place. The `documents` JSONB column already exists in the schema — just needs UI + upload endpoint.

**Cons:** Requires new S3 bucket config, IAM permissions, upload endpoint, presigned URL flow. Estimated ~2-3 days.

**Context:** `EyeTracking.ts` has a reusable S3 presigned URL pattern (`@aws-sdk/client-s3` + `@aws-sdk/s3-request-presigner`). `UploadHandler.ts` has multer disk storage middleware. The `documents` field on `BigLostShipmentCase` is typed as `LostShipmentDocument[]` and stored as JSONB — ready to populate when the UI is built.

**Depends on:** Lost Shipments V1 shipped.

---

## FabricatorDatabase: Refactor list methods to use PostgresUtils.SearchQuery

**What:** Refactor `getDHLInvoices`, `getDHLCharges`, `getDHLChargeFlags`, `getBigShipments`, `getBigOrders`, and similar list methods to use the existing `PostgresUtils.SearchQuery` helper instead of duplicating WHERE-clause builder boilerplate.

**Why:** 6+ methods duplicate the same pattern: `if (params.X) { queries.push(...); values.push(...); }`. Each new feature adds another copy. `PostgresUtils.SearchQuery` (FabricatorDatabase.ts line 68) already does this generically.

**Pros:** DRY, less code to maintain, new features get filtering for free. Consistent with `getLostShipmentCases` which uses SearchQuery.

**Cons:** Risk of regressions in existing methods. Estimated ~1 day to refactor + verify with existing tests.

**Context:** The `getLostShipmentCases` method uses `SearchQuery` for equality filters (per plan review Issue 4), creating inconsistency with older methods that do it manually.

**Depends on:** Nothing — can be done anytime. Low priority.
