matcher/src/modules/ad/domain/entities/ad.ts

117 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-04-24 14:44:52 +00:00
import { AutoMap } from '@automapper/classes';
2023-04-26 10:10:22 +00:00
import { ArrayMinSize, IsArray, IsEnum, ValidateNested } from 'class-validator';
import { PointType } from '../../../geography/domain/types/point-type.enum';
import { Point } from '../../../geography/domain/types/point.type';
2023-04-24 14:44:52 +00:00
export class Ad {
@AutoMap()
uuid: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
driver: boolean;
@AutoMap()
2023-04-24 14:44:52 +00:00
passenger: boolean;
@AutoMap()
2023-04-24 14:44:52 +00:00
frequency: number;
@AutoMap()
2023-04-26 10:10:22 +00:00
fromDate: Date;
@AutoMap()
2023-04-26 10:10:22 +00:00
toDate: Date;
@AutoMap()
2023-04-24 14:44:52 +00:00
monTime: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
tueTime: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
wedTime: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
thuTime: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
friTime: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
satTime: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
sunTime: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
monMargin: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
tueMargin: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
wedMargin: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
thuMargin: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
friMargin: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
satMargin: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
sunMargin: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
driverDuration: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
driverDistance: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
passengerDuration: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
passengerDistance: number;
2023-04-26 10:10:22 +00:00
@IsEnum(PointType)
@AutoMap()
2023-04-26 10:10:22 +00:00
originType: PointType;
2023-04-26 10:10:22 +00:00
@IsEnum(PointType)
@AutoMap()
2023-04-26 10:10:22 +00:00
destinationType: PointType;
2023-04-26 10:10:22 +00:00
@IsArray()
@ArrayMinSize(2)
@ValidateNested({ each: true })
@AutoMap()
2023-04-26 10:10:22 +00:00
waypoints: Array<Point>;
@AutoMap()
2023-04-24 14:44:52 +00:00
direction: string;
@AutoMap()
2023-04-24 14:44:52 +00:00
fwdAzimuth: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
backAzimuth: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
seatsDriver: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
seatsPassenger: number;
@AutoMap()
2023-04-24 14:44:52 +00:00
seatsUsed: number;
@AutoMap()
2023-04-26 10:10:22 +00:00
createdAt: Date;
@AutoMap()
2023-04-26 10:10:22 +00:00
updatedAt: Date;
2023-04-24 14:44:52 +00:00
}