import { Entity, ManyToMany } from 'typeorm';
import { BaseEntity } from '../base-entity';
import { MultiName, MultiNamed } from './base/multi-named';
import { Copy } from './copy';

@Entity()
export class Translator extends MultiNamed(BaseEntity, 'TranslatorMultiName') {
  @ManyToMany(() => Copy, {
    nullable: false,
    onDelete: 'CASCADE',
    onUpdate: 'CASCADE',
  })
  public copies: Promise<Copy[]>;
}

@Entity()
export class TranslatorMultiName extends MultiName('Translator') {}
