import { Column, Entity, ManyToMany, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { AuthorRoleName } from './author-role-name'; import { WorkAuthor } from './work-author'; @Entity() export class AuthorRole implements AuthorRoleEntityInterface { @PrimaryGeneratedColumn() public readonly id!: number; @Column({ nullable: false, default: '', }) public nameCanonical!: string; @OneToMany(() => AuthorRoleName, (authorRoleName: AuthorRoleNameEntityInterface) => authorRoleName.entity) public names!: Promise; @ManyToMany(() => WorkAuthor, (workAuthor: WorkAuthorEntityInterface) => workAuthor.authorRoles) public workAuthors!: Promise; @Column({ nullable: false, default: '', }) public description!: string; }