feat(decisions): add decisions.controller

This commit is contained in:
admin-valentin 2026-07-31 10:44:55 +00:00
parent b60c255080
commit e1fc7eb0b7

View file

@ -0,0 +1,34 @@
import { Body, Controller, Get, Param, ParseUUIDPipe, Patch, Post } from '@nestjs/common';
import { CurrentSession } from '../auth/session.decorator';
import type { AuthenticatedSession } from '../auth/tenant.guard';
import { CreateDecisionDto, UpdateDecisionDto } from './dto';
import { DecisionsService } from './decisions.service';
@Controller('decisions')
export class DecisionsController {
constructor(private readonly decisionsService: DecisionsService) {}
@Get()
list(@CurrentSession() session: AuthenticatedSession) {
return this.decisionsService.list(session);
}
@Get(':id')
getById(@CurrentSession() session: AuthenticatedSession, @Param('id', ParseUUIDPipe) id: string) {
return this.decisionsService.getById(session, id);
}
@Post()
create(@CurrentSession() session: AuthenticatedSession, @Body() dto: CreateDecisionDto) {
return this.decisionsService.create(session, dto);
}
@Patch(':id')
update(
@CurrentSession() session: AuthenticatedSession,
@Param('id', ParseUUIDPipe) id: string,
@Body() dto: UpdateDecisionDto,
) {
return this.decisionsService.update(session, id, dto);
}
}