UNPKG

@tomei/rental

Version:
71 lines (60 loc) 1.16 kB
import { Column, DataType, Table, Model, ForeignKey, BelongsTo, CreatedAt, UpdatedAt, } from 'sequelize-typescript'; import { RentalModel } from './rental.entity'; @Table({ tableName: 'rental_JointHirer', }) export class JointHirerModel extends Model { @Column({ primaryKey: true, allowNull: false, type: DataType.STRING(30), }) HirerId: string; @ForeignKey(() => RentalModel) @Column({ allowNull: false, type: DataType.STRING(30), }) RentalId: 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(20), defaultValue: 'Active', }) Status: string = 'Active'; // Default status @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(() => RentalModel) RentalPrice: RentalModel; }