Added TrackScan relationships

ref #11
This commit is contained in:
2020-12-02 15:40:25 +01:00
parent 4d593eb840
commit c1242b2a2a
4 changed files with 26 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from "typeorm";
import {
IsBoolean,
IsInt,
@@ -7,6 +7,7 @@ import {
IsString,
} from "class-validator";
import { Runner } from "./Runner";
import { TrackScan } from "./TrackScan";
/**
* Defines a card that can be scanned via a scanner station.
@@ -46,4 +47,10 @@ export class RunnerCard {
@Column()
@IsBoolean()
enabled = true;
/**
* Used to link cards to a track scans.
*/
@OneToMany(() => TrackScan, scan => scan.track)
scans: TrackScan[];
}