78
src/models/responses/ResponseRunner.ts
Normal file
78
src/models/responses/ResponseRunner.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import {
|
||||
IsInt,
|
||||
|
||||
IsObject,
|
||||
|
||||
IsString
|
||||
} from "class-validator";
|
||||
import { Runner } from '../entities/Runner';
|
||||
import { RunnerGroup } from '../entities/RunnerGroup';
|
||||
|
||||
/**
|
||||
* Defines a track of given length.
|
||||
*/
|
||||
export class ResponseRunner {
|
||||
/**
|
||||
* Autogenerated unique id (primary key).
|
||||
*/
|
||||
@IsInt()
|
||||
id: number;;
|
||||
|
||||
/**
|
||||
* The runner's first name.
|
||||
*/
|
||||
@IsString()
|
||||
firstname: string;
|
||||
|
||||
/**
|
||||
* The runner's middle name.
|
||||
* Optional.
|
||||
*/
|
||||
@IsString()
|
||||
middlename?: string;
|
||||
|
||||
/**
|
||||
* The runner's last name.
|
||||
*/
|
||||
@IsString()
|
||||
lastname: string;
|
||||
|
||||
/**
|
||||
* The runner's phone number.
|
||||
* Optional.
|
||||
*/
|
||||
@IsString()
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* The runner's e-mail address.
|
||||
* Optional.
|
||||
*/
|
||||
@IsString()
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* The runner's currently ran distance in meters.
|
||||
* Optional.
|
||||
*/
|
||||
@IsInt()
|
||||
distance: number;
|
||||
|
||||
/**
|
||||
* The runner's group.
|
||||
*/
|
||||
@IsObject()
|
||||
group: RunnerGroup;
|
||||
|
||||
|
||||
public constructor(runner: Runner) {
|
||||
this.id = runner.id;
|
||||
this.firstname = runner.firstname;
|
||||
this.middlename = runner.middlename;
|
||||
this.lastname = runner.lastname;
|
||||
this.phone = runner.phone;
|
||||
this.email = runner.email;
|
||||
this.distance = runner.distance;
|
||||
this.group = runner.group;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user