forked from wangziqi/gongxue-base
feat: replace tenants with organization management
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
Index,
|
||||
} from 'typeorm';
|
||||
import { Classroom } from './classroom.entity';
|
||||
import { Tenant } from './tenant.entity';
|
||||
import { Organization } from './organization.entity';
|
||||
|
||||
@Entity('classroom_rentals')
|
||||
@Index(['classroomId', 'startDate', 'endDate'])
|
||||
@@ -24,12 +24,19 @@ export class ClassroomRental {
|
||||
@JoinColumn({ name: 'classroom_id' })
|
||||
classroom: Classroom;
|
||||
|
||||
@Column({ name: 'tenant_id' })
|
||||
tenantId: number;
|
||||
@Column({ name: 'lessor_organization_id', nullable: true })
|
||||
lessorOrganizationId: number;
|
||||
|
||||
@ManyToOne(() => Tenant)
|
||||
@JoinColumn({ name: 'tenant_id' })
|
||||
tenant: Tenant;
|
||||
@ManyToOne(() => Organization)
|
||||
@JoinColumn({ name: 'lessor_organization_id' })
|
||||
lessorOrganization: Organization;
|
||||
|
||||
@Column({ name: 'lessee_organization_id', nullable: true })
|
||||
lesseeOrganizationId: number;
|
||||
|
||||
@ManyToOne(() => Organization)
|
||||
@JoinColumn({ name: 'lessee_organization_id' })
|
||||
lesseeOrganization: Organization;
|
||||
|
||||
@Column({ name: 'start_date', type: 'date' })
|
||||
startDate: string;
|
||||
@@ -64,5 +71,4 @@ export class ClassroomRental {
|
||||
|
||||
@UpdateDateColumn({ name: 'updated_at' })
|
||||
updatedAt: Date;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user