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

export class CreatePackageDto {
  @ApiProperty({ description: 'Package name', example: '10-session package' })
  @IsString()
  @IsNotEmpty()
  name: string;

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

  @ApiProperty({ description: 'Package price', example: 25000 })
  @IsNumber({ maxDecimalPlaces: 2 })
  @Min(0)
  price: number;

  @ApiProperty({ description: 'Total sessions included', example: 10 })
  @IsInt()
  @Min(1)
  totalSessions: number;

  @ApiProperty({ description: 'Validity period in days', example: 90 })
  @IsInt()
  @Min(1)
  validDays: number;

  @ApiProperty({ description: 'Service UUID this package belongs to' })
  @IsUUID()
  @IsNotEmpty()
  serviceId: string;

  @ApiPropertyOptional({ description: 'Whether package is active', default: true })
  @IsBoolean()
  @IsOptional()
  isActive?: boolean;
}
