mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
booking operations and trains scheduling also allocations
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
/** Ensures government bookings outrank commercial priority (max ~1,500 today). */
|
||||
export const GOVERNMENT_PRIORITY_BONUS = 50_000;
|
||||
@@ -36,6 +36,7 @@ import {
|
||||
SHIPPING_LINES_REPOSITORY,
|
||||
} from './interfaces/shipping-lines.repository.interface';
|
||||
import { DEFAULT_APPROVAL_RULE_ROWS } from './approval-rules.defaults';
|
||||
import { GOVERNMENT_PRIORITY_BONUS } from './government-priority.constants';
|
||||
|
||||
export interface BookingContainerEvalInput {
|
||||
containerTypeId: string;
|
||||
@@ -54,6 +55,7 @@ export interface BookingEvaluationInput {
|
||||
paymentCurrency: string;
|
||||
tradeDirection: string;
|
||||
isHazardous: boolean;
|
||||
isGovernment?: boolean;
|
||||
allowConsolidation?: boolean;
|
||||
shippingLineId?: string | null;
|
||||
containers: BookingContainerEvalInput[];
|
||||
@@ -180,6 +182,10 @@ export class RuleEngineService {
|
||||
}
|
||||
}
|
||||
|
||||
if (input.isGovernment) {
|
||||
priorityScore += GOVERNMENT_PRIORITY_BONUS;
|
||||
}
|
||||
|
||||
let shippingLineMapped = false;
|
||||
if (input.shippingLineId) {
|
||||
const line = await this.shippingLinesRepo.findById(input.shippingLineId);
|
||||
|
||||
Reference in New Issue
Block a user