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

export class QueryDauDto {
  @ApiProperty({ example: '2025-01-01' }) @IsDateString() startDate: string;
  @ApiProperty({ example: '2025-01-31' }) @IsDateString() endDate: string;
}

export class QueryEventsDto {
  @ApiPropertyOptional({ minimum: 1, default: 1 }) @IsOptional() @Type(() => Number) @IsInt() @Min(1) page?: number;
  @ApiPropertyOptional({ minimum: 1, maximum: 100, default: 20 }) @IsOptional() @Type(() => Number) @IsInt() @Min(1) @Max(100) limit?: number;
  @ApiPropertyOptional() @IsOptional() @IsString() eventName?: string;
  @ApiPropertyOptional() @IsOptional() @IsUUID() userId?: string;
}
