feat(warehouses): gate double-handling fee on a per-booking Yes/No

Double handling billed every import with a matching rule. Add
bookings.double_handling (+ set_at/by), charge only when Yes, expose a
PATCH endpoint (import-only, locked after invoicing, audited) and Yes/No
items in the inventory row menu.
This commit is contained in:
Hagernesh
2026-07-25 10:44:41 +00:00
parent 43b053bf71
commit 6983645347
10 changed files with 280 additions and 2 deletions

View File

@@ -334,6 +334,13 @@ export const warehouseService = {
deliver: (id: string, payload: DeliverInventoryPayload) =>
apiClient.post<WarehouseInventoryItem>(URL_CONSTANTS.WAREHOUSE_INVENTORY.DELIVER(id), payload),
/** Post-unloading Yes/No — Yes makes the double-handling fee rule bill this booking. */
setDoubleHandling: (bookingId: string, doubleHandling: boolean) =>
apiClient.patch<{ bookingId: string; doubleHandling: boolean; setAt: string }>(
`/warehouse-inventory/bookings/${bookingId}/double-handling`,
{ doubleHandling },
),
// ── Receive (Import/Export bulk) ─────────────────────────────────────────
eligibleBookings: (direction?: 'IMPORT' | 'EXPORT') =>
apiClient.get<EligibleBooking[]>(URL_CONSTANTS.WAREHOUSE_INVENTORY.ELIGIBLE_BOOKINGS(direction)),