onroute-policy-engine 2.34.1 → 2.35.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.
@@ -19,9 +19,7 @@ export declare function getMaximumLegalAxleGroupWeightThreshold(individualLegalW
19
19
  /**
20
20
  * Validates each axle unit against its legal weight maximum.
21
21
  *
22
- * The feature-defined steering and drive limits are authoritative for the
23
- * standard truck/truck-tractor and PME subtypes. Other axle units retain
24
- * their configured legal weight lookup.
22
+ * Resolves legal limits from subtype, category, or global weight dimensions.
25
23
  */
26
24
  export declare function CheckLegalWeight(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
27
25
  /**
@@ -21,7 +21,6 @@ exports.CheckLegalAxleSpread = CheckLegalAxleSpread;
21
21
  const dimensions_helper_1 = require("./dimensions.helper");
22
22
  const ctr_717_helper_1 = require("./ctr-717.helper");
23
23
  const enum_1 = require("../enum");
24
- const axle_weight_legal_maximums_1 = require("../constants/axle-weight-legal-maximums");
25
24
  const axle_weight_permittable_maximums_1 = require("../constants/axle-weight-permittable-maximums");
26
25
  const power_unit_axle_code_multiplier_1 = require("../constants/power-unit-axle-code-multiplier");
27
26
  const axle_spread_helper_1 = require("./axle-spread.helper");
@@ -71,66 +70,16 @@ function getConfiguredAxleUnitWeightThreshold(policy, vehicleConfiguration, axle
71
70
  }
72
71
  return ((_b = (_a = policy.selectCorrectWeightDimension(weights, vehicleConfiguration, axleConfiguration, axleIndex)) === null || _a === void 0 ? void 0 : _a[threshold]) !== null && _b !== void 0 ? _b : 0);
73
72
  }
74
- function isFeatureLegalWeightPowerUnit(vehicleType) {
75
- return (vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCKS ||
76
- vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_TRACTORS ||
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 ||
79
- vehicleType === power_unit_codes_1.POWER_UNIT_CODES.PICKER_TRUCK_TRACTORS);
80
- }
81
- function getFeatureLegalPowerUnitWeightThreshold(vehicleType, axleConfiguration, axleIndex) {
82
- const steerAxle = axleConfiguration[0];
83
- const driveAxle = axleConfiguration[1];
84
- const hasPme = vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCK_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;
87
- if (axleIndex === 0) {
88
- if (steerAxle.numberOfAxles === 1 &&
89
- (driveAxle.numberOfAxles === 1 || driveAxle.numberOfAxles === 2)) {
90
- return hasPme || vehicleType === power_unit_codes_1.POWER_UNIT_CODES.TRUCKS
91
- ? axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.SINGLE_AXLE
92
- : axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.STANDARD_TRUCK_TRACTOR_STEER;
93
- }
94
- if (steerAxle.numberOfAxles === 1 && driveAxle.numberOfAxles === 3) {
95
- return hasPme
96
- ? axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.SINGLE_AXLE
97
- : axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.STANDARD_SINGLE_STEER_WITH_TRIDEM_DRIVE;
98
- }
99
- if (steerAxle.numberOfAxles === 2 && driveAxle.numberOfAxles === 2) {
100
- return axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.TANDEM_AXLE;
101
- }
102
- if (steerAxle.numberOfAxles === 2 && driveAxle.numberOfAxles === 3) {
103
- return hasPme
104
- ? axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.PME_TANDEM_STEER_WITH_TRIDEM_DRIVE
105
- : axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.STANDARD_TANDEM_STEER_WITH_TRIDEM_DRIVE;
106
- }
107
- }
108
- if (axleIndex === 1) {
109
- return {
110
- 1: axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.SINGLE_AXLE,
111
- 2: axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.TANDEM_AXLE,
112
- 3: axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.TRIDEM_AXLE,
113
- }[driveAxle.numberOfAxles];
114
- }
115
- return undefined;
116
- }
117
73
  /**
118
74
  * Validates each axle unit against its legal weight maximum.
119
75
  *
120
- * The feature-defined steering and drive limits are authoritative for the
121
- * standard truck/truck-tractor and PME subtypes. Other axle units retain
122
- * their configured legal weight lookup.
76
+ * Resolves legal limits from subtype, category, or global weight dimensions.
123
77
  */
124
78
  function CheckLegalWeight(policy, vehicleConfiguration, axleConfiguration) {
125
79
  const policyId = enum_1.PolicyCheckId.LegalWeight;
126
- const powerUnitType = vehicleConfiguration[0];
127
80
  const axleUnitVehicleIndexes = (0, dimensions_helper_1.getAxleUnitVehicleIndexLookup)(policy, vehicleConfiguration, axleConfiguration);
128
81
  return axleConfiguration.map((axleUnit, axleIndex) => {
129
- const featureThreshold = axleUnitVehicleIndexes[axleIndex] === 0 &&
130
- isFeatureLegalWeightPowerUnit(powerUnitType)
131
- ? getFeatureLegalPowerUnitWeightThreshold(powerUnitType, axleConfiguration, axleIndex)
132
- : undefined;
133
- const legalWeight = featureThreshold !== null && featureThreshold !== void 0 ? featureThreshold : getConfiguredAxleUnitWeightThreshold(policy, vehicleConfiguration, axleConfiguration, axleUnitVehicleIndexes, axleIndex, 'legal');
82
+ const legalWeight = getConfiguredAxleUnitWeightThreshold(policy, vehicleConfiguration, axleConfiguration, axleUnitVehicleIndexes, axleIndex, 'legal');
134
83
  const result = axleUnit.axleUnitWeight <= legalWeight;
135
84
  const axleUnitNumber = axleIndex + 1;
136
85
  return {
@@ -690,8 +639,8 @@ function CheckPickerTruckTractorWeightRestrictions(policy, vehicleConfiguration,
690
639
  const vehicleDefinition = policy.getVehicleDefinition(vehicleType);
691
640
  return !(vehicleDefinition === null || vehicleDefinition === void 0 ? void 0 : vehicleDefinition.ignoreForAxleCalculation);
692
641
  });
693
- const steerLegal = getFeatureLegalPowerUnitWeightThreshold(power_unit_codes_1.POWER_UNIT_CODES.PICKER_TRUCK_TRACTORS, axleConfiguration, 0);
694
- const driveLegal = getFeatureLegalPowerUnitWeightThreshold(power_unit_codes_1.POWER_UNIT_CODES.PICKER_TRUCK_TRACTORS, axleConfiguration, 1);
642
+ const steerLegal = steerWeightDimension === null || steerWeightDimension === void 0 ? void 0 : steerWeightDimension.legal;
643
+ const driveLegal = driveWeightDimension === null || driveWeightDimension === void 0 ? void 0 : driveWeightDimension.legal;
695
644
  const exceedsLegalWeight = (steerLegal !== undefined && steerAxle.axleUnitWeight > steerLegal) ||
696
645
  (driveLegal !== undefined && driveAxle.axleUnitWeight > driveLegal);
697
646
  const trailerPasses = !hasRealTrailer || (ratioPasses && !exceedsLegalWeight);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v2.34.1";
1
+ export declare const version = "v2.35.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.34.1';
5
+ exports.version = 'v2.35.0';
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "testEnvironment": "node"
93
93
  },
94
- "version": "v2.34.1"
94
+ "version": "v2.35.0"
95
95
  }
@@ -1,9 +0,0 @@
1
- export declare const AXLE_WEIGHT_LEGAL_MAXIMUMS: {
2
- SINGLE_AXLE: number;
3
- STANDARD_TRUCK_TRACTOR_STEER: number;
4
- STANDARD_SINGLE_STEER_WITH_TRIDEM_DRIVE: number;
5
- TANDEM_AXLE: number;
6
- STANDARD_TANDEM_STEER_WITH_TRIDEM_DRIVE: number;
7
- PME_TANDEM_STEER_WITH_TRIDEM_DRIVE: number;
8
- TRIDEM_AXLE: number;
9
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AXLE_WEIGHT_LEGAL_MAXIMUMS = void 0;
4
- exports.AXLE_WEIGHT_LEGAL_MAXIMUMS = {
5
- SINGLE_AXLE: 9100,
6
- STANDARD_TRUCK_TRACTOR_STEER: 6000,
7
- STANDARD_SINGLE_STEER_WITH_TRIDEM_DRIVE: 7300,
8
- TANDEM_AXLE: 17000,
9
- STANDARD_TANDEM_STEER_WITH_TRIDEM_DRIVE: 13600,
10
- PME_TANDEM_STEER_WITH_TRIDEM_DRIVE: 15200,
11
- TRIDEM_AXLE: 24000,
12
- };