import { EntityType, VisitorType } from '@core/analytics/domain/types/PageView';
import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsOptional, IsString } from 'class-validator';

export class RecordPageViewInputDTO {
  @ApiProperty({ enum: EntityType })
  @IsEnum(EntityType)
  entityType!: EntityType;

  @ApiProperty()
  @IsString()
  entityId!: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  visitorId?: string;

  @ApiProperty({ enum: VisitorType })
  @IsEnum(VisitorType)
  visitorType!: VisitorType;

  @ApiProperty()
  @IsString()
  sessionId!: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  referrer?: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  userAgent?: string;

  @ApiProperty({ required: false })
  @IsOptional()
  @IsString()
  country?: string;
}