import { ApiProperty } from "@nestjs/swagger"
import { IsInt, IsNotEmpty, IsOptional, IsString } from "class-validator"
import { messageKey } from "src/constants/message-keys"
import { validationMessage } from "src/utils/helpers"

export class CreateEscortDto {
  @ApiProperty({ example: 1, description: "ID of the customer" })
  @IsInt()
  @IsNotEmpty({
    message: validationMessage(messageKey.field_required, {
      ":field": "customer_id",
    }),
  })
  customer_id: number

  @ApiProperty({
    example: "1",
    description: "Escort id",
  })
  @IsOptional()
  @IsString()
  escort_id?: string

  @ApiProperty({
    example: "John Doe",
    description: "Name of the escort",
  })
  @IsOptional()
  @IsString()
  name?: string

  @ApiProperty({
    example: "Brother",
    description: "Relation with the customer",
  })
  @IsOptional()
  @IsString()
  relation?: string

  @ApiProperty({ example: "Male", description: "Gender of the escort" })
  @IsOptional()
  @IsString()
  gender?: string

  @ApiProperty({ example: "1990-01-01", type: String })
  @IsOptional()
  @IsString()
  date_of_birth?: string

  @ApiProperty({ example: "A1234567", description: "Passport number" })
  @IsOptional()
  @IsString()
  passport_number?: string

  @ApiProperty({
    example: "+91",
    description: "Country code for phone number",
  })
  @IsOptional()
  @IsString()
  country_code?: string

  @ApiProperty({ example: "9876543210", description: "Phone number" })
  @IsOptional()
  @IsString()
  phone_number?: string

  @ApiProperty({
    example: "john@example.com",
    description: "Email address",
  })
  @IsOptional()
  @IsString()
  email?: string

  @ApiProperty({ example: "2025-01-01", type: String })
  @IsOptional()
  @IsString()
  visa_start_date?: string

  @ApiProperty({ example: "2025-12-31", type: String })
  @IsOptional()
  visa_end_date?: string

  @ApiProperty({
    example: true,
    description: "Is the escort sponsored?",
  })
  @IsOptional()
  @IsString()
  is_sponsered?: string

  @ApiProperty({
    example: false,
    description: "Set to true to remove this escort (for bulk upsert)",
    required: false,
  })
  @IsOptional()
  should_remove?: boolean

  @ApiProperty({
    example: "Escort",
    description: "Escort type",
  })
  @IsOptional()
  @IsString()
  escort_type?: string
}
