UNPKG

@tomei/live-price

Version:

Tomei live-price Package

64 lines (54 loc) 1.62 kB
import { Column, DataType, HasMany, Table, Model, HasOne, } from 'sequelize-typescript'; import { IFeedAttr } from '../interfaces/price-feed-attr.interface'; import SourceFeedModel from './price-source-feed.entity'; import FeedManualPriceHistoryModel from './price-feed-manual-price-history.entity'; import TomeiPriceHistoryModel from './price-tomei-price-history.entity'; import PriceCompanyFeedAccess from './price-company-feed-access.entity'; import { NonSourceFeedName, SourceFeedName } from '../enum/feed.enum'; @Table({ tableName: 'price_Feed', timestamps: false, }) export default class FeedModel extends Model implements IFeedAttr { @Column({ primaryKey: true, allowNull: false, type: DataType.STRING(50), }) FeedName: SourceFeedName | NonSourceFeedName; @Column({ allowNull: false, type: DataType.CHAR(1), }) IsSourcePriceYN: string; @Column({ allowNull: false, type: DataType.CHAR(1), }) IsManualPriceActivatedYN: string; @Column({ allowNull: true, type: DataType.STRING(30), }) CurrentManualPriceHistoryId: string; @Column({ allowNull: true, type: DataType.DECIMAL(10, 2), }) Weight: number; @HasMany(() => FeedManualPriceHistoryModel) FeedManualPriceHistories: FeedManualPriceHistoryModel[]; @HasMany(() => TomeiPriceHistoryModel) TomeiPriceHistories: TomeiPriceHistoryModel[]; @HasMany(() => PriceCompanyFeedAccess) CompanyFeedAccesses: PriceCompanyFeedAccess[]; @HasOne(() => SourceFeedModel) SourceFeed: SourceFeedModel; }