order
This commit is contained in:
@@ -7,24 +7,25 @@ import {
|
||||
Collection,
|
||||
Cascade,
|
||||
Enum,
|
||||
PrimaryKey,
|
||||
} 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 { 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;
|
||||
@PrimaryKey({ type: "bigint", autoincrement: true })
|
||||
id: bigint;
|
||||
|
||||
@Enum(() => TicketStatus)
|
||||
status: TicketStatus;
|
||||
// TODO : create relation
|
||||
@Property({ type: 'json' })
|
||||
products: Product | null;
|
||||
|
||||
@Property({ type: 'text' })
|
||||
content: string;
|
||||
|
||||
@ManyToOne(() => Admin)
|
||||
admin: Admin | null;
|
||||
@@ -35,6 +36,9 @@ export class Ticket extends BaseEntity {
|
||||
@ManyToOne(() => Ticket)
|
||||
parent: Ticket | null;
|
||||
|
||||
@OneToMany(()=>Ticket,(ticket)=>ticket.id)
|
||||
children=new Collection<Ticket>(this)
|
||||
|
||||
@Property({ type: 'json' })
|
||||
attachments: string[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user