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

@@ -17,6 +17,7 @@ import { MoveInventoryDto } from './dto/move-inventory.dto';
import { StoreInventoryDto } from './dto/store-inventory.dto';
import { ReceiveWarehouseInventoryDto } from './dto/receive-inventory.dto';
import { ApproveDeliveryDto } from './dto/approve-delivery.dto';
import { SetDoubleHandlingDto } from './dto/double-handling.dto';
import { ReleaseOrderDto } from './dto/release-order.dto';
import { ReserveInventoryDto } from './dto/reserve-inventory.dto';
import { UnloadBookingDto } from './dto/unload-booking.dto';
@@ -552,6 +553,23 @@ export class WarehouseInventoryController {
return res.send(buffer);
}
@Patch('bookings/:bookingId/double-handling')
@BookingStaff([FREIGHT_PERMS.warehouseInventory.unload, FREIGHT_PERMS.warehouseInventory.inspect])
@ApiOperation({
summary: 'Record Yes/No double handling after unloading (Yes applies the double-handling fee rule)',
})
setDoubleHandling(
@Param('bookingId', ParseUUIDPipe) bookingId: string,
@Body() dto: SetDoubleHandlingDto,
@CurrentUser() user: TCurrentUser,
) {
return this.inventoryService.setDoubleHandling(
bookingId,
dto.doubleHandling,
actorLabel(user),
);
}
@Get('bookings/:bookingId/container-items')
@StaffReference()
@ApiOperation({ summary: 'Per-container/bulk items of a booking with lifecycle stage + refs' })