This commit is contained in:
2026-03-09 12:46:39 +03:30
parent 9e33129902
commit b264500802
10 changed files with 248 additions and 11 deletions
@@ -1 +1,33 @@
export class Catalogue {}
import {
Cascade, Collection, Entity, EntityRepositoryType, Enum,
ManyToOne, OneToMany, OneToOne, Opt, Property
} from "@mikro-orm/core";
import { BaseEntity } from "../../../common/entities/base.entity";
import { Business } from "src/modules/business/entities/business.entity";
import { CatalogueSize, CatalogueStatus } from "../enums/company-status.enum";
import { CatalogueRepository } from "../repositories/catalogue.repository";
@Entity({ repository: () => CatalogueRepository })
export class Catalogue extends BaseEntity {
@Property({ type: "varchar", length: 255, unique: true })
name!: string;
@Property({ type: "json" })
content!: string;
@Enum({ items: () => CatalogueStatus, nullable: false })
status!: CatalogueStatus;
@Enum({ items: () => CatalogueSize, nullable: false })
size!: CatalogueSize;
//-----------------------------------
@ManyToOne(() => Business, { deleteRule: "restrict" })
business!: Business;
//-----------------------------------
[EntityRepositoryType]?: CatalogueRepository;
}