37 lines
603 B
TypeScript
37 lines
603 B
TypeScript
import { Hotel } from "@/database/entities/hotel.entity";
|
|
import {
|
|
Entity,
|
|
ManyToOne,
|
|
PrimaryKey,
|
|
Property,
|
|
type Rel,
|
|
} from "@mikro-orm/core";
|
|
|
|
@Entity()
|
|
export class HotelSchedule {
|
|
@PrimaryKey({ type: "varchar", length: 30 })
|
|
id!: string;
|
|
|
|
@ManyToOne(() => Hotel)
|
|
hotel!: Rel<Hotel>;
|
|
|
|
@Property({ type: "time" })
|
|
checkIn!: string;
|
|
|
|
@Property({ type: "time" })
|
|
checkOut!: string;
|
|
|
|
@Property({
|
|
type: "timestamp",
|
|
onCreate: () => new Date(),
|
|
})
|
|
createdAt!: Date;
|
|
|
|
@Property({
|
|
type: "timestamp",
|
|
onCreate: () => new Date(),
|
|
onUpdate: () => new Date(),
|
|
})
|
|
updatedAt!: Date;
|
|
}
|