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

export class CreateServiceTypeDto {
  @ApiProperty({ description: 'Service type display name', maxLength: 255 })
  @IsString()
  @MaxLength(255)
  serviceName!: string;

  @ApiPropertyOptional({ description: 'Detailed description' })
  @IsOptional()
  @IsString()
  description?: string;

  @ApiPropertyOptional({ default: true })
  @IsOptional()
  @IsBoolean()
  canBeBookedAlone?: boolean;

  @ApiPropertyOptional({ default: false })
  @IsOptional()
  @IsBoolean()
  includesFirstMile?: boolean;

  @ApiPropertyOptional({ default: false })
  @IsOptional()
  @IsBoolean()
  includesLastMile?: boolean;

  @ApiPropertyOptional({ default: false })
  @IsOptional()
  @IsBoolean()
  includesCustoms?: boolean;

  @ApiPropertyOptional({
    description: 'Priority bonus points awarded when this service is used (0–15)',
    default: 0,
    maximum: 15,
  })
  @IsOptional()
  @IsInt()
  @Min(0)
  @Max(15)
  priorityBonusPoints?: number;

  @ApiPropertyOptional({ default: true })
  @IsOptional()
  @IsBoolean()
  isActive?: boolean;

  @ApiPropertyOptional({ default: 1 })
  @IsOptional()
  @IsInt()
  @Min(1)
  displayOrder?: number;

  @ApiPropertyOptional({ description: 'Insert after this record ID' })
  @IsOptional()
  @IsUUID('4')
  insertAfterId?: string;
}
