mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 13:28:11 +00:00
implement rule engine module with dynamic booking evaluation, 7 entities, and Postman endpoints
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { BaseEntity } from '@edr/api-common';
|
||||
import { Freight } from '@edr/types';
|
||||
import { Column, Entity, Index } from 'typeorm';
|
||||
|
||||
@Entity({ schema: 'freight', name: 'priority_rules' })
|
||||
@Index(['priorityType'])
|
||||
@Index(['isActive'])
|
||||
export class PriorityRule extends BaseEntity {
|
||||
@Column({ name: 'priority_type', type: 'enum', enum: Freight.PriorityType, unique: true })
|
||||
priorityType!: Freight.PriorityType;
|
||||
|
||||
@Column({ name: 'rule_name', type: 'varchar', length: 255 })
|
||||
ruleName!: string;
|
||||
|
||||
@Column({ name: 'description', type: 'text', nullable: true })
|
||||
description?: string | null;
|
||||
|
||||
@Column({ name: 'activation_condition', type: 'text', nullable: true })
|
||||
activationCondition?: string | null;
|
||||
|
||||
@Column({ name: 'bonus_points', type: 'int', default: 0 })
|
||||
bonusPoints!: number;
|
||||
|
||||
@Column({ name: 'is_active', type: 'boolean', default: false })
|
||||
isActive!: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user