34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
|
|
import { SalesPriceFormulaEntity } from '../../domain/entities/sales-price-formula.entity';
|
|
import { Column, Entity } from 'typeorm';
|
|
import { BaseModel } from 'src/core/modules/data/model/base.model';
|
|
import { FormulaType } from '../../constants';
|
|
|
|
@Entity(TABLE_NAME.PRICE_FORMULA)
|
|
export class SalesPriceFormulaModel
|
|
extends BaseModel<SalesPriceFormulaEntity>
|
|
implements SalesPriceFormulaEntity
|
|
{
|
|
@Column('enum', {
|
|
name: 'type',
|
|
enum: FormulaType,
|
|
default: FormulaType.SALES_PRICE,
|
|
})
|
|
type: FormulaType;
|
|
|
|
@Column('json', { name: 'formula_render', nullable: true })
|
|
formula_render: any;
|
|
|
|
@Column('varchar', { name: 'formula_string', nullable: true })
|
|
formula_string: string;
|
|
|
|
@Column('varchar', { default: 'dpp' })
|
|
value_for: string;
|
|
|
|
@Column('varchar', { name: 'example_formula', nullable: true })
|
|
example_formula: string;
|
|
|
|
@Column('numeric', { name: 'example_result', nullable: true })
|
|
example_result: number;
|
|
}
|