/**
 * DTO used to update an existing commission contract.
 *
 * This DTO supports partial updates, allowing only
 * the fields that need to be modified to be sent.
 */
import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsString, IsNumber, IsOptional } from 'class-validator';

export class UpdateCommissionContractDto {
  /**
   * Commission contract name.
   *
   * Optional field:
   * - If provided, updates the contract name
   * - If omitted, existing value remains unchanged
   */
  @IsOptional()
  @IsString()
  @ApiPropertyOptional()
  name?: string;

  /**
   * Display order of the commission contract.
   *
   * Optional numeric field used for sorting
   * contracts in listings or dropdowns.
   */
  @IsOptional()
  @IsNumber({}, { message: 'order must be a number' })
  @ApiPropertyOptional({ default: 0 })
  order?: number;
}
