feat(observations): add observations.controller

This commit is contained in:
admin-valentin 2026-07-31 10:45:01 +00:00
parent f2733c6e72
commit 8db3ccf300

View file

@ -0,0 +1,24 @@
import { Body, Controller, Get, Post, Query } from '@nestjs/common';
import { CurrentSession } from '../auth/session.decorator';
import type { AuthenticatedSession } from '../auth/tenant.guard';
import { CreateObservationDto } from './dto';
import { ObservationsService } from './observations.service';
@Controller('observations')
export class ObservationsController {
constructor(private readonly observationsService: ObservationsService) {}
@Get()
list(
@CurrentSession() session: AuthenticatedSession,
@Query('subjectType') subjectType?: string,
@Query('subjectId') subjectId?: string,
) {
return this.observationsService.list(session, subjectType, subjectId);
}
@Post()
create(@CurrentSession() session: AuthenticatedSession, @Body() dto: CreateObservationDto) {
return this.observationsService.create(session, dto);
}
}