From 1d1fa50327927328ce77af33c1abbf994df9ac8b Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Tue, 2 Feb 2021 09:05:02 +0100 Subject: [PATCH] Moved distance to the main runner object ref #1 --- src/models/CertificateRunner.ts | 13 +++---------- src/models/Runner.ts | 6 ++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/models/CertificateRunner.ts b/src/models/CertificateRunner.ts index 937536e..a30b356 100644 --- a/src/models/CertificateRunner.ts +++ b/src/models/CertificateRunner.ts @@ -1,23 +1,16 @@ import { - IsArray, - IsInt + IsArray } from "class-validator"; +import { DistanceDonation } from './DistanceDonation'; import { Runner } from './Runner'; /** * Defines the certificate runner class (from which the runner certificates get generated). */ export class CertificateRunner extends Runner { - - /** - * The total distance ran by the runner. - */ - @IsInt() - distance: number; - /** * Array containing all distance donations associated with the runner. */ @IsArray() - distanceDonations: any[]; + distanceDonations: DistanceDonation[]; } diff --git a/src/models/Runner.ts b/src/models/Runner.ts index fec6235..826941a 100644 --- a/src/models/Runner.ts +++ b/src/models/Runner.ts @@ -38,4 +38,10 @@ export class Runner { */ @IsObject() group: RunnerGroup; + + /** + * The total distance ran by the runner. + */ + @IsInt() + distance: number; }