import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn } from 'typeorm';

@Entity('section_views')
export class SectionView {
  @PrimaryGeneratedColumn()
  id: number;

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

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

  @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 })
  session_id: string;

  @Column({ type: 'int', default: 0 })
  view_duration: number;

  @CreateDateColumn()
  view_date: Date;
}
