import { ApiProperty } from '@nestjs/swagger';
import { IsBoolean, IsInt, IsObject, IsOptional, IsString, MaxLength } from 'class-validator';

export class UpdateMasterFormSectionDto {
  @ApiProperty({ description: 'Section name', required: false, example: 'Personal Information' })
  @IsOptional()
  @IsString()
  @MaxLength(255)
  name?: string;

  @ApiProperty({ description: 'Section description', required: false })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiProperty({ description: 'Parent section ID for nested sections', required: false, type: Number })
  @IsOptional()
  @IsInt()
  parentSectionId?: number;

  @ApiProperty({ description: 'Conditional display configuration', required: false, type: Object })
  @IsOptional()
  @IsObject()
  conditionalConfig?: Record<string, any>;

  @ApiProperty({ description: 'Whether section is active', required: false })
  @IsOptional()
  @IsBoolean()
  isActive?: boolean;

  @ApiProperty({ description: 'User ID who updated this section', required: false })
  @IsOptional()
  @IsInt()
  updatedBy?: number;
}
