import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Transformation } from './transformation'; import { TransformationTypeName } from './transformation-type-name'; @Entity() export class TransformationType implements TransformationTypeEntityInterface { @PrimaryGeneratedColumn() public readonly id!: number; @Column({ nullable: false, default: '', }) public nameCanonical!: string; @OneToMany( () => TransformationTypeName, (transformationTypeName: TransformationTypeNameEntityInterface) => transformationTypeName.entity, {} ) public names!: Promise; @Column({ nullable: false, default: '', }) public description!: string; /** * the transformations of this type */ @OneToMany(() => Transformation, (transformation: TransformationEntityInterface) => transformation.type) public transformations!: Promise; /** * if that transformation conserves the tags of the original work */ @Column({ nullable: false, default: false, }) public conservesTags!: boolean; }