import { IsEnum, IsOptional, IsString, MaxLength } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export enum CancelReason {
  CLIENT_CANCEL = 'CLIENT_CANCEL',
  NO_DEDUCTION = 'NO_DEDUCTION',
  SALE_RETURN = 'SALE_RETURN',
  SICK = 'SICK',
}

export class CancelTrainingDto {
  @ApiProperty({
    description: 'Reason for cancellation',
    enum: CancelReason,
    example: CancelReason.CLIENT_CANCEL,
  })
  @IsEnum(CancelReason)
  cancelReason: CancelReason;

  @ApiPropertyOptional({
    description: 'Optional comment about the cancellation (max 500 chars)',
    example: 'Client requested to reschedule next week',
  })
  @IsString()
  @MaxLength(500)
  @IsOptional()
  cancelComment?: string;
}
