parent
3ca38abe93
commit
64bd1ffc3a
20
src/controllers/PdfController.ts
Normal file
20
src/controllers/PdfController.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
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 this.pdf.toBuffer(contracts);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user