RenaiApp/src/main/entities/library/transformation-type.ts

45 lines
1.2 KiB
TypeScript

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<TransformationTypeName[]>;
@Column({
nullable: true,
})
public description!: string;
/**
* the transformations of this type
*/
@OneToMany(() => Transformation, (transformation: Transformation) => transformation.type)
public transformations!: Promise<Transformation[]>;
/**
* if that transformation conserves the tags of the original work
*/
@Column({
nullable: false,
default: false,
})
public conservesTags!: boolean;
}