This commit is contained in:
2026-01-10 15:02:13 +03:30
parent 7cc6464f31
commit aa23bf5614
14 changed files with 1177 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
import {
Entity,
Index,
ManyToOne,
OneToMany,
Property,
Collection,
Cascade,
Enum,
} from '@mikro-orm/core';
import { BaseEntity } from "../../../common/entities/base.entity";
import { User } from "../../user/entities/user.entity";
import { TicketStatus } from "../enums/ticket-status.enum";
import { product } from 'src/modules/product/entities/product.entity';
import { Admin } from 'src/modules/admin/entities/admin.entity';
@Entity()
export class Ticket extends BaseEntity {
@Property({ type: "bigint", primary: true })
id: number;
@Enum(() => TicketStatus)
status: TicketStatus;
// TODO : create relation
@Property({type:'json'})
products: product | null;
@ManyToOne(() => Admin)
admin: Admin | null;
@ManyToOne(() => User,)
user: User;
@ManyToOne(() => Ticket)
parent: Ticket[];
@Property({ type: 'json' })
attachments: string[]
}