mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 13:28:11 +00:00
refactor booking priority logic and constants; adjust scoring thresholds and remove unused service types
This commit is contained in:
@@ -180,7 +180,7 @@ export class PricingDataSeeder {
|
||||
includesFirstMile: true,
|
||||
includesLastMile: true,
|
||||
includesCustoms: true,
|
||||
priorityBonusPoints: 100,
|
||||
priorityBonusPoints: 15,
|
||||
isActive: true,
|
||||
displayOrder: 2,
|
||||
},
|
||||
@@ -192,7 +192,7 @@ export class PricingDataSeeder {
|
||||
includesFirstMile: false,
|
||||
includesLastMile: false,
|
||||
includesCustoms: false,
|
||||
priorityBonusPoints: 50,
|
||||
priorityBonusPoints: 10,
|
||||
isActive: true,
|
||||
displayOrder: 3,
|
||||
},
|
||||
@@ -382,9 +382,11 @@ private async seedWeightLimits(wlRepo: any, ctRepo: any): Promise<void> {
|
||||
this.logger.log("Seeded weight limit rules");
|
||||
}
|
||||
private async seedPriorityConfigs(prRepo: any): Promise<void> {
|
||||
// Wagon Count Block — independent, applies regardless of currency.
|
||||
// Currency Block — applies only to the matching payment currency, within the wagon range.
|
||||
// Both blocks are additive (see RuleEngineService.evaluate).
|
||||
// Priority rule = Wagon Block + Currency Block (both additive; see RuleEngineService.evaluate).
|
||||
// Combined with the service-type bonus the total priority score caps at 100:
|
||||
// service-type bonus (≤ 15) + wagon block (≤ 50) + currency block (≤ 35) = 100.
|
||||
// Wagon Count Block — independent, applies regardless of currency. Max 50.
|
||||
// Currency Block — applies only to the matching payment currency, within the wagon range. Max 35.
|
||||
const rows = [
|
||||
// ── Wagon Count Block ───────────────────────────────────────────────
|
||||
{ type: "WAGON", label: "Wagons 1–20", currency: null, minWagonCount: 1, maxWagonCount: 20, scorePoints: 0, displayOrder: 1 },
|
||||
@@ -392,7 +394,7 @@ private async seedWeightLimits(wlRepo: any, ctRepo: any): Promise<void> {
|
||||
{ type: "WAGON", label: "Wagons 31–40", currency: null, minWagonCount: 31, maxWagonCount: 40, scorePoints: 30, displayOrder: 3 },
|
||||
{ type: "WAGON", label: "Wagons 41–50", currency: null, minWagonCount: 41, maxWagonCount: 50, scorePoints: 50, displayOrder: 4 },
|
||||
// ── Payment Currency Block ──────────────────────────────────────────
|
||||
{ type: "CURRENCY", label: "USD · Wagons 1–25", currency: "USD", minWagonCount: 1, maxWagonCount: 25, scorePoints: 17, displayOrder: 5 },
|
||||
{ type: "CURRENCY", label: "USD · Wagons 1–25", currency: "USD", minWagonCount: 1, maxWagonCount: 25, scorePoints: 15, displayOrder: 5 },
|
||||
{ type: "CURRENCY", label: "USD · Wagons 26–50", currency: "USD", minWagonCount: 26, maxWagonCount: 50, scorePoints: 35, displayOrder: 6 },
|
||||
{ type: "CURRENCY", label: "ETB · Wagons 1–50", currency: "ETB", minWagonCount: 1, maxWagonCount: 50, scorePoints: 0, displayOrder: 7 },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user