Initial commit of edr-passenger-api alpha version

This commit is contained in:
Stephanos A
2026-05-13 16:58:49 +03:00
parent 199a3eba11
commit 39ba561d8f
113 changed files with 3602 additions and 1035 deletions

View File

@@ -1,37 +1,15 @@
import {
Body,
Controller,
Get,
Param,
ParseUUIDPipe,
Post,
} from "@nestjs/common";
import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { Body, Controller, Get, Param, Post, UseGuards } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
import { StationsService } from './stations.service';
import { CreateStationDto } from './stations.dto';
import { JwtGuard } from '../../common/jwt.guard';
import { CreateStationDto } from "./dto/create-station.dto";
import { StationsService } from "./stations.service";
@ApiTags("stations")
// @UseGuards(JwtAuthGuard) — TODO: integrate @edr/auth
@Controller("stations")
@ApiTags('Stations')
@Controller('stations')
export class StationsController {
constructor(private readonly stationsService: StationsService) {}
@Post()
@ApiOperation({ summary: "Register a new station" })
create(@Body() dto: CreateStationDto) {
return this.stationsService.create(dto);
}
@Get()
@ApiOperation({ summary: "List all stations" })
findAll() {
return this.stationsService.findAll();
}
@Get(":id")
@ApiOperation({ summary: "Get a station by ID" })
findOne(@Param("id", ParseUUIDPipe) id: string) {
return this.stationsService.findById(id);
}
constructor(private service: StationsService) {}
@Get() @ApiOperation({ summary: 'List all stations' }) findAll() { return this.service.findAll(); }
@Get(':id') @ApiOperation({ summary: 'Get station by ID' }) findOne(@Param('id') id: string) { return this.service.findOne(id); }
@Post() @UseGuards(JwtGuard) @ApiBearerAuth('JWT-auth') @ApiOperation({ summary: 'Create station' })
create(@Body() dto: CreateStationDto) { return this.service.create(dto); }
}