onroute-policy-engine 2.11.0 → 2.12.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.
@@ -6,6 +6,7 @@ export declare enum PolicyCheckId {
6
6
  BoosterAxleLimit = "booster-axle-limit",
7
7
  BridgeFormula = "bridge-formula",
8
8
  CheckPermittableWeight = "check-permittable-weight",
9
+ DriveJeepLoadEqualization = "drive-jeep-load-equalization",
9
10
  MaxTireLoad = "max-tire-load",
10
11
  MinDriveAxleWeight = "minimum-drive-axle-weight",
11
12
  MinSteerAxleWeight = "minimum-steer-axle-weight",
@@ -11,6 +11,7 @@ var PolicyCheckId;
11
11
  PolicyCheckId["BoosterAxleLimit"] = "booster-axle-limit";
12
12
  PolicyCheckId["BridgeFormula"] = "bridge-formula";
13
13
  PolicyCheckId["CheckPermittableWeight"] = "check-permittable-weight";
14
+ PolicyCheckId["DriveJeepLoadEqualization"] = "drive-jeep-load-equalization";
14
15
  PolicyCheckId["MaxTireLoad"] = "max-tire-load";
15
16
  PolicyCheckId["MinDriveAxleWeight"] = "minimum-drive-axle-weight";
16
17
  PolicyCheckId["MinSteerAxleWeight"] = "minimum-steer-axle-weight";
@@ -169,9 +169,9 @@ export declare function CheckMinSteerAxleWeight(_policy: Policy, _vehicleConfigu
169
169
  * Validates minimum drive axle weight requirements for tandem and tridem drive power units.
170
170
  *
171
171
  * This function checks that the drive axle meets minimum weight requirements based on the
172
- * Gross Vehicle Combination Weight (GVCW). For tandem drive axles, the minimum is 20% of GVCW
173
- * or 23,000 lbs (whichever is smaller). For tridem drive axles, the minimum is 20% of GVCW
174
- * or 28,000 lbs (whichever is smaller).
172
+ * Gross Combined Vehicle Weight (GCVW). For tandem drive axles, the minimum is 20% of GCVW
173
+ * or 23,000 kg (whichever is smaller). For tridem drive axles, the minimum is 20% of GCVW
174
+ * or 28,000 kg (whichever is smaller).
175
175
  *
176
176
  * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
177
177
  * @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
@@ -179,12 +179,12 @@ export declare function CheckMinSteerAxleWeight(_policy: Policy, _vehicleConfigu
179
179
  * @returns Array of AxleGroupPolicyCheckResult objects with validation results
180
180
  *
181
181
  * @example
182
- * // For a tandem drive configuration with GVCW of 120,000 kgs
182
+ * // For a tandem drive configuration with GCVW of 120,000 kg
183
183
  * const results = CheckMinDriveAxleWeight(policy, ['TRKTRAC'], [
184
184
  * { numberOfAxles: 1, axleUnitWeight: 12000 }, // Steer axle
185
185
  * { numberOfAxles: 2, axleUnitWeight: 24000 } // Tandem drive axle
186
186
  * ]);
187
- * // Returns pass if drive axle weight >= min(20% of GVCW, 23,000 kgs)
187
+ * // Returns pass if drive axle weight >= min(20% of GCVW, 23,000 kg)
188
188
  *
189
189
  * @see PolicyCheck
190
190
  * @see AxleGroupPolicyCheckResult
@@ -256,6 +256,20 @@ export declare function CheckBoosterAxleLimit(_policy: Policy, vehicleConfigurat
256
256
  * of axle unit 2 spread. Axle dimensions are stored in centimetres.
257
257
  */
258
258
  export declare function CheckTruckTractorWheelbase(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
259
+ /**
260
+ * Validates that the drive axle unit and first jeep axle unit are load equalized
261
+ * within 1000 kg when they have the same number of axles.
262
+ *
263
+ * Vehicle configuration has one power unit entry, while axle configuration has
264
+ * separate steer and drive entries for the power unit. For vehicle entries after
265
+ * the power unit, the matching axle unit index is therefore vehicle index + 1.
266
+ *
267
+ * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
268
+ * @param vehicleConfiguration - Array of vehicle type identifiers representing the vehicle configuration
269
+ * @param axleConfiguration - Array of axle configurations containing axle count and weight information
270
+ * @returns Array of AxleGroupPolicyCheckResult objects for the applicable drive/jeep pair
271
+ */
272
+ export declare function CheckDriveJeepLoadEqualization(_policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
259
273
  /**
260
274
  * Map of policy check functions keyed by their corresponding PolicyCheckId.
261
275
  *
@@ -274,6 +288,7 @@ export declare function CheckTruckTractorWheelbase(policy: Policy, vehicleConfig
274
288
  * - NumberOfWheelsPerAxle: Validates tire count per axle unit
275
289
  * - BoosterAxleLimit: Validates booster axle count against the preceding trailer
276
290
  * - TruckTractorWheelbase: Validates derived wheelbase for single steer, tandem drive truck tractors
291
+ * - DriveJeepLoadEqualization: Validates drive and jeep axle unit load equalization
277
292
  *
278
293
  * @see PolicyCheck
279
294
  * @see PolicyCheckId
@@ -10,6 +10,7 @@ exports.CheckMinDriveAxleWeight = CheckMinDriveAxleWeight;
10
10
  exports.CheckMaxTireLoad = CheckMaxTireLoad;
11
11
  exports.CheckBoosterAxleLimit = CheckBoosterAxleLimit;
12
12
  exports.CheckTruckTractorWheelbase = CheckTruckTractorWheelbase;
13
+ exports.CheckDriveJeepLoadEqualization = CheckDriveJeepLoadEqualization;
13
14
  const dimensions_helper_1 = require("./dimensions.helper");
14
15
  const enum_1 = require("../enum");
15
16
  /**
@@ -343,9 +344,9 @@ function CheckMinSteerAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
343
344
  * Validates minimum drive axle weight requirements for tandem and tridem drive power units.
344
345
  *
345
346
  * This function checks that the drive axle meets minimum weight requirements based on the
346
- * Gross Vehicle Combination Weight (GVCW). For tandem drive axles, the minimum is 20% of GVCW
347
- * or 23,000 lbs (whichever is smaller). For tridem drive axles, the minimum is 20% of GVCW
348
- * or 28,000 lbs (whichever is smaller).
347
+ * Gross Combined Vehicle Weight (GCVW). For tandem drive axles, the minimum is 20% of GCVW
348
+ * or 23,000 kg (whichever is smaller). For tridem drive axles, the minimum is 20% of GCVW
349
+ * or 28,000 kg (whichever is smaller).
349
350
  *
350
351
  * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
351
352
  * @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
@@ -353,12 +354,12 @@ function CheckMinSteerAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
353
354
  * @returns Array of AxleGroupPolicyCheckResult objects with validation results
354
355
  *
355
356
  * @example
356
- * // For a tandem drive configuration with GVCW of 120,000 kgs
357
+ * // For a tandem drive configuration with GCVW of 120,000 kg
357
358
  * const results = CheckMinDriveAxleWeight(policy, ['TRKTRAC'], [
358
359
  * { numberOfAxles: 1, axleUnitWeight: 12000 }, // Steer axle
359
360
  * { numberOfAxles: 2, axleUnitWeight: 24000 } // Tandem drive axle
360
361
  * ]);
361
- * // Returns pass if drive axle weight >= min(20% of GVCW, 23,000 kgs)
362
+ * // Returns pass if drive axle weight >= min(20% of GCVW, 23,000 kg)
362
363
  *
363
364
  * @see PolicyCheck
364
365
  * @see AxleGroupPolicyCheckResult
@@ -646,6 +647,53 @@ function CheckTruckTractorWheelbase(policy, vehicleConfiguration, axleConfigurat
646
647
  Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
647
648
  ];
648
649
  }
650
+ /**
651
+ * Validates that the drive axle unit and first jeep axle unit are load equalized
652
+ * within 1000 kg when they have the same number of axles.
653
+ *
654
+ * Vehicle configuration has one power unit entry, while axle configuration has
655
+ * separate steer and drive entries for the power unit. For vehicle entries after
656
+ * the power unit, the matching axle unit index is therefore vehicle index + 1.
657
+ *
658
+ * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
659
+ * @param vehicleConfiguration - Array of vehicle type identifiers representing the vehicle configuration
660
+ * @param axleConfiguration - Array of axle configurations containing axle count and weight information
661
+ * @returns Array of AxleGroupPolicyCheckResult objects for the applicable drive/jeep pair
662
+ */
663
+ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfiguration) {
664
+ const policyCheckResults = new Array();
665
+ const policyId = enum_1.PolicyCheckId.DriveJeepLoadEqualization;
666
+ const maxWeightDifferenceKg = 1000;
667
+ const driveAxleConfigIndex = 1;
668
+ const jeepVehicleIndex = vehicleConfiguration.findIndex((vehicleSubType) => vehicleSubType === enum_1.AccessoryVehicleType.Jeep);
669
+ if (jeepVehicleIndex < 1) {
670
+ return policyCheckResults;
671
+ }
672
+ const jeepAxleConfigIndex = jeepVehicleIndex + 1;
673
+ const driveAxle = axleConfiguration[driveAxleConfigIndex];
674
+ const jeepAxle = axleConfiguration[jeepAxleConfigIndex];
675
+ if (!driveAxle ||
676
+ !jeepAxle ||
677
+ driveAxle.numberOfAxles !== jeepAxle.numberOfAxles ||
678
+ !Number.isFinite(driveAxle.axleUnitWeight) ||
679
+ !Number.isFinite(jeepAxle.axleUnitWeight)) {
680
+ return policyCheckResults;
681
+ }
682
+ const driveAxleUnit = driveAxleConfigIndex + 1;
683
+ const jeepAxleUnit = jeepAxleConfigIndex + 1;
684
+ const result = Math.abs(driveAxle.axleUnitWeight - jeepAxle.axleUnitWeight) <=
685
+ maxWeightDifferenceKg;
686
+ policyCheckResults.push({
687
+ id: policyId,
688
+ result: result ? enum_1.PolicyCheckResultType.Pass : enum_1.PolicyCheckResultType.Fail,
689
+ message: result
690
+ ? ''
691
+ : `Axle Unit ${driveAxleUnit} and Axle Unit ${jeepAxleUnit} must be load equalized within ${maxWeightDifferenceKg} kg.`,
692
+ startAxleUnit: driveAxleUnit,
693
+ endAxleUnit: jeepAxleUnit,
694
+ });
695
+ return policyCheckResults;
696
+ }
649
697
  /**
650
698
  * Map of policy check functions keyed by their corresponding PolicyCheckId.
651
699
  *
@@ -664,6 +712,7 @@ function CheckTruckTractorWheelbase(policy, vehicleConfiguration, axleConfigurat
664
712
  * - NumberOfWheelsPerAxle: Validates tire count per axle unit
665
713
  * - BoosterAxleLimit: Validates booster axle count against the preceding trailer
666
714
  * - TruckTractorWheelbase: Validates derived wheelbase for single steer, tandem drive truck tractors
715
+ * - DriveJeepLoadEqualization: Validates drive and jeep axle unit load equalization
667
716
  *
668
717
  * @see PolicyCheck
669
718
  * @see PolicyCheckId
@@ -679,4 +728,5 @@ exports.policyCheckMap = new Map([
679
728
  [enum_1.PolicyCheckId.NumberOfWheelsPerAxle, CheckNumTiresPerAxle],
680
729
  [enum_1.PolicyCheckId.BoosterAxleLimit, CheckBoosterAxleLimit],
681
730
  [enum_1.PolicyCheckId.TruckTractorWheelbase, CheckTruckTractorWheelbase],
731
+ [enum_1.PolicyCheckId.DriveJeepLoadEqualization, CheckDriveJeepLoadEqualization],
682
732
  ]);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v2.11.0";
1
+ export declare const version = "v2.12.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.11.0';
5
+ exports.version = 'v2.12.0';
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "testEnvironment": "node"
93
93
  },
94
- "version": "v2.11.0"
94
+ "version": "v2.12.0"
95
95
  }