UNPKG

@tomei/product

Version:

NestJS package for product module

47 lines (41 loc) 900 B
import { Column, Table, Model, DataType, ForeignKey, PrimaryKey, BelongsTo, } from 'sequelize-typescript'; import { ProductModel } from './product.entity'; import { SettingsCategoryModel } from './settings-category.entity'; @Table({ tableName: 'product_ProductCategory', timestamps: false, createdAt: false, updatedAt: false, }) export class ProductCategoriesModel extends Model { @PrimaryKey @Column({ allowNull: false, type: DataType.STRING, }) ProductCategoryId: string; @ForeignKey(() => ProductModel) @Column({ allowNull: false, type: DataType.STRING, }) ProductId: string; @ForeignKey(() => SettingsCategoryModel) @Column({ allowNull: false, type: DataType.STRING, }) Code: string; @BelongsTo(() => ProductModel) Product: ProductModel; @BelongsTo(() => SettingsCategoryModel) Category: SettingsCategoryModel; }