This commit is contained in:
Marshal
2026-06-16 08:56:52 +00:00
parent a0dbb4ca6f
commit 7151bce288
21 changed files with 429 additions and 304 deletions

View File

@@ -0,0 +1,31 @@
import { BaseEntity } from '@edr/api-common';
import { Column, Entity, Index } from 'typeorm';
@Entity({ schema: 'freight', name: 'priority_configs' })
@Index(['type', 'isActive'])
@Index(['currency', 'type'])
export class PriorityConfig extends BaseEntity {
@Column({ name: 'type', type: 'varchar', length: 20 })
type!: 'WAGON' | 'CURRENCY';
@Column({ name: 'label', type: 'varchar', length: 100 })
label!: string;
@Column({ name: 'currency', type: 'varchar', length: 5, nullable: true })
currency?: string | null;
@Column({ name: 'min_wagon_count', type: 'int' })
minWagonCount!: number;
@Column({ name: 'max_wagon_count', type: 'int' })
maxWagonCount!: number;
@Column({ name: 'score_points', type: 'int', default: 0 })
scorePoints!: number;
@Column({ name: 'is_active', type: 'boolean', default: false })
isActive!: boolean;
@Column({ name: 'display_order', type: 'int', default: 1 })
displayOrder!: number;
}

View File

@@ -1,22 +0,0 @@
import { BaseEntity } from '@edr/api-common';
import { Column, Entity, Index } from 'typeorm';
@Entity({ schema: 'freight', name: 'priority_rules' })
@Index(['code'])
@Index(['isActive'])
export class PriorityRule extends BaseEntity {
@Column({ name: 'code', type: 'varchar', length: 40, unique: true })
code!: string;
@Column({ name: 'label', type: 'varchar', length: 100, nullable: true })
label!: string;
@Column({ name: 'score', type: 'int', default: 0, nullable: true })
score!: number;
@Column({ name: 'condition_currency', type: 'varchar', length: 5, nullable: true })
conditionCurrency?: string | null;
@Column({ name: 'is_active', type: 'boolean', default: false })
isActive!: boolean;
}