/* https://docs.nestjs.com/controllers#controllers */ import { LogisticService } from './logistic.service'; import { CarOutDelivery } from '../core/models/car-out-delivery.model'; import { CarInDelivery } from '../core/models/car-in-delivery.model'; import { Body, Controller, Get, Param, Post, UseGuards } from '@nestjs/common'; import { JwtAuthGuard } from 'src/auth/guards/jwt-auth.guard'; import { ApiBearerAuth, ApiTags, ApiOperation } from '@nestjs/swagger'; @ApiTags('Logística') @ApiBearerAuth() @UseGuards(JwtAuthGuard) @Controller('api/v1/logistic') export class LogisticController { constructor(private readonly logisticService: LogisticService) {} @Get('expedicao') @ApiOperation({ summary: 'Retorna informações de expedição' }) getExpedicao() { return this.logisticService.getExpedicao(); } @Get('employee') @ApiOperation({ summary: 'Retorna lista de funcionários' }) getEmployee() { return this.logisticService.getEmployee(); } @Get('deliveries/:placa') @ApiOperation({ summary: 'Retorna entregas por placa' }) getDelivery(@Param('placa') placa: string) { return this.logisticService.getDeliveries(placa); } @Get('status-car/:placa') @ApiOperation({ summary: 'Retorna status do veículo por placa' }) getStatusCar(@Param('placa') placa: string) { return this.logisticService.getStatusCar(placa); } @Post('create') @ApiOperation({ summary: 'Registra saída de veículo' }) createOutCar(@Body() data: CarOutDelivery) { return this.logisticService.createCarOut(data); } @Post('return-car') @ApiOperation({ summary: 'Registra retorno de veículo' }) createinCar(@Body() data: CarInDelivery) { return this.logisticService.createCarIn(data); } }