1 parent
15552eff54
commit
f0a7cbbcae
3 files changed
+24
-9
No files matched your search
+10
-4
@@ -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