feat: add relationships between user, notif, organ
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { Entity, Column, ManyToMany, JoinTable, OneToMany } from 'typeorm';
|
||||
import { Entity, Column, OneToMany } from 'typeorm';
|
||||
import { BaseEntity } from 'src/common/entities/base.entity';
|
||||
import { Exclude } from 'class-transformer';
|
||||
import { UserRole } from './user-role.entity';
|
||||
import { Complaint } from 'src/modules/complaint/entities/complaint.entity';
|
||||
import { AppNotification } from 'src/modules/notifications/entities/notification.entity';
|
||||
|
||||
@Entity('users')
|
||||
export class User extends BaseEntity {
|
||||
@@ -39,4 +40,7 @@ export class User extends BaseEntity {
|
||||
cascade: true
|
||||
})
|
||||
complaints: Complaint[];
|
||||
|
||||
@OneToMany(() => AppNotification, (notif) => notif.receiver)
|
||||
notifications: AppNotification[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user