Code + comment cleanup for the response models

ref #39
This commit is contained in:
2020-12-20 19:38:22 +01:00
parent a85d52437b
commit 75332983c2
13 changed files with 83 additions and 91 deletions

View File

@@ -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;