mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +00:00
- Added parameter to and for server-side free-text search on contract reference, company name, and booking details. - Introduced new validation errors in for container clashes and space issues when creating bookings. - Implemented paginated dropdown settings retrieval in . - Updated to fetch active yards using a new method that handles pagination. - Enhanced with a method to fetch all records by walking through pages. - Refactored to support filtering and pagination in schedule listings. - Improved to return a paginated list of facilities. - Updated UI components in and to utilize debounced search inputs for better performance. - Added alerts in to inform users about booking constraints related to splits and capacity. - Enhanced to display notifications for split bookings and capacity usage.
72 lines
2.5 KiB
TypeScript
72 lines
2.5 KiB
TypeScript
import {
|
|
Body, Controller, Delete, Get, HttpCode, HttpStatus,
|
|
Param, ParseUUIDPipe, Patch, Post, Query,
|
|
} from '@nestjs/common';
|
|
import { RuleEngineManage, RuleEngineView } from '../../../common/rule-engine-guards';
|
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
import { CreatePriorityConfigDto } from '../dto/create-priority-config.dto';
|
|
import { ListPriorityConfigsQueryDto } from '../dto/list-rule-engine-query.dto';
|
|
import { UpdatePriorityConfigDto } from '../dto/update-priority-config.dto';
|
|
import { MoveOrderDto } from '../dto/move-order.dto';
|
|
import { ReorderItemsDto } from '../dto/reorder-items.dto';
|
|
import { PriorityConfigsService } from '../services/priority-configs.service';
|
|
|
|
@ApiTags('priority-configs')
|
|
@Controller('priority-configs')
|
|
@ApiBearerAuth()
|
|
export class PriorityConfigsController {
|
|
constructor(private readonly service: PriorityConfigsService) {}
|
|
|
|
@Get()
|
|
@RuleEngineView('priority-configs')
|
|
@ApiOperation({ summary: 'List priority configs' })
|
|
findAll(@Query() query: ListPriorityConfigsQueryDto) {
|
|
return this.service.findAll(query);
|
|
}
|
|
|
|
@Get(':id')
|
|
@RuleEngineView('priority-configs')
|
|
@ApiOperation({ summary: 'Get a priority config by ID' })
|
|
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
|
return this.service.findById(id);
|
|
}
|
|
|
|
@Post()
|
|
@RuleEngineManage('priority-configs')
|
|
@ApiOperation({ summary: 'Create a priority config' })
|
|
create(@Body() dto: CreatePriorityConfigDto) {
|
|
return this.service.create(dto);
|
|
}
|
|
|
|
@Post('reorder')
|
|
@RuleEngineManage('priority-configs')
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
@ApiOperation({ summary: 'Bulk reorder priority configs by ID list' })
|
|
reorder(@Body() dto: ReorderItemsDto) {
|
|
return this.service.reorder(dto.ids);
|
|
}
|
|
|
|
@Post(':id/move-order')
|
|
@RuleEngineManage('priority-configs')
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
@ApiOperation({ summary: 'Move a priority config up or down in display order' })
|
|
moveOrder(@Param('id', ParseUUIDPipe) id: string, @Body() dto: MoveOrderDto) {
|
|
return this.service.moveOrder(id, dto.direction);
|
|
}
|
|
|
|
@Patch(':id')
|
|
@RuleEngineManage('priority-configs')
|
|
@ApiOperation({ summary: 'Update a priority config' })
|
|
update(@Param('id', ParseUUIDPipe) id: string, @Body() dto: UpdatePriorityConfigDto) {
|
|
return this.service.update(id, dto);
|
|
}
|
|
|
|
@Delete(':id')
|
|
@RuleEngineManage('priority-configs')
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
@ApiOperation({ summary: 'Soft-delete a priority config' })
|
|
remove(@Param('id', ParseUUIDPipe) id: string) {
|
|
return this.service.remove(id);
|
|
}
|
|
}
|