feat: add relationships between user, notif, organ
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { BaseEntity } from "src/common/entities/base.entity";
|
||||
import { Organ } from "src/modules/organ/entities/organ.entity";
|
||||
import { User } from "src/modules/users/entities/user.entity";
|
||||
import { Column, Entity, ManyToOne } from "typeorm";
|
||||
|
||||
@Entity('notifications')
|
||||
export class AppNotification extends BaseEntity {
|
||||
@Column({
|
||||
type: 'boolean'
|
||||
})
|
||||
isRead: boolean;
|
||||
|
||||
@ManyToOne(() => User, (user) => user.notifications)
|
||||
receiver: User;
|
||||
|
||||
@ManyToOne(() => Organ, (organ) => organ.sentNotifications)
|
||||
senderOrgan: Organ;
|
||||
}
|
||||
Reference in New Issue
Block a user