import { IsString, IsInt, IsOptional } from "class-validator"
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"

export class CreateTripDto {
  @ApiProperty({
    type: "string",
    format: "binary",
    required: false,
    description: "Upload trip document file (e.g., PDF, image, etc.)",
  })
  trip_document: any

  @ApiProperty({
    example: true,
    description: "Direct customer flag for the trip",
    required: true,
  })
  @IsString()
  is_direct_customer: string

  @ApiProperty({
    example: 101,
    description: "Client ID who owns this trip",
    required: true,
  })
  @IsOptional()
  @IsInt()
  client_id: number

  @ApiPropertyOptional({
    example: 200,
    description: "Billing contact ID for this client",
    required: true,
  })
  @IsOptional()
  @IsInt()
  client_contact_billing_id: number

  @ApiPropertyOptional({
    example: 300,
    description: "Booking reference from the client",
    required: true,
  })
  @IsOptional()
  @IsInt()
  client_booking_id: number

  @ApiProperty({
    example: 401,
    description: "ID of the customer taking the trip",
    required: true,
  })
  @IsInt()
  customer_id: number

  @ApiProperty({
    example: "+1234567890",
    description: "Phone number of the customer",
    required: false,
  })
  @IsOptional()
  @IsString()
  customer_phone_number?: string

  @ApiProperty({
    example: "john.doe@example.com",
    description: "Email address of the customer",
    required: false,
  })
  @IsOptional()
  @IsString()
  customer_email?: string

  @ApiProperty({
    example: "+91",
    description: "Country code of the customer",
    required: false,
  })
  @IsOptional()
  @IsString()
  customer_country_code?: string

  @ApiProperty({
    example: "REF12345",
    description: "Customer reference number",
    required: false,
  })
  @IsOptional()
  @IsString()
  customer_ref_no?: string

  @ApiProperty({
    example: 1,
    description: "Form wizard progress step",
    required: false,
  })
  @IsOptional()
  @IsInt()
  current_step?: number

  plan_id: number

  @ApiProperty({
    example: 1,
    description: "Enter the prn number of the customer",
    required: false,
  })
  @IsOptional()
  prn_number?: string

  @ApiProperty({
    example: "Regular",
    description: "Enter the appointment type of the customer",
    required: false,
  })
  @IsOptional()
  @IsString()
  appointment_type: string

  document_type?: string

  @ApiProperty({
    example: 1,
    description: "Enter Episode number",
    required: false,
  })
  @IsOptional()
  @IsInt()
  episode_id?: number

  @ApiProperty({
    example: 1,
    description: "Enter the log",
    required: false,
  })
  @IsOptional()
  @IsInt()
  log_id?: number

  @ApiProperty({
    example: true,
    description: "Is trip OTP flag",
    required: false,
  })
  @IsOptional()
  is_trip_otp_required?: string
}
