feat(task1): restructure directories for turborepo monorepo
- Move backend/ to apps/server/ via git mv - Move frontend/ to apps/admin/ via git mv - Create packages/typescript-config/ with base, nestjs, and react-vite presets
This commit is contained in:
39
apps/server/src/entities/room.entity.ts
Normal file
39
apps/server/src/entities/room.entity.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, OneToMany } from 'typeorm';
|
||||
import { Occupancy } from './occupancy.entity';
|
||||
import { RoomExpense } from './room-expense.entity';
|
||||
|
||||
@Entity('rooms')
|
||||
export class Room {
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number;
|
||||
|
||||
@Column({ name: 'room_number', length: 20, unique: true })
|
||||
roomNumber: string;
|
||||
|
||||
@Column({ length: 50, nullable: true })
|
||||
building: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
floor: number;
|
||||
|
||||
@Column()
|
||||
capacity: number;
|
||||
|
||||
@Column({ type: 'varchar', length: 20, default: 'available' })
|
||||
status: string;
|
||||
|
||||
@Column({ name: 'room_type', length: 20, nullable: true })
|
||||
roomType: string;
|
||||
|
||||
@Column({ length: 10, nullable: true })
|
||||
gender: string;
|
||||
|
||||
@CreateDateColumn({ name: 'created_at' })
|
||||
createdAt: Date;
|
||||
|
||||
@OneToMany(() => Occupancy, (o) => o.room)
|
||||
occupancies: Occupancy[];
|
||||
|
||||
@OneToMany(() => RoomExpense, (e) => e.room)
|
||||
roomExpenses: RoomExpense[];
|
||||
}
|
||||
Reference in New Issue
Block a user