parent
fbbb5df64f
commit
f7beebce3f
|
@ -0,0 +1,54 @@
|
|||
import { Entity, PrimaryGeneratedColumn, Column } from "typeorm";
|
||||
import {
|
||||
IsBoolean,
|
||||
IsInt,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
} from "class-validator";
|
||||
import { Track } from "./Track";
|
||||
|
||||
/**
|
||||
* ScannerStations have the ability to create scans for specific tracks.
|
||||
*/
|
||||
@Entity()
|
||||
export class ScanStation {
|
||||
/**
|
||||
* Autogenerated unique id (primary key).
|
||||
*/
|
||||
@PrimaryGeneratedColumn()
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
id: number;
|
||||
|
||||
/**
|
||||
* The station's description.
|
||||
*/
|
||||
@Column()
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
description: string;
|
||||
|
||||
/**
|
||||
* The track this station is associated with.
|
||||
*/
|
||||
@Column()
|
||||
@IsNotEmpty()
|
||||
//TODO: Relation
|
||||
track: Track;
|
||||
|
||||
/**
|
||||
* The station's api key.
|
||||
*/
|
||||
@Column()
|
||||
@IsNotEmpty()
|
||||
@IsString()
|
||||
key: string;
|
||||
|
||||
/**
|
||||
* Is the station enabled (for fraud reasons)?
|
||||
*/
|
||||
@Column()
|
||||
@IsBoolean()
|
||||
enabled = true;
|
||||
}
|
Loading…
Reference in New Issue