|
|
@@ -1,33 +1,77 @@
|
|
|
-import { Controller, Get, Post, Body, Param, Put, Delete } from '@nestjs/common';
|
|
|
-import { ApiTags } from '@nestjs/swagger';
|
|
|
-
|
|
|
-@ApiTags('drivers')
|
|
|
-@Controller('drivers')
|
|
|
-export class DriverController {
|
|
|
- constructor() {}
|
|
|
-
|
|
|
- @Post()
|
|
|
- async create(@Body() createDriverDto: any) {
|
|
|
- // TODO: Implement create driver use case
|
|
|
- }
|
|
|
-
|
|
|
- @Get()
|
|
|
- async findAll() {
|
|
|
- // TODO: Implement get all drivers use case
|
|
|
- }
|
|
|
-
|
|
|
- @Get(':id')
|
|
|
- async findOne(@Param('id') id: string) {
|
|
|
- // TODO: Implement get driver by id use case
|
|
|
- }
|
|
|
-
|
|
|
- @Put(':id')
|
|
|
- async update(@Param('id') id: string, @Body() updateDriverDto: any) {
|
|
|
- // TODO: Implement update driver use case
|
|
|
- }
|
|
|
-
|
|
|
- @Delete(':id')
|
|
|
- async remove(@Param('id') id: string) {
|
|
|
- // TODO: Implement delete driver use case
|
|
|
- }
|
|
|
-}
|
|
|
+import {
|
|
|
+ Controller,
|
|
|
+ Get,
|
|
|
+ Post,
|
|
|
+ Body,
|
|
|
+ Param,
|
|
|
+ Put,
|
|
|
+ Delete,
|
|
|
+} from '@nestjs/common';
|
|
|
+import { ApiTags, ApiResponse, ApiOperation, ApiParam } from '@nestjs/swagger';
|
|
|
+import { CreateDriverDto } from '../../application/dto/create-driver.dto';
|
|
|
+import { DriverResponseDto } from '../../application/dto/responses/driver-response.dto';
|
|
|
+
|
|
|
+@ApiTags('drivers')
|
|
|
+@Controller('drivers')
|
|
|
+export class DriverController {
|
|
|
+ constructor() {}
|
|
|
+
|
|
|
+ @Post()
|
|
|
+ @ApiOperation({ summary: 'Créer un nouveau chauffeur' })
|
|
|
+ @ApiResponse({
|
|
|
+ status: 201,
|
|
|
+ description: 'Le chauffeur a été créé avec succès',
|
|
|
+ type: DriverResponseDto,
|
|
|
+ })
|
|
|
+ async create(@Body() createDriverDto: CreateDriverDto) {
|
|
|
+ // TODO: Implement create driver use case
|
|
|
+ }
|
|
|
+
|
|
|
+ @Get()
|
|
|
+ @ApiOperation({ summary: 'Récupérer tous les chauffeurs' })
|
|
|
+ @ApiResponse({
|
|
|
+ status: 200,
|
|
|
+ description: 'Liste de tous les chauffeurs',
|
|
|
+ type: [DriverResponseDto],
|
|
|
+ })
|
|
|
+ async findAll() {
|
|
|
+ // TODO: Implement get all drivers use case
|
|
|
+ }
|
|
|
+
|
|
|
+ @Get(':id')
|
|
|
+ @ApiOperation({ summary: 'Récupérer un chauffeur par son ID' })
|
|
|
+ @ApiParam({ name: 'id', description: 'ID du chauffeur' })
|
|
|
+ @ApiResponse({
|
|
|
+ status: 200,
|
|
|
+ description: 'Le chauffeur a été trouvé',
|
|
|
+ type: DriverResponseDto,
|
|
|
+ })
|
|
|
+ @ApiResponse({ status: 404, description: 'Chauffeur non trouvé' })
|
|
|
+ async findOne(@Param('id') id: string) {
|
|
|
+ // TODO: Implement get driver by id use case
|
|
|
+ }
|
|
|
+
|
|
|
+ @Put(':id')
|
|
|
+ @ApiOperation({ summary: 'Mettre à jour un chauffeur' })
|
|
|
+ @ApiParam({ name: 'id', description: 'ID du chauffeur' })
|
|
|
+ @ApiResponse({
|
|
|
+ status: 200,
|
|
|
+ description: 'Le chauffeur a été mis à jour',
|
|
|
+ type: DriverResponseDto,
|
|
|
+ })
|
|
|
+ async update(@Param('id') id: string, @Body() updateDriverDto: any) {
|
|
|
+ // TODO: Implement update driver use case
|
|
|
+ }
|
|
|
+
|
|
|
+ @Delete(':id')
|
|
|
+ @ApiOperation({ summary: 'Supprimer un chauffeur' })
|
|
|
+ @ApiParam({ name: 'id', description: 'ID du chauffeur' })
|
|
|
+ @ApiResponse({
|
|
|
+ status: 200,
|
|
|
+ description: 'Le chauffeur a été supprimé',
|
|
|
+ type: DriverResponseDto,
|
|
|
+ })
|
|
|
+ async remove(@Param('id') id: string) {
|
|
|
+ // TODO: Implement delete driver use case
|
|
|
+ }
|
|
|
+}
|