Customer portal card displays warehouse location data (warehouse/yard/zone + arrival time) once cargo arrives at warehouse. Shows loading state during fetch, placeholder text if not yet received. Type-check passes.

This commit is contained in:
Hagernesh
2026-07-21 11:46:00 +00:00
parent ed503f1e6b
commit 86569f7490
6 changed files with 557 additions and 55 deletions

View File

@@ -486,6 +486,21 @@ export class WarehouseInventoryController {
return this.handoverService.list(bookingId);
}
@Post('handovers/:handoverId/sign')
@ApiOperation({ summary: 'Customer signs one handover (EDR last-mile: one signature per truck)' })
signHandover(
@Param('handoverId', ParseUUIDPipe) handoverId: string,
@Body() dto: ApproveDeliveryDto,
@Request() req: { user?: { id?: string; sub?: string } },
@CurrentUser() user: TCurrentUser,
) {
return this.inventoryService.signHandover(
handoverId,
user?.id ?? req.user?.id ?? req.user?.sub,
dto.signerName,
);
}
@Post('bookings/:bookingId/request-handover-signature')
@ApiOperation({ summary: 'Ask the customer to sign the handover (creates one if none, then notifies)' })
requestHandoverSignature(@Param('bookingId', ParseUUIDPipe) bookingId: string) {
@@ -513,9 +528,16 @@ export class WarehouseInventoryController {
}
@Get('bookings/:bookingId/handover-document')
@ApiOperation({ summary: 'View import goods handover document PDF (resolved by booking)' })
async bookingHandoverDocument(@Param('bookingId', ParseUUIDPipe) bookingId: string, @Res() res: Response) {
const { filename, buffer } = await this.inventoryService.handoverDocumentForBooking(bookingId);
@ApiOperation({ summary: 'View import goods handover document PDF (resolved by booking; ?handoverId= for the per-truck variant)' })
async bookingHandoverDocument(
@Param('bookingId', ParseUUIDPipe) bookingId: string,
@Res() res: Response,
@Query('handoverId') handoverId?: string,
) {
const { filename, buffer } = await this.inventoryService.handoverDocumentForBooking(
bookingId,
handoverId || undefined,
);
res.setHeader('Content-Type', 'application/pdf');
res.setHeader('Content-Disposition', `inline; filename="${filename}"`);
res.setHeader('Content-Length', buffer.length);