UNPKG

@tomei/rental

Version:
106 lines (89 loc) 1.74 kB
import { Column, DataType, Table, Model, ForeignKey, BelongsTo, CreatedAt, UpdatedAt, } from 'sequelize-typescript'; import { RentalPriceModel } from './rental-price.entity'; import { BookingStatusEnum } from '../enum/booking.enum'; @Table({ tableName: 'booking_Booking', }) export class BookingModel extends Model { @Column({ primaryKey: true, allowNull: false, type: DataType.STRING(30), }) BookingNo: string; @Column({ allowNull: false, type: DataType.STRING(30), }) CustomerId: string; @Column({ allowNull: false, type: DataType.STRING(30), }) CustomerType: string; @Column({ allowNull: false, type: DataType.STRING(30), }) ItemId: string; @Column({ allowNull: false, type: DataType.STRING(30), }) ItemType: string; @ForeignKey(() => RentalPriceModel) @Column({ allowNull: false, type: DataType.STRING(30), }) PriceId: string; @Column({ allowNull: false, type: DataType.DATE, }) ScheduledStartDateTime: Date; @Column({ allowNull: false, type: DataType.DATE, }) ScheduledEndDateTime: Date; @Column({ allowNull: true, type: DataType.DECIMAL(10, 2), }) BookingFee: number; @Column({ allowNull: false, type: DataType.STRING(20), }) Status: BookingStatusEnum; @Column({ type: DataType.STRING(3000), }) CancelRemarks: string; @Column({ allowNull: false, type: DataType.STRING(30), }) CreatedById: string; @CreatedAt CreatedAt: Date; @Column({ allowNull: false, type: DataType.STRING(30), }) UpdatedById: string; @UpdatedAt UpdatedAt: Date; @BelongsTo(() => RentalPriceModel) RentalPrice: RentalPriceModel; }