import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'; import { Transformation } from './transformation'; import { TransformationTypeName } from './transformation-type-name'; /** * This entity describes a transformation type. * Possible type: translation, decensor, collection, ... */ @Entity() export class TransformationType implements IIdentifiableEntity, IMultiNamedEntity, IDescribableEntity { @PrimaryGeneratedColumn() public id: number; @Column({ nullable: false, }) public nameCanonical: string; @OneToMany( () => TransformationTypeName, (transformationTypeName: TransformationTypeName) => transformationTypeName.entity ) public names: Promise; @Column({ nullable: true, }) public description: string; /** * the transformations of this type */ @OneToMany(() => Transformation, (transformation: Transformation) => transformation.type) public transformations: Promise; /** * if that trnasformation conserves the tags of the original work */ @Column({ nullable: false, default: false, }) public conservesTags: boolean; }