@@ -1,16 +1,12 @@
|
||||
import {
|
||||
IsInt,
|
||||
|
||||
IsString
|
||||
} from "class-validator";
|
||||
import { IsInt, IsString } from "class-validator";
|
||||
import { Track } from '../entities/Track';
|
||||
|
||||
/**
|
||||
* Defines a track of given length.
|
||||
* Defines the track response.
|
||||
*/
|
||||
export class ResponseTrack {
|
||||
/**
|
||||
* Autogenerated unique id (primary key).
|
||||
* The track's id.
|
||||
*/
|
||||
@IsInt()
|
||||
id: number;;
|
||||
@@ -27,6 +23,10 @@ export class ResponseTrack {
|
||||
@IsInt()
|
||||
distance: number;
|
||||
|
||||
/**
|
||||
* Creates a ResponseTrack object from a track.
|
||||
* @param track The track the response shall be build for.
|
||||
*/
|
||||
public constructor(track: Track) {
|
||||
this.id = track.id;
|
||||
this.name = track.name;
|
||||
|
||||
Reference in New Issue
Block a user