18 lines
553 B
TypeScript
18 lines
553 B
TypeScript
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;
|
|
} |