import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm"; import { template } from "./template"; import { PermissionModule } from "../type/permissionTypes"; @Entity() export class templateUsage { @PrimaryColumn({ type: "varchar", length: 255 }) scope: PermissionModule; @Column({ type: "number", nullable: true }) headerId: number | null; @Column({ type: "number", nullable: true }) bodyId: number | null; @Column({ type: "number", nullable: true }) footerId: number | null; @ManyToOne(() => template, { nullable: true, onDelete: "RESTRICT", onUpdate: "RESTRICT", }) header: template | null; @ManyToOne(() => template, { nullable: true, onDelete: "RESTRICT", onUpdate: "RESTRICT", }) body: template | null; @ManyToOne(() => template, { nullable: true, onDelete: "RESTRICT", onUpdate: "RESTRICT", }) footer: template | null; }