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

export class CreateMasterFormSectionDto {
  @ApiProperty({ description: 'Unique section key identifier', example: 'FS_PERSONALINFO' })
  @IsString()
  @IsNotEmpty()
  @MaxLength(100)
  sectionKey: string;

  @ApiProperty({ description: 'Section name', example: 'Personal Information' })
  @IsString()
  @IsNotEmpty()
  @MaxLength(255)
  name: string;

  @ApiProperty({ description: 'Section description', required: false, example: 'Section for personal details' })
  @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', default: true, required: false })
  @IsOptional()
  @IsBoolean()
  isActive?: boolean;

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