import {
  IsString,
  IsNotEmpty,
  IsUUID,
  IsEnum,
  IsDateString,
  IsInt,
  Min,
} from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { LicenseType } from '@prisma/client';

export class CreateLicenseDto {
  @ApiProperty({ description: 'Club UUID' })
  @IsUUID()
  @IsNotEmpty()
  clubId: string;

  @ApiProperty({ description: 'License type', enum: LicenseType })
  @IsEnum(LicenseType)
  type: LicenseType;

  @ApiProperty({ description: 'Start date (ISO 8601)' })
  @IsDateString()
  startDate: string;

  @ApiProperty({ description: 'End date (ISO 8601)' })
  @IsDateString()
  endDate: string;

  @ApiProperty({ description: 'Maximum users allowed', example: 10 })
  @IsInt()
  @Min(1)
  maxUsers: number;

  @ApiProperty({ description: 'Maximum clients allowed', example: 1000 })
  @IsInt()
  @Min(1)
  maxClients: number;
}
