UNPKG

@tomei/product

Version:

NestJS package for product module

50 lines (40 loc) 1.02 kB
import { BelongsToMany, Column, CreatedAt, DataType, Model, Table, UpdatedAt, } from 'sequelize-typescript'; import { ProductCollectionsModel } from './product-collection.entity'; import { ProductModel } from './product.entity'; import { StatusEnum } from '../enum/status.enum'; @Table({ tableName: 'product_Collection' }) export class SettingsCollectionModel extends Model { @Column({ allowNull: false, primaryKey: true, unique: true, }) Code: string; @Column({ type: DataType.STRING(100) }) Name: string; @Column({ type: DataType.STRING(1000) }) Description: string; @Column({ type: DataType.ENUM('Active', 'Inactive'), defaultValue: 'Active', }) Status: StatusEnum; @Column({ type: DataType.STRING(30) }) CreatedById: string; @CreatedAt CreatedAt: Date; @Column({ type: DataType.STRING(30) }) UpdatedById: string; @UpdatedAt UpdatedAt: Date; @BelongsToMany(() => ProductModel, () => ProductCollectionsModel) Products: ProductModel[]; }