UNPKG

@tomei/product

Version:

NestJS package for product module

49 lines (41 loc) 919 B
import { Column, CreatedAt, DataType, ForeignKey, Model, Table, UpdatedAt, BelongsTo, } from 'sequelize-typescript'; import { ProductModel } from './product.entity'; import { SettingsGroupModel } from './settings-group.entity'; @Table({ tableName: 'product_ProductGroup', timestamps: false }) export class ProductGroupModel extends Model { @Column({ type: DataType.STRING, allowNull: false, primaryKey: true, }) ProductGroupId: string; @ForeignKey(() => ProductModel) @Column({ allowNull: false, type: DataType.STRING, }) ProductId: string; @ForeignKey(() => SettingsGroupModel) @Column({ allowNull: false, type: DataType.STRING, }) Code: string; @BelongsTo(() => ProductModel) Product: ProductModel; @BelongsTo(() => SettingsGroupModel) ProductGroup: SettingsGroupModel; @CreatedAt CreatedAt: Date; @UpdatedAt UpdatedAt: Date; }