37 lines
589 B
TypeScript
37 lines
589 B
TypeScript
import { PrimaryGeneratedColumn, Column } from "typeorm";
|
|
import {
|
|
IsInt,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsPositive,
|
|
} from "class-validator";
|
|
import { Runner } from "./Runner";
|
|
|
|
/**
|
|
* Defines the scan interface.
|
|
*/
|
|
export abstract class Scan {
|
|
/**
|
|
* Autogenerated unique id (primary key).
|
|
*/
|
|
@PrimaryGeneratedColumn()
|
|
@IsOptional()
|
|
@IsInt()
|
|
id: number;
|
|
|
|
/**
|
|
* The associated runner.
|
|
*/
|
|
@Column()
|
|
@IsNotEmpty()
|
|
//TODO: Relationship
|
|
runner: Runner;
|
|
|
|
/**
|
|
* The scan's distance in meters.
|
|
*/
|
|
@IsInt()
|
|
@IsPositive()
|
|
abstract distance: number;
|
|
}
|