diff --git a/src/observations/observations.controller.ts b/src/observations/observations.controller.ts new file mode 100644 index 0000000..55e5bed --- /dev/null +++ b/src/observations/observations.controller.ts @@ -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); + } +}