import { IsNotEmpty, IsOptional, IsString, IsBoolean, IsUUID, IsNumber, IsArray, MaxLength, Min, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { CreateActivityTicketDto } from './create-activity-ticket.dto';

export class CreateActivityDto {
  @IsUUID() @IsNotEmpty()
  destination_id: string;

  @IsString() @IsOptional() @MaxLength(50)
  short_code?: string;

  @IsString() @IsOptional() @MaxLength(100)
  category?: string;

  @IsString() @IsNotEmpty() @MaxLength(255)
  name: string;

  @IsString() @IsNotEmpty() @MaxLength(500)
  address: string;

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

  @IsString() @IsOptional() @MaxLength(20)
  cutoff_type?: string;

  @IsString() @IsOptional() @MaxLength(20)
  cutoff_value?: string;

  @IsArray() @IsOptional()
  @IsString({ each: true })
  operating_days?: string[];

  @IsArray() @IsOptional()
  maintenance_periods?: { start: string; end: string }[];

  @IsString() @IsOptional() @MaxLength(20)
  gps_latitude?: string;

  @IsString() @IsOptional() @MaxLength(20)
  gps_longitude?: string;

  @IsString() @IsNotEmpty() @MaxLength(255)
  contact_person: string;

  @IsString() @IsOptional() @MaxLength(20)
  contact_phone?: string;

  @IsString() @IsOptional()
  description?: string;

  @IsString() @IsOptional()
  special_instructions?: string;

  @IsString() @IsOptional()
  meeting_point?: string;

  @IsArray() @IsOptional()
  age_config?: { label: string; min_age: number; max_age: number }[];

  @IsArray() @IsOptional()
  @ValidateNested({ each: true })
  @Type(() => CreateActivityTicketDto)
  tickets?: CreateActivityTicketDto[];

  @IsString() @IsOptional() @MaxLength(500)
  cover_image?: string;

  @IsArray() @IsOptional()
  gallery?: { url: string; type: string; filename: string }[];

  @IsBoolean() @IsOptional()
  is_active?: boolean;
}
