134 lines
2.1 KiB
TypeScript
134 lines
2.1 KiB
TypeScript
import {
|
|
IsArray,
|
|
IsBoolean,
|
|
IsEnum,
|
|
IsInt,
|
|
IsNumber,
|
|
IsOptional,
|
|
IsString,
|
|
Max,
|
|
Min,
|
|
} from 'class-validator';
|
|
import { AutoMap } from '@automapper/classes';
|
|
import { Point } from '../entities/point.type';
|
|
import { Schedule } from '../entities/schedule.type';
|
|
import { MarginDurations } from '../entities/margin-durations.type';
|
|
import { Algorithm } from './algorithm.enum';
|
|
import { IRequestTime } from '../interfaces/time-request.interface';
|
|
import { IRequestPerson } from '../interfaces/person-request.interface';
|
|
|
|
export class MatchRequest implements IRequestTime, IRequestPerson {
|
|
@IsArray()
|
|
@AutoMap()
|
|
waypoints: Array<Point>;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@AutoMap()
|
|
departure: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@AutoMap()
|
|
fromDate: string;
|
|
|
|
@IsOptional()
|
|
@AutoMap()
|
|
schedule: Schedule;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@AutoMap()
|
|
driver: boolean;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@AutoMap()
|
|
passenger: boolean;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@AutoMap()
|
|
toDate: string;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
@AutoMap()
|
|
marginDuration: number;
|
|
|
|
@IsOptional()
|
|
@AutoMap()
|
|
marginDurations: MarginDurations;
|
|
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@AutoMap()
|
|
seatsPassenger: number;
|
|
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@AutoMap()
|
|
seatsDriver: number;
|
|
|
|
@IsOptional()
|
|
@AutoMap()
|
|
strict: boolean;
|
|
|
|
@IsOptional()
|
|
@IsEnum(Algorithm)
|
|
@AutoMap()
|
|
algorithm: Algorithm;
|
|
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@AutoMap()
|
|
remoteness: number;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@AutoMap()
|
|
useProportion: boolean;
|
|
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
@Max(1)
|
|
@AutoMap()
|
|
proportion: number;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
@AutoMap()
|
|
useAzimuth: boolean;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(0)
|
|
@Max(359)
|
|
@AutoMap()
|
|
azimuthMargin: number;
|
|
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
@Max(1)
|
|
@AutoMap()
|
|
maxDetourDistanceRatio: number;
|
|
|
|
@IsOptional()
|
|
@IsNumber()
|
|
@Min(0)
|
|
@Max(1)
|
|
@AutoMap()
|
|
maxDetourDurationRatio: number;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
exclusions: Array<number>;
|
|
|
|
@IsOptional()
|
|
@IsInt()
|
|
@AutoMap()
|
|
identifier: number;
|
|
}
|