import { ApiProperty } from "@nestjs/swagger"
import { IsArray, IsOptional, IsString, ValidateNested } from "class-validator"
import { CreateCustomerTreatmentPlanImageDto } from "./customer-treatment-image.dto"
import { Type } from "class-transformer"

export class CreateCustomerTreatmentPlanDto {
  customer_id: number

  @ApiProperty({
    example: "Patient requires follow-up in 6 weeks.",
    description: "Comments or notes for the treatment plan",
    required: false,
  })
  @IsOptional()
  @IsString()
  comments?: string

  @ApiProperty({
    type: [CreateCustomerTreatmentPlanImageDto],
    description: "Array of uploaded images or files for this treatment plan",
    required: false,
  })
  @IsOptional()
  @IsArray()
  @ValidateNested({ each: true })
  @Type(() => CreateCustomerTreatmentPlanImageDto)
  images?: CreateCustomerTreatmentPlanImageDto[]
}
