feat: add rental_category/rate to Room, rental_type/tenant_id to Occupancy, tenant_id to Student
This commit is contained in:
@@ -4,11 +4,14 @@ import {
|
||||
Column,
|
||||
CreateDateColumn,
|
||||
UpdateDateColumn,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
OneToMany,
|
||||
} from 'typeorm';
|
||||
import { Occupancy } from './occupancy.entity';
|
||||
import { PersonalExpense } from './personal-expense.entity';
|
||||
import { Bill } from './bill.entity';
|
||||
import { Tenant } from './tenant.entity';
|
||||
|
||||
@Entity('students')
|
||||
export class Student {
|
||||
@@ -54,6 +57,13 @@ export class Student {
|
||||
@OneToMany(() => Occupancy, (o) => o.student)
|
||||
occupancies: Occupancy[];
|
||||
|
||||
@Column({ name: 'tenant_id', type: 'integer', nullable: true })
|
||||
tenantId: number;
|
||||
|
||||
@ManyToOne(() => Tenant, { nullable: true })
|
||||
@JoinColumn({ name: 'tenant_id' })
|
||||
tenant: Tenant;
|
||||
|
||||
@OneToMany(() => PersonalExpense, (e) => e.student)
|
||||
personalExpenses: PersonalExpense[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user