business
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user