import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, ManyToOne, JoinColumn } from 'typeorm';
import { Social } from './Social';

@Entity('social_clicks')
export class SocialClick {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  social_id: number;

  @Column({ length: 45 })
  visitor_ip: string;

  @Column({ length: 255 })
  visitor_device_type: string;

  @Column({ nullable: true, length: 255 })
  visitor_user_agent: string;

  @Column({ nullable: true, length: 255 })
  visitor_referrer: string;

  @CreateDateColumn()
  click_date: Date;

  @ManyToOne(() => Social)
  @JoinColumn({ name: 'social_id' })
  social: Social;
}
