UNPKG

@tomei/rental

Version:
48 lines (40 loc) 1.11 kB
import { Column, DataType, Table, Model, HasMany } from 'sequelize-typescript'; import { RentalModel } from './rental.entity'; import { AggrementStatusEnum } from '../enum/aggrement-status.enum'; import { AgreementSignatureModel } from './agreement-signature.entity'; import { AgreementHistoryModel } from './agreement-history.entity'; @Table({ tableName: 'rental_Agreement', createdAt: false, updatedAt: false, timestamps: false, }) export class AgreementModel extends Model { @Column({ primaryKey: true, allowNull: false, type: DataType.STRING(30), }) AgreementNo: string; @Column({ allowNull: false, type: DataType.STRING(20), }) Status: AggrementStatusEnum; @Column({ allowNull: true, type: DataType.DATE, }) DateSigned: Date; @Column({ allowNull: true, type: DataType.STRING(30), }) MediaId: string; @HasMany(() => RentalModel) Rentals: RentalModel[]; @HasMany(() => AgreementSignatureModel) AgreementSignatures: AgreementSignatureModel[]; @HasMany(() => AgreementHistoryModel) History: AgreementHistoryModel[]; }