ticket
This commit is contained in:
Executable
+40
@@ -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[]
|
||||
}
|
||||
Reference in New Issue
Block a user