import { Freight } from "@edr/types";
import {
  IsDateString,
  IsEnum,
  IsNumber,
  IsOptional,
  IsString,
  IsUUID,
  Min,
} from "class-validator";

export class CreateBookingDto {
  @IsString()
  reference!: string;

  @IsUUID()
  customerId!: string;

  @IsOptional()
  @IsUUID()
  trainId?: string;

  @IsDateString()
  scheduledDate!: string;

  @IsNumber()
  @Min(0)
  totalAmount!: number;

  @IsOptional()
  @IsEnum(Freight.BookingStatus)
  status?: Freight.BookingStatus;
}
