import {
    IsInt,

    IsNotEmpty,



    IsObject,



    IsOptional,

    IsPositive,

    IsString
} from "class-validator";
import { RunnerGroup } from './RunnerGroup';

/**
 * Defines the runner class (from which the runner sponsoring contracts get generated).
*/
export class Runner {
    /**
     * The runner's id.
     */
    @IsInt()
    @IsPositive()
    id: number;

    /**
     * The runner's first name.
     */
    @IsString()
    @IsNotEmpty()
    firstname: string;

    /**
     * The runner's middle name.
     */
    @IsString()
    @IsOptional()
    middlename?: string;

    /**
     * The runner's last name.
     */
    @IsString()
    @IsNotEmpty()
    lastname: string;

    /**
     * The runner's group.
     */
    @IsObject()
    group: RunnerGroup;

    /**
     * The total distance ran by the runner.
     */
    @IsInt()
    distance: number;
}
