feat: add Student-User association and activate all notification TODOs
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
ManyToOne,
|
||||
OneToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
} from 'typeorm';
|
||||
@@ -12,6 +13,7 @@ import { Occupancy } from './occupancy.entity';
|
||||
import { PersonalExpense } from './personal-expense.entity';
|
||||
import { Bill } from './bill.entity';
|
||||
import { Tenant } from './tenant.entity';
|
||||
import { User } from './user.entity';
|
||||
|
||||
@Entity('students')
|
||||
export class Student {
|
||||
@@ -59,6 +61,13 @@ export class Student {
|
||||
@OneToMany(() => Occupancy, (o) => o.student)
|
||||
occupancies: Occupancy[];
|
||||
|
||||
@Column({ name: 'user_id', type: 'integer', nullable: true, unique: true })
|
||||
userId: number;
|
||||
|
||||
@OneToOne(() => User, { nullable: true })
|
||||
@JoinColumn({ name: 'user_id' })
|
||||
user: User;
|
||||
|
||||
@Column({ name: 'tenant_id', type: 'integer', nullable: true })
|
||||
tenantId: number;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user