import { IsIn, IsOptional, IsString, IsUUID, MaxLength } from 'class-validator';

import { INTERCHANGE_DIRECTIONS, InterchangeDirection } from '../entities/interchange-document.entity';

export class GenerateFromScheduleDto {
  @IsUUID()
  scheduleId!: string;

  @IsIn(INTERCHANGE_DIRECTIONS)
  direction!: InterchangeDirection;

  @IsString()
  @MaxLength(255)
  handoverLocation!: string;

  @IsString()
  @MaxLength(255)
  handoverFrom!: string;

  @IsString()
  @MaxLength(255)
  handoverTo!: string;

  @IsOptional()
  @IsString()
  @MaxLength(255)
  operatorName?: string;

  @IsOptional()
  @IsString()
  @MaxLength(255)
  portOperatorName?: string;

  @IsOptional()
  @IsString()
  @MaxLength(255)
  shippingLineName?: string;

  @IsOptional()
  @IsString()
  @MaxLength(120)
  customsReference?: string;

  @IsOptional()
  @IsString()
  @MaxLength(120)
  manifestReference?: string;

  @IsOptional()
  @IsString()
  @MaxLength(120)
  generatedBy?: string;

  @IsOptional()
  @IsString()
  remarks?: string;
}
