onroute-policy-engine 2.32.3 → 2.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,13 +75,15 @@ function isFeatureLegalWeightPowerUnit(vehicleType) {
75
75
  return (vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCKS ||
76
76
  vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_TRACTORS ||
77
77
  vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_WITH_PME ||
78
- vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_TRACTOR_WITH_PME);
78
+ vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_TRACTOR_WITH_PME ||
79
+ vehicleType === power_unit_codes_1.POWER_UNIT_CODES.PICKER_TRUCK_TRACTORS);
79
80
  }
80
81
  function getFeatureLegalPowerUnitWeightThreshold(vehicleType, axleConfiguration, axleIndex) {
81
82
  const steerAxle = axleConfiguration[0];
82
83
  const driveAxle = axleConfiguration[1];
83
84
  const hasPme = vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_WITH_PME ||
84
- vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_TRACTOR_WITH_PME;
85
+ vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_TRACTOR_WITH_PME ||
86
+ vehicleType === power_unit_codes_1.POWER_UNIT_CODES.PICKER_TRUCK_TRACTORS;
85
87
  if (axleIndex === 0) {
86
88
  if (steerAxle.numberOfAxles === 1 &&
87
89
  (driveAxle.numberOfAxles === 1 || driveAxle.numberOfAxles === 2)) {
@@ -133,7 +135,7 @@ function CheckLegalWeight(policy, vehicleConfiguration, axleConfiguration) {
133
135
  const axleUnitNumber = axleIndex + 1;
134
136
  return {
135
137
  id: policyId,
136
- message: `Weight for axle unit ${axleUnitNumber} ${result ? 'is legal' : `must not exceed ${legalWeight} kgs`}`,
138
+ message: `Axle Unit Weight for Axle Unit ${axleUnitNumber} ${result ? 'is legal' : `must not exceed ${legalWeight} kg.`}`,
137
139
  // We intentionally only return Pass/Warning, as we should never
138
140
  // show an error for being above legal amount, only permitable
139
141
  // amount. But it's still useful info for things like OCD table.
@@ -686,11 +688,11 @@ function CheckPickerTruckTractorWeightRestrictions(policy, vehicleConfiguration,
686
688
  const vehicleDefinition = policy.getVehicleDefinition(vehicleType);
687
689
  return !(vehicleDefinition === null || vehicleDefinition === void 0 ? void 0 : vehicleDefinition.ignoreForAxleCalculation);
688
690
  });
689
- const exceedsLegalWeight = ((steerWeightDimension === null || steerWeightDimension === void 0 ? void 0 : steerWeightDimension.legal) !== undefined &&
690
- steerAxle.axleUnitWeight > steerWeightDimension.legal) ||
691
- ((driveWeightDimension === null || driveWeightDimension === void 0 ? void 0 : driveWeightDimension.legal) !== undefined &&
692
- driveAxle.axleUnitWeight > driveWeightDimension.legal);
693
- const trailerPasses = !hasRealTrailer || !exceedsLegalWeight;
691
+ const steerLegal = getFeatureLegalPowerUnitWeightThreshold(power_unit_codes_1.POWER_UNIT_CODES.PICKER_TRUCK_TRACTORS, axleConfiguration, 0);
692
+ const driveLegal = getFeatureLegalPowerUnitWeightThreshold(power_unit_codes_1.POWER_UNIT_CODES.PICKER_TRUCK_TRACTORS, axleConfiguration, 1);
693
+ const exceedsLegalWeight = (steerLegal !== undefined && steerAxle.axleUnitWeight > steerLegal) ||
694
+ (driveLegal !== undefined && driveAxle.axleUnitWeight > driveLegal);
695
+ const trailerPasses = !hasRealTrailer || (ratioPasses && !exceedsLegalWeight);
694
696
  return [
695
697
  {
696
698
  id: policyId,
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v2.32.3";
1
+ export declare const version = "v2.33.0";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // Generated by genversion.
5
- exports.version = 'v2.32.3';
5
+ exports.version = 'v2.33.0';
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "testEnvironment": "node"
93
93
  },
94
- "version": "v2.32.3"
94
+ "version": "v2.33.0"
95
95
  }