import { IsInt, IsOptional, IsString, MaxLength, Min } from 'class-validator';

/**
 * `status` is deliberately absent: moving a module through the publishing
 * workflow requires `module.publish` and goes through the version service.
 */
export class UpdateModuleDto {
  @IsOptional()
  @IsInt()
  sectionId?: number;

  @IsOptional()
  @IsString()
  @MaxLength(255)
  slug?: string;

  @IsOptional()
  @IsString()
  @MaxLength(255)
  title?: string;

  @IsOptional()
  @IsString()
  description?: string;

  @IsOptional()
  @IsInt()
  @Min(0)
  orderIndex?: number;
}
