chore: template

This commit is contained in:
mahyargdz
2025-07-14 15:47:22 +03:30
parent 9d46c4f20b
commit 513980fe3a
19 changed files with 788 additions and 9 deletions
+5 -1
View File
@@ -5,6 +5,7 @@ import { Role } from "./role.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { Business } from "../../businesses/entities/business.entity";
import { Domain } from "../../domains/entities/domain.entity";
import { Template } from "../../templates/entities/template.entity";
import { UserRepository } from "../repositories/user.repository";
@Entity({ repository: () => UserRepository })
@@ -52,11 +53,14 @@ export class User extends BaseEntity {
@ManyToOne(() => Role, { deleteRule: "restrict" })
role!: Role;
@ManyToOne(() => Business, { deleteRule: "restrict" })
@ManyToOne(() => Business, { deleteRule: "cascade" })
business!: Business;
@ManyToOne(() => Domain, { deleteRule: "restrict" })
domain!: Domain;
@ManyToOne(() => Template, { deleteRule: "restrict", nullable: true })
template?: Template;
[EntityRepositoryType]?: UserRepository;
}