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

export class CreateCancelReasonDto {
  @ApiProperty({
    description: "The name of the cancel reason",
    maxLength: 255,
    example: "Incorrect pickup address provided.",
  })
  @IsNotEmpty()
  @IsString()
  @MaxLength(255)
  name: string

  @ApiPropertyOptional({
    description: "Optional description of the cancel reason",
    example: "Incorrect pickup address provided.",
  })
  @IsString()
  @IsOptional()
  description?: string

  @ApiPropertyOptional({
    description: "Whether the cancel reason is active",
    example: true,
    default: true,
  })
  @IsBoolean()
  @IsOptional()
  is_active?: boolean
}
