feat: replace tenants with organization management

This commit is contained in:
2026-07-10 21:27:26 +08:00
parent 8ed1682b90
commit 8f0991a51f
49 changed files with 1292 additions and 698 deletions

View File

@@ -8,7 +8,7 @@ import {
} from 'typeorm';
import { Student } from './student.entity';
import { Room } from './room.entity';
import { Tenant } from './tenant.entity';
import { Organization } from './organization.entity';
import { Bed } from './bed.entity';
import { Locker } from './locker.entity';
@@ -55,15 +55,15 @@ export class Occupancy {
@JoinColumn({ name: 'locker_id' })
locker: Locker;
@Column({ name: 'rental_type', length: 10, default: 'short' })
rentalType: string;
@Column({ name: 'stay_type', length: 10, default: 'short' })
stayType: string;
@Column({ name: 'tenant_id', type: 'integer', nullable: true })
tenantId: number;
@Column({ name: 'responsible_organization_id', type: 'integer', nullable: true })
responsibleOrganizationId: number;
@ManyToOne(() => Tenant, { nullable: true })
@JoinColumn({ name: 'tenant_id' })
tenant: Tenant;
@ManyToOne(() => Organization, { nullable: true })
@JoinColumn({ name: 'responsible_organization_id' })
responsibleOrganization: Organization;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
@@ -75,5 +75,4 @@ export class Occupancy {
@ManyToOne(() => Room, (r) => r.occupancies)
@JoinColumn({ name: 'room_id' })
room: Room;
}