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

@Entity('page_seo_audit_log')
export class PageSeoAuditLog {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ type: 'int' })
  seo_id: number;

  @Column({
    type: 'enum',
    enum: ['CREATE', 'UPDATE', 'DELETE', 'STATUS_CHANGE', 'TOGGLE_ACTIVE'],
  })
  action_type:
    | 'CREATE'
    | 'UPDATE'
    | 'DELETE'
    | 'STATUS_CHANGE'
    | 'TOGGLE_ACTIVE';

  @Column({ type: 'json', nullable: true })
  changes: any;

  @Column({ type: 'int' })
  user_id: number;

  @CreateDateColumn({ type: 'timestamp' })
  created_at: Date;
}
