mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 12:30:58 +00:00
Project Initialization
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { Body, Controller, Get, Param, ParseUUIDPipe, Post, Query } from '@nestjs/common';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
import { ConsignmentsService } from './consignments.service';
|
||||
import { CreateConsignmentDto } from './dto/create-consignment.dto';
|
||||
import { FilterConsignmentDto } from './dto/filter-consignment.dto';
|
||||
|
||||
@ApiTags('consignments')
|
||||
// @UseGuards(JwtAuthGuard) — TODO: integrate @edr/auth
|
||||
@Controller('consignments')
|
||||
export class ConsignmentsController {
|
||||
constructor(private readonly consignmentsService: ConsignmentsService) {}
|
||||
|
||||
@Post()
|
||||
@ApiOperation({ summary: 'Create a new consignment' })
|
||||
create(@Body() dto: CreateConsignmentDto) {
|
||||
return this.consignmentsService.create(dto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'List consignments (paginated)' })
|
||||
findAll(@Query() filter: FilterConsignmentDto) {
|
||||
return this.consignmentsService.findAll(filter);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@ApiOperation({ summary: 'Get a consignment by ID' })
|
||||
findOne(@Param('id', ParseUUIDPipe) id: string) {
|
||||
return this.consignmentsService.findById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user