This commit is contained in:
Bastian Wagner
2025-12-20 11:18:07 +01:00
parent e05ab13d0d
commit bb6d7346f7
24 changed files with 519 additions and 115 deletions

View File

@@ -0,0 +1,29 @@
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
import { GroupEventsService } from '../application/group-events.service';
import { IncomingGroupEventDto } from '../dto/group-event.dto';
@Controller('group-events')
export class GroupEventsController {
constructor(private readonly groupsEventsService: GroupEventsService) {}
@Post(':groupId/events/batch')
ingest(
@Param('groupId') groupId: string,
@Body() events: IncomingGroupEventDto[],
) {
return this.groupsEventsService.ingestEvents(groupId, events);
}
@Get()
getEvents() {
return this.groupsEventsService.getLastTenEvents();
}
@Get(':groupdId')
getGroupEvents(@Param('groupId') groupId: string) {
return this.groupsEventsService.getLastTenEvents(groupId);
}
}