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

@Entity({ name: 'progress' })
export class Progress {
  @PrimaryGeneratedColumn({ type: 'bigint' })
  id!: number;

  @Column({ type: 'varchar', length: 128 })
  anonymousSessionId!: string;

  @Column({ type: 'varchar', length: 128 })
  entityType!: string;

  @Column({ type: 'bigint' })
  entityId!: number;

  @Column({ type: 'json', nullable: true })
  progressJson?: Record<string, any>;

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

  @UpdateDateColumn({ name: 'last_updated' })
  lastUpdated!: Date;
}
