feat(api): add RoutesModule with GET/POST/DELETE /routes endpoints

Implements RoutesService and RoutesController for SyncRoute CRUD, wires
GroupsModule and RoutesModule into AppModule; 11 new tests, all 31 pass.
This commit is contained in:
2026-05-28 01:07:15 +05:30
parent f4a40b573e
commit 6b4920ce41
6 changed files with 221 additions and 0 deletions
@@ -0,0 +1,23 @@
import { Body, Controller, Delete, Get, HttpCode, Param, Post, Query } from '@nestjs/common';
import { RoutesService } from './routes.service';
@Controller('routes')
export class RoutesController {
constructor(private readonly routesService: RoutesService) {}
@Get()
list(@Query('sourceGroupId') sourceGroupId?: string) {
return this.routesService.list(sourceGroupId);
}
@Post()
create(@Body() body: { sourceGroupId?: string; targetGroupId?: string }) {
return this.routesService.create(body.sourceGroupId ?? '', body.targetGroupId ?? '');
}
@Delete(':id')
@HttpCode(204)
remove(@Param('id') id: string) {
return this.routesService.remove(id);
}
}