refactor: changed the project structure
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { Attachment } from "src/modules/attachment/entities/attachment.entity";
|
||||
import { BaseEntity } from "src/common/entities/base.entity";
|
||||
import { Complaint } from "src/modules/complaint/entities/complaint.entity";
|
||||
import { User } from "src/modules/users/entities/user.entity";
|
||||
import { Column, Entity, ManyToOne, OneToMany } from "typeorm";
|
||||
import { ReplyAttachment } from "./reply-attachment.entity";
|
||||
|
||||
@Entity('replies')
|
||||
export class Reply extends BaseEntity {
|
||||
@Column({
|
||||
type: 'text'
|
||||
})
|
||||
content: string; // the text or message written.
|
||||
|
||||
@ManyToOne(() => User)
|
||||
sender: User;
|
||||
|
||||
@ManyToOne(() => User)
|
||||
receiver: User;
|
||||
|
||||
@ManyToOne(() => Complaint, (complaint) => complaint.messages)
|
||||
complaint: Complaint;
|
||||
|
||||
@OneToMany(() => ReplyAttachment, (ra) => ra.reply)
|
||||
attachments: ReplyAttachment;
|
||||
}
|
||||
Reference in New Issue
Block a user