17 lines
510 B
TypeScript
17 lines
510 B
TypeScript
import { A, buildContract } from '@jig-software/trest-core';
|
|
import { FullReportInput } from '../constants';
|
|
|
|
export const readingReportContract = buildContract((c) =>
|
|
c
|
|
.prefix('/reports')
|
|
.parse((p) => p.error.text(400).error.text(401))
|
|
.endpoints({
|
|
generateReadingsReport: (e) =>
|
|
e
|
|
.method('POST')
|
|
.path('/reading-report')
|
|
.prepare((p) => p.body.json(FullReportInput).annotate<[query: A]>())
|
|
.parse((p) => p.success.file(200)),
|
|
}),
|
|
);
|