mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +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.
54 lines
1.9 KiB
TypeScript
54 lines
1.9 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 { CreateWeightLimitRuleDto } from '../dto/create-weight-limit-rule.dto';
|
|
import { ListWeightLimitRulesQueryDto } from '../dto/list-rule-engine-query.dto';
|
|
import { UpdateWeightLimitRuleDto } from '../dto/update-weight-limit-rule.dto';
|
|
import { WeightLimitRulesService } from '../services/weight-limit-rules.service';
|
|
|
|
@ApiTags('weight-limit-rules')
|
|
@Controller('weight-limit-rules')
|
|
@ApiBearerAuth()
|
|
export class WeightLimitRulesController {
|
|
constructor(private readonly service: WeightLimitRulesService) {}
|
|
|
|
@Get()
|
|
@RuleEngineView('weight-limit-rules')
|
|
@ApiOperation({ summary: 'List weight limit rules' })
|
|
findAll(@Query() query: ListWeightLimitRulesQueryDto) {
|
|
return this.service.findAll(query);
|
|
}
|
|
|
|
@Get(':id')
|
|
@RuleEngineView('weight-limit-rules')
|
|
@ApiOperation({ summary: 'Get a weight limit rule by ID' })
|
|
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
|
return this.service.findById(id);
|
|
}
|
|
|
|
@Post()
|
|
@RuleEngineManage('weight-limit-rules')
|
|
@ApiOperation({ summary: 'Create a weight limit rule' })
|
|
create(@Body() dto: CreateWeightLimitRuleDto) {
|
|
return this.service.create(dto);
|
|
}
|
|
|
|
@Patch(':id')
|
|
@RuleEngineManage('weight-limit-rules')
|
|
@ApiOperation({ summary: 'Update a weight limit rule' })
|
|
update(@Param('id', ParseUUIDPipe) id: string, @Body() dto: UpdateWeightLimitRuleDto) {
|
|
return this.service.update(id, dto);
|
|
}
|
|
|
|
@Delete(':id')
|
|
@RuleEngineManage('weight-limit-rules')
|
|
@HttpCode(HttpStatus.NO_CONTENT)
|
|
@ApiOperation({ summary: 'Soft-delete a weight limit rule' })
|
|
remove(@Param('id', ParseUUIDPipe) id: string) {
|
|
return this.service.remove(id);
|
|
}
|
|
}
|