parent
8e2eac9dc0
commit
f32291d714
@ -1,4 +1,4 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from "typeorm";
|
||||||
import {
|
import {
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
IsInt,
|
IsInt,
|
||||||
@ -34,7 +34,7 @@ export class ScanStation {
|
|||||||
*/
|
*/
|
||||||
@Column()
|
@Column()
|
||||||
@IsNotEmpty()
|
@IsNotEmpty()
|
||||||
//TODO: Relation
|
@ManyToOne(() => Track, track => track.stations)
|
||||||
track: Track;
|
track: Track;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
|
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm";
|
||||||
import {
|
import {
|
||||||
IsInt,
|
IsInt,
|
||||||
IsNotEmpty,
|
IsNotEmpty,
|
||||||
@ -6,6 +6,7 @@ import {
|
|||||||
IsPositive,
|
IsPositive,
|
||||||
IsString,
|
IsString,
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
|
import { ScanStation } from "./ScanStation";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a track of given length.
|
* Defines a track of given length.
|
||||||
@ -35,4 +36,10 @@ export class Track {
|
|||||||
@IsInt()
|
@IsInt()
|
||||||
@IsPositive()
|
@IsPositive()
|
||||||
distance: number;
|
distance: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to link scan stations to track.
|
||||||
|
*/
|
||||||
|
@OneToMany(() => ScanStation, station => station.track)
|
||||||
|
stations: ScanStation[];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user