mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
38 lines
957 B
TypeScript
38 lines
957 B
TypeScript
import {
|
|
Body,
|
|
Controller,
|
|
Get,
|
|
Param,
|
|
ParseUUIDPipe,
|
|
Post,
|
|
} from "@nestjs/common";
|
|
import { ApiOperation, ApiTags } from "@nestjs/swagger";
|
|
|
|
import { CreatePassengerDto } from "./dto/create-passenger.dto";
|
|
import { PassengersService } from "./passengers.service";
|
|
|
|
@ApiTags("passengers")
|
|
// @UseGuards(JwtAuthGuard) — TODO: integrate @edr/auth
|
|
@Controller("passengers")
|
|
export class PassengersController {
|
|
constructor(private readonly passengersService: PassengersService) {}
|
|
|
|
@Post()
|
|
@ApiOperation({ summary: "Register a new passenger" })
|
|
create(@Body() dto: CreatePassengerDto) {
|
|
return this.passengersService.create(dto);
|
|
}
|
|
|
|
@Get()
|
|
@ApiOperation({ summary: "List all passengers" })
|
|
findAll() {
|
|
return this.passengersService.findAll();
|
|
}
|
|
|
|
@Get(":id")
|
|
@ApiOperation({ summary: "Get a passenger by ID" })
|
|
findOne(@Param("id", ParseUUIDPipe) id: string) {
|
|
return this.passengersService.findById(id);
|
|
}
|
|
}
|