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