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

@Entity('work_day_statistics')
@Index(['workId', 'recordDate'], { unique: true })
export class WorkDayStatistics {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column({ name: 'work_id', type: 'int' })
  workId!: number;

  @Column({ name: 'record_date', type: 'date' })
  recordDate!: Date;

  @Column({ name: 'play_count', type: 'int', default: 0, comment: '播放数' })
  playCount!: number;

  @Column({ name: 'like_count', type: 'int', default: 0, comment: '点赞数' })
  likeCount!: number;

  @Column({ name: 'comment_count', type: 'int', default: 0, comment: '评论数' })
  commentCount!: number;

  @Column({ name: 'share_count', type: 'int', default: 0, comment: '分享数' })
  shareCount!: number;

  @Column({ name: 'collect_count', type: 'int', default: 0, comment: '收藏数' })
  collectCount!: number;

  @CreateDateColumn({ name: 'created_at' })
  createdAt!: Date;

  @UpdateDateColumn({ name: 'updated_at' })
  updatedAt!: Date;
}
