event subscriptions

This commit is contained in:
toni
2026-03-15 15:39:45 +01:00
parent 29c6828dd1
commit 2620538a2c
26 changed files with 1028 additions and 214 deletions
@@ -1,15 +1,35 @@
import { Controller, Post, Route, SuccessResponse } from "tsoa";
import express from "express";
import {
Controller,
Get,
Post,
Request,
Route,
Security,
SuccessResponse,
} from "tsoa";
import type { FoundEventDto } from "../dtos/foundEvents.js";
import { inject } from "../infrastructure/di/index.js";
import { FoundEventsService } from "../services/foundEvents/foundEventsService.js";
import { KC_SECURITY_NAME } from "../services/keycloak/user/keycloak-user.js";
@Route("found-events")
export class FoundEventsController extends Controller {
private readonly foundEventsService = inject(FoundEventsService);
@Post("crawl")
@Security(KC_SECURITY_NAME)
@SuccessResponse("200", "OK")
//TODO add security
public async crawl() {
return await this.foundEventsService.crawl();
public async crawl(): Promise<void> {
await this.foundEventsService.crawl();
}
@Get("future")
@Security(KC_SECURITY_NAME)
@SuccessResponse("200", "OK")
public async getFutureEvents(
@Request() request: express.Request,
): Promise<FoundEventDto[]> {
return await this.foundEventsService.getFutureEvents(request);
}
}