parent
4d593eb840
commit
c1242b2a2a
@ -1,4 +1,4 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from "typeorm";
|
||||||
import {
|
import {
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsInt,
|
IsInt,
|
||||||
@ -7,6 +7,7 @@ import {
|
|||||||
IsString,
|
IsString,
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { Runner } from "./Runner";
|
import { Runner } from "./Runner";
|
||||||
|
import { TrackScan } from "./TrackScan";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a card that can be scanned via a scanner station.
|
* Defines a card that can be scanned via a scanner station.
|
||||||
@ -46,4 +47,10 @@ export class RunnerCard {
|
|||||||
@Column()
|
@Column()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
enabled = true;
|
enabled = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to link cards to a track scans.
|
||||||
|
*/
|
||||||
|
@OneToMany(() => TrackScan, scan => scan.track)
|
||||||
|
scans: TrackScan[];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from "typeorm";
|
||||||
import {
|
import {
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsInt,
|
IsInt,
|
||||||
@ -7,6 +7,7 @@ import {
|
|||||||
IsString,
|
IsString,
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { Track } from "./Track";
|
import { Track } from "./Track";
|
||||||
|
import { TrackScan } from "./TrackScan";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ScannerStations have the ability to create scans for specific tracks.
|
* ScannerStations have the ability to create scans for specific tracks.
|
||||||
@ -51,4 +52,10 @@ export class ScanStation {
|
|||||||
@Column()
|
@Column()
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
enabled = true;
|
enabled = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to link track scans to a scan station.
|
||||||
|
*/
|
||||||
|
@OneToMany(() => TrackScan, scan => scan.track)
|
||||||
|
scans: TrackScan[];
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import {
|
|||||||
IsString,
|
IsString,
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { ScanStation } from "./ScanStation";
|
import { ScanStation } from "./ScanStation";
|
||||||
|
import { TrackScan } from "./TrackScan";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a track of given length.
|
* Defines a track of given length.
|
||||||
@ -42,4 +43,10 @@ export class Track {
|
|||||||
*/
|
*/
|
||||||
@OneToMany(() => ScanStation, station => station.track)
|
@OneToMany(() => ScanStation, station => station.track)
|
||||||
stations: ScanStation[];
|
stations: ScanStation[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to link track scans to a track.
|
||||||
|
*/
|
||||||
|
@OneToMany(() => TrackScan, scan => scan.track)
|
||||||
|
scans: TrackScan[];
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ export class TrackScan extends Scan {
|
|||||||
*/
|
*/
|
||||||
@Column()
|
@Column()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
//TODO: Relationship
|
@ManyToOne(() => Track, track => track.scans)
|
||||||
track: Track;
|
track: Track;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -38,7 +38,7 @@ export class TrackScan extends Scan {
|
|||||||
*/
|
*/
|
||||||
@Column()
|
@Column()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
//TODO: Relationship
|
@ManyToOne(() => RunnerCard, card => card.scans)
|
||||||
card: RunnerCard;
|
card: RunnerCard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +46,7 @@ export class TrackScan extends Scan {
|
|||||||
*/
|
*/
|
||||||
@Column()
|
@Column()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
//TODO: Relationship
|
@ManyToOne(() => ScanStation, station => station.scans)
|
||||||
station: ScanStation;
|
station: ScanStation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user