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

export class CreateEpisodeLogDto {
  @ApiProperty({
    example: 1,
    description: "The ID of the episode",
  })
  @IsNotEmpty()
  @IsNumber()
  episode_id: number

  @ApiProperty({
    example: 1,
    description: "The log number",
  })
  @IsOptional()
  @IsString()
  log_number: string

  @ApiProperty({
    example: 12345,
    description: "The reference number",
    required: false,
  })
  @IsOptional()
  @IsString()
  reference_number?: string

  @ApiProperty({
    example: 67890,
    description: "The PRN number",
    required: false,
  })
  @IsOptional()
  @IsString()
  prn_number?: string

  @ApiProperty({
    example: 1,
    description: "The hospital ID",
    required: false,
  })
  @IsOptional()
  @IsNumber()
  hospital_id?: number

  @ApiProperty({
    example: "2023-01-01T00:00:00.000Z",
    description: "The log date",
  })
  @IsOptional()
  log_date: Date

  @ApiProperty({
    example: "2023-12-31T00:00:00.000Z",
    description: "The log expiration date",
  })
  @IsOptional()
  log_expiration: Date

  @ApiProperty({
    example: "active",
    description: "The status of the log",
    required: false,
  })
  @IsOptional()
  @IsString()
  status?: string

  @ApiProperty({
    example:
      "https://your-r2-domain.com/episode-logs/1/1234567890-document.pdf",
    description:
      "The URL of the log document (from Cloudflare R2 after upload via presigned URL)",
    required: false,
  })
  @IsOptional()
  @IsString()
  log_document?: string
}
