import { Task } from '../../../repositories/tasks/entity/task.entity';
import { Entity, Column, PrimaryGeneratedColumn, OneToOne } from 'typeorm';

@Entity({ name: 'audio_files' })
export class AudioFile {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  account_id: number;
  @Column()
  owner_user_id: number;
  @Column()
  url: string;
  @Column()
  file_name: string;
  @Column()
  author_id: string;
  @Column()
  work_type_id: string;
  @Column()
  started_at: Date;
  @Column({ type: 'time' })
  duration: string;
  @Column()
  finished_at: Date;
  @Column()
  uploaded_at: Date;
  @Column()
  file_size: number;
  @Column()
  priority: string;
  @Column()
  audio_format: string;
  @Column({ nullable: true })
  comment?: string;
  @Column({ nullable: true })
  deleted_at?: Date;
  @Column()
  is_encrypted: boolean;
  @OneToOne(() => Task, (task) => task.file)
  task?: Task;
}
