import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
  UpdateDateColumn,
  OneToMany,
} from 'typeorm';
import { Task } from '../../tasks/entity/task.entity';

@Entity({ name: 'template_files' })
export class TemplateFile {
  @PrimaryGeneratedColumn()
  id: number;
  @Column()
  account_id: number;
  @Column()
  url: string;
  @Column()
  file_name: string;
  @Column({ nullable: true })
  deleted_at?: Date;
  @Column()
  created_by: string;
  @CreateDateColumn()
  created_at: Date;
  @Column()
  updated_by: string;
  @UpdateDateColumn()
  updated_at: Date;
  @OneToMany(() => Task, (task) => task.template_file)
  tasks?: Task[];
}
