2023-04-25 15:49:47 +00:00
|
|
|
import { AutoMap } from '@automapper/classes';
|
2023-04-26 10:10:22 +00:00
|
|
|
import {
|
|
|
|
ArrayMinSize,
|
|
|
|
IsArray,
|
|
|
|
IsBoolean,
|
|
|
|
IsEnum,
|
|
|
|
IsNotEmpty,
|
|
|
|
IsNumber,
|
|
|
|
IsOptional,
|
|
|
|
IsString,
|
|
|
|
} from 'class-validator';
|
|
|
|
import { PointType } from '../../../geography/domain/types/point-type.enum';
|
|
|
|
import { Frequency } from '../types/frequency.enum';
|
2023-04-28 13:53:57 +00:00
|
|
|
import { Coordinates } from '../../../geography/domain/entities/coordinates';
|
2023-04-25 15:49:47 +00:00
|
|
|
|
|
|
|
export class CreateAdRequest {
|
|
|
|
@IsString()
|
|
|
|
@IsNotEmpty()
|
|
|
|
@AutoMap()
|
|
|
|
uuid: string;
|
|
|
|
|
|
|
|
@IsBoolean()
|
|
|
|
@AutoMap()
|
|
|
|
driver: boolean;
|
|
|
|
|
|
|
|
@IsBoolean()
|
|
|
|
@AutoMap()
|
|
|
|
passenger: boolean;
|
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsNotEmpty()
|
|
|
|
@IsEnum(Frequency)
|
2023-04-25 15:49:47 +00:00
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
frequency: Frequency;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
|
|
|
fromDate: string;
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
|
|
|
toDate: string;
|
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsOptional()
|
2023-04-25 15:49:47 +00:00
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
monTime: string | null;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsOptional()
|
2023-04-25 15:49:47 +00:00
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
tueTime: string | null;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsOptional()
|
2023-04-25 15:49:47 +00:00
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
wedTime: string | null;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsOptional()
|
2023-04-25 15:49:47 +00:00
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
thuTime!: string | null;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsOptional()
|
2023-04-25 15:49:47 +00:00
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
friTime: string | null;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsOptional()
|
2023-04-25 15:49:47 +00:00
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
satTime: string | null;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsOptional()
|
2023-04-25 15:49:47 +00:00
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
sunTime: string | null;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
monMargin: number;
|
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
tueMargin: number;
|
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
wedMargin: number;
|
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
thuMargin: number;
|
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
friMargin: number;
|
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
satMargin: number;
|
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
sunMargin: number;
|
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsEnum(PointType)
|
2023-04-25 15:49:47 +00:00
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
originType: PointType;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsEnum(PointType)
|
2023-04-25 15:49:47 +00:00
|
|
|
@AutoMap()
|
2023-04-26 10:10:22 +00:00
|
|
|
destinationType: PointType;
|
2023-04-25 15:49:47 +00:00
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsArray()
|
|
|
|
@ArrayMinSize(2)
|
2023-04-26 12:14:46 +00:00
|
|
|
@AutoMap(() => [Coordinates])
|
|
|
|
waypoints: Coordinates[];
|
2023-04-25 15:49:47 +00:00
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
seatsDriver: number;
|
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
seatsPassenger: number;
|
|
|
|
|
2023-04-26 10:10:22 +00:00
|
|
|
@IsOptional()
|
2023-04-25 15:49:47 +00:00
|
|
|
@IsNumber()
|
|
|
|
@AutoMap()
|
|
|
|
seatsUsed: number;
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
|
|
|
createdAt: string;
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
@AutoMap()
|
|
|
|
updatedAt: string;
|
2023-04-28 13:53:57 +00:00
|
|
|
|
|
|
|
timezone: string;
|
2023-04-25 15:49:47 +00:00
|
|
|
}
|