ff-admin-server/src/entity/templateUsage.ts

45 lines
1 KiB
TypeScript

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: "int", nullable: true })
headerId: number | null;
@Column({ type: "int", nullable: true })
bodyId: number | null;
@Column({ type: "int", nullable: true })
footerId: number | null;
@Column({ type: "int", nullable: true })
headerHeight: number | null;
@Column({ type: "int", nullable: true })
footerHeight: 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;
}