This commit is contained in:
Hagernesh
2026-07-21 12:13:57 +00:00
parent ca8a7602ef
commit 9da48bd61a

View File

@@ -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(