@tomei/product
Version:
NestJS package for product module
57 lines (44 loc) • 1.37 kB
text/typescript
import {
Table,
Column,
Model,
DataType,
CreatedAt,
UpdatedAt,
BelongsToMany,
HasMany,
} from 'sequelize-typescript';
import { ProductModel } from './product.entity';
import { ProductCategoriesModel } from './product-category.entity';
import { SettingsPlatformCategoryMappingModel } from './settings-platform-category-mapping.entity';
import { StatusEnum } from '../components/group-product/enum/status.enum';
({ tableName: 'product_Category' })
export class SettingsCategoryModel extends Model {
({ primaryKey: true })
Code: string;
({ allowNull: false, unique: true, type: DataType.STRING(100) })
Name: string;
({ allowNull: false, type: DataType.STRING(1000) })
Description: string;
({
type: DataType.ENUM('Active', 'Deactivated'),
defaultValue: 'Active',
})
Status: StatusEnum;
({ allowNull: true })
ParentCode: string;
({ allowNull: true })
CodePath: string;
({ allowNull: false })
CreatedById: string;
CreatedAt: Date;
UpdatedAt: Date;
({ allowNull: false })
UpdatedById: string;
(() => ProductModel, () => ProductCategoriesModel)
Products: ProductModel[];
(() => SettingsPlatformCategoryMappingModel)
PlatformCategoryMapping: SettingsPlatformCategoryMappingModel[];
}