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.
- package/dist/helper/policy-check.helper.js +10 -8
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
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.
|
|
1
|
+
export declare const version = "v2.33.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED