From 9da48bd61a4f1283ebb1b2f3a12a8d1290912e19 Mon Sep 17 00:00:00 2001 From: Hagernesh Date: Tue, 21 Jul 2026 12:13:57 +0000 Subject: [PATCH] fix --- .../src/modules/warehouses/warehouse-inventory.service.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/edr-freight-api/src/modules/warehouses/warehouse-inventory.service.ts b/apps/edr-freight-api/src/modules/warehouses/warehouse-inventory.service.ts index 7e03eb6a2..50c71f485 100644 --- a/apps/edr-freight-api/src/modules/warehouses/warehouse-inventory.service.ts +++ b/apps/edr-freight-api/src/modules/warehouses/warehouse-inventory.service.ts @@ -4005,6 +4005,14 @@ export class WarehouseInventoryService { [handoverId], ); if (!h) throw new NotFoundException(`Handover ${handoverId} not found`); + // Self-haul stays a single booking-level signature via approve-delivery, + // which also enforces inspection-passed + truck-arrived. Per-truck signing + // is an EDR last-mile flow only. + if (h.mileType !== 'EDR_LAST_MILE') { + throw new BadRequestException( + 'This handover is signed through Approve delivery, not per truck', + ); + } // Same gate as approve-delivery: storage/demurrage must be settled first. const [inv]: Array<{ id: string; warehouseId: string | null }> = await this.dataSource.query(