mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 15:30:56 +00:00
23 lines
861 B
TypeScript
23 lines
861 B
TypeScript
import { Body, Controller, Param, ParseUUIDPipe, Post } from '@nestjs/common';
|
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
import { BookingsService } from './bookings.service';
|
|
import { AllocateContainersDto } from './dto/allocate-containers.dto';
|
|
import { AllocationManage } from '../../common/booking-guards';
|
|
|
|
@ApiTags('bookings')
|
|
@Controller('bookings')
|
|
@ApiBearerAuth()
|
|
export class BookingAllocationController {
|
|
constructor(private readonly bookingsService: BookingsService) {}
|
|
|
|
@Post(':bookingId/allocate-containers')
|
|
@AllocationManage()
|
|
@ApiOperation({ summary: 'Allocate containers to vehicles' })
|
|
async allocateContainers(
|
|
@Param('bookingId', ParseUUIDPipe) bookingId: string,
|
|
@Body() dto: AllocateContainersDto,
|
|
) {
|
|
return this.bookingsService.allocateContainers(bookingId, dto.allocations);
|
|
}
|
|
}
|