import { ContentType, Controller, Get } from 'routing-controllers'; import { OpenAPI } from 'routing-controllers-openapi'; import { PdfCreator } from '../PdfCreator'; @Controller() export class PdfController { private pdf: PdfCreator; constructor() { this.pdf = new PdfCreator(); } @Get('/contracts') @ContentType("application/pdf") @OpenAPI({ description: "Generate Sponsoring contract pdfs from runner objects." }) async generateContracts() { //TODO: Accept the real classes const contracts = await this.pdf.generateSponsoringContract(); return await contracts; } }