prueba_intricom/src/models/client.model.ts

48 lines
797 B
TypeScript

import { Model, Table, Column, DataType } from "sequelize-typescript";
import Hotel from "./hotel.model.ts";
import Booking from "./booking.model.ts";
@Table({
tableName: "Client",
})
export default class Client extends Model {
@Unique
@Column({
type: DataType.INTEGER,
primaryKey: true,
autoIncrement: true,
field: "id"
})
id: number;
@Column({
type: DataType.STRING(255),
field: "Name"
})
name: string;
@Column({
type: DataType.STRING(255),
field: "Address"
})
address: string;
@Column({
type: DataType.STRING(255),
field: "Phone"
})
phone: string;
@Column({
type: DataType.DATE,
field: "CreatedDate"
defaultValue: DataType.NOW
})
createdDate: Date;
@HasMany(() => Booking)
bookings: Booking[];
}