feat: add bed_id and locker_id to Occupancy entity

This commit is contained in:
2026-07-09 11:52:34 +08:00
parent 513b6c11e4
commit a6fbb71251

View File

@@ -9,6 +9,8 @@ import {
import { Student } from './student.entity';
import { Room } from './room.entity';
import { Tenant } from './tenant.entity';
import { Bed } from './bed.entity';
import { Locker } from './locker.entity';
import { Department } from './department.entity';
@Entity('occupancies')
@@ -40,6 +42,20 @@ export class Occupancy {
@Column({ type: 'text', nullable: true })
notes: string;
@Column({ name: 'bed_id', type: 'integer', nullable: true })
bedId: number;
@ManyToOne(() => Bed, { nullable: true })
@JoinColumn({ name: 'bed_id' })
bed: Bed;
@Column({ name: 'locker_id', type: 'integer', nullable: true })
lockerId: number;
@ManyToOne(() => Locker, { nullable: true })
@JoinColumn({ name: 'locker_id' })
locker: Locker;
@Column({ name: 'rental_type', length: 10, default: 'short' })
rentalType: string;