import { apiGet, apiPost } from "@/app/lib/clientApi"; import type { FulfilmentEvent } from "@/app/lib/types"; // Client for the fulfilment timeline (add-fulfilment-timeline). Calls only the portal's own // /api/fulfilment-events routes. Pass exactly one of orderUuid / deliveryOrderUuid to list. export function listFulfilmentEvents(q: { orderUuid?: string; deliveryOrderUuid?: string }): Promise { const key = q.orderUuid ? "orderUuid" : "deliveryOrderUuid"; return apiGet(`/api/fulfilment-events?${key}=${encodeURIComponent(q.orderUuid ?? q.deliveryOrderUuid ?? "")}`); } export function addFulfilmentNote(b: { orderUuid: string; deliveryOrderUuid?: string; note: string }): Promise { return apiPost("/api/fulfilment-events/note", b); }