@@ -8,23 +8,29 @@ import {
|
||||
} from "class-validator";
|
||||
|
||||
/**
|
||||
* @classdesc Defines a track of given length.
|
||||
* @property {number} id - Autogenerated unique id
|
||||
* @property {string} name - The track's name
|
||||
* @property {number} lenth - The track's length in meters
|
||||
* Defines a track of given length.
|
||||
*/
|
||||
@Entity()
|
||||
export class Track {
|
||||
/**
|
||||
* Autogenerated unique id (primary key).
|
||||
*/
|
||||
@PrimaryGeneratedColumn()
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
id: number;
|
||||
|
||||
/**
|
||||
* The track's name.
|
||||
*/
|
||||
@Column()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The track's length in meters.
|
||||
*/
|
||||
@Column()
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
|
||||
Reference in New Issue
Block a user