feat: add relationships between user, notif, organ

This commit is contained in:
2026-07-31 23:58:47 +03:30
parent b4e5fd4e7e
commit 78b82e05b5
6 changed files with 46 additions and 4 deletions
@@ -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;
}