import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsOptional, IsEnum } from 'class-validator';
import { EntityType } from './EntityType';
import { VisitorType } from './VisitorType';

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;
}