onroute-policy-engine 2.10.1 → 2.11.1

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.
@@ -10,5 +10,6 @@ export declare enum PolicyCheckId {
10
10
  MinDriveAxleWeight = "minimum-drive-axle-weight",
11
11
  MinSteerAxleWeight = "minimum-steer-axle-weight",
12
12
  NumberOfAxles = "number-of-axles",
13
- NumberOfWheelsPerAxle = "number-of-wheels"
13
+ NumberOfWheelsPerAxle = "number-of-wheels",
14
+ TruckTractorWheelbase = "truck-tractor-wheelbase"
14
15
  }
@@ -16,4 +16,5 @@ var PolicyCheckId;
16
16
  PolicyCheckId["MinSteerAxleWeight"] = "minimum-steer-axle-weight";
17
17
  PolicyCheckId["NumberOfAxles"] = "number-of-axles";
18
18
  PolicyCheckId["NumberOfWheelsPerAxle"] = "number-of-wheels";
19
+ PolicyCheckId["TruckTractorWheelbase"] = "truck-tractor-wheelbase";
19
20
  })(PolicyCheckId || (exports.PolicyCheckId = PolicyCheckId = {}));
@@ -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
@@ -249,6 +249,13 @@ export declare function CheckMaxTireLoad(_policy: Policy, _vehicleConfiguration:
249
249
  * @returns Array of AxleGroupPolicyCheckResult objects, one for each booster tested
250
250
  */
251
251
  export declare function CheckBoosterAxleLimit(_policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
252
+ /**
253
+ * Validates derived wheelbase for single steer, tandem drive truck tractors.
254
+ *
255
+ * Wheelbase is derived from the spacing between axle units 1 and 2 plus half
256
+ * of axle unit 2 spread. Axle dimensions are stored in centimetres.
257
+ */
258
+ export declare function CheckTruckTractorWheelbase(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
252
259
  /**
253
260
  * Map of policy check functions keyed by their corresponding PolicyCheckId.
254
261
  *
@@ -266,6 +273,7 @@ export declare function CheckBoosterAxleLimit(_policy: Policy, vehicleConfigurat
266
273
  * - NumberOfAxles: Validates axle count per axle unit
267
274
  * - NumberOfWheelsPerAxle: Validates tire count per axle unit
268
275
  * - BoosterAxleLimit: Validates booster axle count against the preceding trailer
276
+ * - TruckTractorWheelbase: Validates derived wheelbase for single steer, tandem drive truck tractors
269
277
  *
270
278
  * @see PolicyCheck
271
279
  * @see PolicyCheckId
@@ -9,6 +9,7 @@ exports.CheckMinSteerAxleWeight = CheckMinSteerAxleWeight;
9
9
  exports.CheckMinDriveAxleWeight = CheckMinDriveAxleWeight;
10
10
  exports.CheckMaxTireLoad = CheckMaxTireLoad;
11
11
  exports.CheckBoosterAxleLimit = CheckBoosterAxleLimit;
12
+ exports.CheckTruckTractorWheelbase = CheckTruckTractorWheelbase;
12
13
  const dimensions_helper_1 = require("./dimensions.helper");
13
14
  const enum_1 = require("../enum");
14
15
  /**
@@ -342,9 +343,9 @@ function CheckMinSteerAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
342
343
  * Validates minimum drive axle weight requirements for tandem and tridem drive power units.
343
344
  *
344
345
  * This function checks that the drive axle meets minimum weight requirements based on the
345
- * Gross Vehicle Combination Weight (GVCW). For tandem drive axles, the minimum is 20% of GVCW
346
- * or 23,000 lbs (whichever is smaller). For tridem drive axles, the minimum is 20% of GVCW
347
- * or 28,000 lbs (whichever is smaller).
346
+ * Gross Combined Vehicle Weight (GCVW). For tandem drive axles, the minimum is 20% of GCVW
347
+ * or 23,000 kg (whichever is smaller). For tridem drive axles, the minimum is 20% of GCVW
348
+ * or 28,000 kg (whichever is smaller).
348
349
  *
349
350
  * @param _policy - The policy instance (unused in this check, but required by PolicyCheck type)
350
351
  * @param _vehicleConfiguration - Vehicle configuration (unused in this check, but required by PolicyCheck type)
@@ -352,12 +353,12 @@ function CheckMinSteerAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
352
353
  * @returns Array of AxleGroupPolicyCheckResult objects with validation results
353
354
  *
354
355
  * @example
355
- * // For a tandem drive configuration with GVCW of 120,000 kgs
356
+ * // For a tandem drive configuration with GCVW of 120,000 kg
356
357
  * const results = CheckMinDriveAxleWeight(policy, ['TRKTRAC'], [
357
358
  * { numberOfAxles: 1, axleUnitWeight: 12000 }, // Steer axle
358
359
  * { numberOfAxles: 2, axleUnitWeight: 24000 } // Tandem drive axle
359
360
  * ]);
360
- * // Returns pass if drive axle weight >= min(20% of GVCW, 23,000 kgs)
361
+ * // Returns pass if drive axle weight >= min(20% of GCVW, 23,000 kg)
361
362
  *
362
363
  * @see PolicyCheck
363
364
  * @see AxleGroupPolicyCheckResult
@@ -595,6 +596,56 @@ function CheckBoosterAxleLimit(_policy, vehicleConfiguration, axleConfiguration)
595
596
  });
596
597
  return policyCheckResults;
597
598
  }
599
+ /**
600
+ * Validates derived wheelbase for single steer, tandem drive truck tractors.
601
+ *
602
+ * Wheelbase is derived from the spacing between axle units 1 and 2 plus half
603
+ * of axle unit 2 spread. Axle dimensions are stored in centimetres.
604
+ */
605
+ function CheckTruckTractorWheelbase(policy, vehicleConfiguration, axleConfiguration) {
606
+ const policyId = enum_1.PolicyCheckId.TruckTractorWheelbase;
607
+ const powerUnitSubtype = vehicleConfiguration[0];
608
+ const steerAxle = axleConfiguration[0];
609
+ const driveAxle = axleConfiguration[1];
610
+ if (powerUnitSubtype !== 'TRKTRAC' ||
611
+ !steerAxle ||
612
+ !driveAxle ||
613
+ steerAxle.numberOfAxles !== 1 ||
614
+ driveAxle.numberOfAxles !== 2 ||
615
+ driveAxle.interaxleSpacing === undefined ||
616
+ driveAxle.axleSpread === undefined) {
617
+ return [];
618
+ }
619
+ const wheelbase = driveAxle.interaxleSpacing + driveAxle.axleSpread / 2;
620
+ const resultBase = {
621
+ id: policyId,
622
+ startAxleUnit: 1,
623
+ endAxleUnit: 2,
624
+ };
625
+ if (wheelbase > 720) {
626
+ return [
627
+ Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 and Axle Unit 2 is greater than 7.2m.' }),
628
+ ];
629
+ }
630
+ if (wheelbase >= 620) {
631
+ const hasDisallowedTrailer = vehicleConfiguration.slice(1).some((v) => {
632
+ if (v === enum_1.AccessoryVehicleType.Jeep ||
633
+ v === enum_1.AccessoryVehicleType.Booster) {
634
+ return true;
635
+ }
636
+ const trailer = policy.getTrailerDefinition(v);
637
+ return (trailer === null || trailer === void 0 ? void 0 : trailer.category) !== 'semi';
638
+ });
639
+ return [
640
+ Object.assign(Object.assign({}, resultBase), { result: hasDisallowedTrailer
641
+ ? enum_1.PolicyCheckResultType.Fail
642
+ : enum_1.PolicyCheckResultType.Pass, message: 'Wheelbase for Axle Unit 1 and Axle Unit 2 is between 6.2m and 7.2m. See CTPM 5.3.7.A.' }),
643
+ ];
644
+ }
645
+ return [
646
+ Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
647
+ ];
648
+ }
598
649
  /**
599
650
  * Map of policy check functions keyed by their corresponding PolicyCheckId.
600
651
  *
@@ -612,6 +663,7 @@ function CheckBoosterAxleLimit(_policy, vehicleConfiguration, axleConfiguration)
612
663
  * - NumberOfAxles: Validates axle count per axle unit
613
664
  * - NumberOfWheelsPerAxle: Validates tire count per axle unit
614
665
  * - BoosterAxleLimit: Validates booster axle count against the preceding trailer
666
+ * - TruckTractorWheelbase: Validates derived wheelbase for single steer, tandem drive truck tractors
615
667
  *
616
668
  * @see PolicyCheck
617
669
  * @see PolicyCheckId
@@ -626,4 +678,5 @@ exports.policyCheckMap = new Map([
626
678
  [enum_1.PolicyCheckId.MinSteerAxleWeight, CheckMinSteerAxleWeight],
627
679
  [enum_1.PolicyCheckId.NumberOfWheelsPerAxle, CheckNumTiresPerAxle],
628
680
  [enum_1.PolicyCheckId.BoosterAxleLimit, CheckBoosterAxleLimit],
681
+ [enum_1.PolicyCheckId.TruckTractorWheelbase, CheckTruckTractorWheelbase],
629
682
  ]);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v2.10.1";
1
+ export declare const version = "v2.11.1";
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.10.1';
5
+ exports.version = 'v2.11.1';
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "testEnvironment": "node"
93
93
  },
94
- "version": "v2.10.1"
94
+ "version": "v2.11.1"
95
95
  }