onroute-policy-engine 2.19.0 → 2.20.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.
- package/dist/enum/policy-check.d.ts +3 -2
- package/dist/enum/policy-check.js +2 -1
- package/dist/helper/dimensions.helper.js +7 -5
- package/dist/helper/policy-check.helper.d.ts +5 -7
- package/dist/helper/policy-check.helper.js +128 -47
- package/dist/helper/vehicles.helper.js +1 -4
- package/dist/validation-results.js +8 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare enum PolicyCheckResultType {
|
|
2
2
|
Pass = "pass",
|
|
3
|
-
Fail = "fail"
|
|
3
|
+
Fail = "fail",
|
|
4
|
+
Warning = "warning"
|
|
4
5
|
}
|
|
5
6
|
export declare enum PolicyCheckId {
|
|
6
7
|
AxleGroupMaximumLegalWeightThreshold = "axle-group-maximum-legal-weight-threshold",
|
|
@@ -15,5 +16,5 @@ export declare enum PolicyCheckId {
|
|
|
15
16
|
NumberOfAxles = "number-of-axles",
|
|
16
17
|
NumberOfWheelsPerAxle = "number-of-wheels",
|
|
17
18
|
PickerTruckTractorWeightRestrictions = "picker-truck-tractor-weight-restrictions",
|
|
18
|
-
|
|
19
|
+
WheelbaseLegalLimits = "wheelbase-legal-limits"
|
|
19
20
|
}
|
|
@@ -5,6 +5,7 @@ var PolicyCheckResultType;
|
|
|
5
5
|
(function (PolicyCheckResultType) {
|
|
6
6
|
PolicyCheckResultType["Pass"] = "pass";
|
|
7
7
|
PolicyCheckResultType["Fail"] = "fail";
|
|
8
|
+
PolicyCheckResultType["Warning"] = "warning";
|
|
8
9
|
})(PolicyCheckResultType || (exports.PolicyCheckResultType = PolicyCheckResultType = {}));
|
|
9
10
|
var PolicyCheckId;
|
|
10
11
|
(function (PolicyCheckId) {
|
|
@@ -20,5 +21,5 @@ var PolicyCheckId;
|
|
|
20
21
|
PolicyCheckId["NumberOfAxles"] = "number-of-axles";
|
|
21
22
|
PolicyCheckId["NumberOfWheelsPerAxle"] = "number-of-wheels";
|
|
22
23
|
PolicyCheckId["PickerTruckTractorWeightRestrictions"] = "picker-truck-tractor-weight-restrictions";
|
|
23
|
-
PolicyCheckId["
|
|
24
|
+
PolicyCheckId["WheelbaseLegalLimits"] = "wheelbase-legal-limits";
|
|
24
25
|
})(PolicyCheckId || (exports.PolicyCheckId = PolicyCheckId = {}));
|
|
@@ -68,7 +68,8 @@ function getSizeDimensionHelper(policy, permitTypeId, commodityId, configuration
|
|
|
68
68
|
}
|
|
69
69
|
const valueOverrides = [];
|
|
70
70
|
regions === null || regions === void 0 ? void 0 : regions.forEach((r) => {
|
|
71
|
-
var _a
|
|
71
|
+
var _a;
|
|
72
|
+
var _b, _c, _d;
|
|
72
73
|
let valueOverride;
|
|
73
74
|
// Check to see if this region has specific size dimensions
|
|
74
75
|
const regionOverride = (_a = sizeDimensionConfigured.regions) === null || _a === void 0 ? void 0 : _a.find((cr) => cr.region == r);
|
|
@@ -444,7 +445,8 @@ function selectCorrectWeightDimensionHelper(policy, weightDimensions, configurat
|
|
|
444
445
|
* @returns VehicleRelatives for the axle at the indicated axleIndex
|
|
445
446
|
*/
|
|
446
447
|
function getVehicleRelatives(policy, configuration, axleIndex, axleUnitVehicleIndexes) {
|
|
447
|
-
var _a, _b
|
|
448
|
+
var _a, _b;
|
|
449
|
+
var _c;
|
|
448
450
|
if (!configuration || configuration.length === 0) {
|
|
449
451
|
throw new Error('Cannot get relatives with an empty configuration');
|
|
450
452
|
}
|
|
@@ -459,7 +461,7 @@ function getVehicleRelatives(policy, configuration, axleIndex, axleUnitVehicleIn
|
|
|
459
461
|
firstCategory: firstVehicle === null || firstVehicle === void 0 ? void 0 : firstVehicle.category,
|
|
460
462
|
lastCategory: lastVehicle === null || lastVehicle === void 0 ? void 0 : lastVehicle.category,
|
|
461
463
|
};
|
|
462
|
-
const vehicleIndex = (
|
|
464
|
+
const vehicleIndex = (_c = axleUnitVehicleIndexes === null || axleUnitVehicleIndexes === void 0 ? void 0 : axleUnitVehicleIndexes[axleIndex]) !== null && _c !== void 0 ? _c : axleIndex - 1;
|
|
463
465
|
if (vehicleIndex <= 0) {
|
|
464
466
|
// First two axles are for the power unit which has no
|
|
465
467
|
// previous type (it is first in the configuration always)
|
|
@@ -469,7 +471,7 @@ function getVehicleRelatives(policy, configuration, axleIndex, axleUnitVehicleIn
|
|
|
469
471
|
else {
|
|
470
472
|
const prevVehicleType = walk(policy, configuration, vehicleIndex - 1, -1);
|
|
471
473
|
vehicleRelatives.prevType = prevVehicleType === null || prevVehicleType === void 0 ? void 0 : prevVehicleType.id;
|
|
472
|
-
vehicleRelatives.prevCategory = (
|
|
474
|
+
vehicleRelatives.prevCategory = (_a = policy.getVehicleDefinition(vehicleRelatives.prevType)) === null || _a === void 0 ? void 0 : _a.category;
|
|
473
475
|
}
|
|
474
476
|
if (configuration.length === 1 || vehicleIndex >= configuration.length - 1) {
|
|
475
477
|
// The axleIndex is for the last vehicle in the configuration,
|
|
@@ -482,7 +484,7 @@ function getVehicleRelatives(policy, configuration, axleIndex, axleUnitVehicleIn
|
|
|
482
484
|
// pseudo vehicle in the line.
|
|
483
485
|
const nextVehicleType = walk(policy, configuration, vehicleIndex + 1, 1);
|
|
484
486
|
vehicleRelatives.nextType = nextVehicleType === null || nextVehicleType === void 0 ? void 0 : nextVehicleType.id;
|
|
485
|
-
vehicleRelatives.nextCategory = (
|
|
487
|
+
vehicleRelatives.nextCategory = (_b = policy.getVehicleDefinition(vehicleRelatives.nextType)) === null || _b === void 0 ? void 0 : _b.category;
|
|
486
488
|
}
|
|
487
489
|
return vehicleRelatives;
|
|
488
490
|
}
|
|
@@ -212,7 +212,7 @@ export declare function CheckPickerTruckTractorWeightRestrictions(policy: Policy
|
|
|
212
212
|
* @see PolicyCheck
|
|
213
213
|
* @see AxleGroupPolicyCheckResult
|
|
214
214
|
*/
|
|
215
|
-
export declare function CheckMinDriveAxleWeight(_policy: Policy,
|
|
215
|
+
export declare function CheckMinDriveAxleWeight(_policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
|
|
216
216
|
/**
|
|
217
217
|
* Validates maximum tire load capacity for each axle unit based on tire size and count.
|
|
218
218
|
*
|
|
@@ -273,12 +273,9 @@ export declare function CheckMaxTireLoad(_policy: Policy, _vehicleConfiguration:
|
|
|
273
273
|
*/
|
|
274
274
|
export declare function CheckBoosterAxleLimit(_policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
|
|
275
275
|
/**
|
|
276
|
-
* Validates
|
|
277
|
-
*
|
|
278
|
-
* Wheelbase is derived from the spacing between axle units 1 and 2 plus half
|
|
279
|
-
* of axle unit 2 spread. Axle dimensions are stored in centimetres.
|
|
276
|
+
* Validates wheelbase legal limits for supported power unit vehicle sub-types.
|
|
280
277
|
*/
|
|
281
|
-
export declare function
|
|
278
|
+
export declare function CheckWheelbaseLegalLimits(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
|
|
282
279
|
/**
|
|
283
280
|
* Validates that the drive axle unit and first jeep axle unit are load equalized
|
|
284
281
|
* within 1000 kg when they have the same number of axles.
|
|
@@ -313,7 +310,8 @@ export declare function CheckDriveJeepLoadEqualization(_policy: Policy, vehicleC
|
|
|
313
310
|
* - NumberOfAxles: Validates axle count per axle unit
|
|
314
311
|
* - NumberOfWheelsPerAxle: Validates tire count per axle unit
|
|
315
312
|
* - BoosterAxleLimit: Validates booster axle count against the preceding trailer
|
|
316
|
-
* -
|
|
313
|
+
* - TruckTractorWheelbaseLegalLimits: Validates derived wheelbase for single steer, tandem drive truck tractors
|
|
314
|
+
* - WheelbaseLegalLimits: Validates wheelbase against legal limits
|
|
317
315
|
* - DriveJeepLoadEqualization: Validates drive and jeep axle unit load equalization
|
|
318
316
|
*
|
|
319
317
|
* @see PolicyCheck
|
|
@@ -13,7 +13,7 @@ exports.CheckPickerTruckTractorWeightRestrictions = CheckPickerTruckTractorWeigh
|
|
|
13
13
|
exports.CheckMinDriveAxleWeight = CheckMinDriveAxleWeight;
|
|
14
14
|
exports.CheckMaxTireLoad = CheckMaxTireLoad;
|
|
15
15
|
exports.CheckBoosterAxleLimit = CheckBoosterAxleLimit;
|
|
16
|
-
exports.
|
|
16
|
+
exports.CheckWheelbaseLegalLimits = CheckWheelbaseLegalLimits;
|
|
17
17
|
exports.CheckDriveJeepLoadEqualization = CheckDriveJeepLoadEqualization;
|
|
18
18
|
const dimensions_helper_1 = require("./dimensions.helper");
|
|
19
19
|
const ctr_717_helper_1 = require("./ctr-717.helper");
|
|
@@ -618,21 +618,29 @@ function CheckPickerTruckTractorWeightRestrictions(policy, vehicleConfiguration,
|
|
|
618
618
|
* @see PolicyCheck
|
|
619
619
|
* @see AxleGroupPolicyCheckResult
|
|
620
620
|
*/
|
|
621
|
-
function CheckMinDriveAxleWeight(_policy,
|
|
621
|
+
function CheckMinDriveAxleWeight(_policy, vehicleConfiguration, axleConfiguration) {
|
|
622
622
|
const policyCheckResults = new Array();
|
|
623
623
|
const policyId = enum_1.PolicyCheckId.MinDriveAxleWeight;
|
|
624
624
|
const gvcw = axleConfiguration.reduce((w, curr) => w + curr.axleUnitWeight, 0);
|
|
625
625
|
let message, result;
|
|
626
|
-
|
|
627
|
-
|
|
626
|
+
const powerUnitSubtype = vehicleConfiguration[0];
|
|
627
|
+
const driveAxle = axleConfiguration[1];
|
|
628
|
+
const isTandemDrive = driveAxle.numberOfAxles === 2;
|
|
629
|
+
const isTridemDrive = driveAxle.numberOfAxles === 3;
|
|
630
|
+
// TODO we need to add Truck with PME and Truck Tractor with PME when ready
|
|
631
|
+
const isSupportedVehicleSubtype = (value) => {
|
|
632
|
+
return value === 'REGTRCK' || value === 'TRKTRAC' || value === 'PICKRTT';
|
|
633
|
+
};
|
|
634
|
+
if ((isTandemDrive || isTridemDrive) &&
|
|
635
|
+
isSupportedVehicleSubtype(powerUnitSubtype)) {
|
|
628
636
|
let targetMinWeight = gvcw * 0.2;
|
|
629
|
-
if (
|
|
637
|
+
if (isTandemDrive) {
|
|
630
638
|
targetMinWeight = Math.min(targetMinWeight, 23000);
|
|
631
639
|
}
|
|
632
|
-
else if (
|
|
640
|
+
else if (isTridemDrive) {
|
|
633
641
|
targetMinWeight = Math.min(targetMinWeight, 28000);
|
|
634
642
|
}
|
|
635
|
-
if (
|
|
643
|
+
if (driveAxle.axleUnitWeight >= targetMinWeight) {
|
|
636
644
|
message = 'Drive axle meets minimum weight requirements';
|
|
637
645
|
result = enum_1.PolicyCheckResultType.Pass;
|
|
638
646
|
}
|
|
@@ -642,7 +650,7 @@ function CheckMinDriveAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
|
|
|
642
650
|
}
|
|
643
651
|
}
|
|
644
652
|
else {
|
|
645
|
-
// This policy check is only for tandem or tridem drive power units
|
|
653
|
+
// This policy check is only for tandem or tridem drive power units with supported vehicle sub-type
|
|
646
654
|
message = 'Policy check does not apply to this configuration';
|
|
647
655
|
result = enum_1.PolicyCheckResultType.Pass;
|
|
648
656
|
}
|
|
@@ -651,7 +659,7 @@ function CheckMinDriveAxleWeight(_policy, _vehicleConfiguration, axleConfigurati
|
|
|
651
659
|
message: message,
|
|
652
660
|
result: result,
|
|
653
661
|
startAxleUnit: 1,
|
|
654
|
-
endAxleUnit:
|
|
662
|
+
endAxleUnit: 1,
|
|
655
663
|
});
|
|
656
664
|
return policyCheckResults;
|
|
657
665
|
}
|
|
@@ -905,54 +913,126 @@ function CheckBoosterAxleLimit(_policy, vehicleConfiguration, axleConfiguration)
|
|
|
905
913
|
return policyCheckResults;
|
|
906
914
|
}
|
|
907
915
|
/**
|
|
908
|
-
* Validates
|
|
909
|
-
*
|
|
910
|
-
* Wheelbase is derived from the spacing between axle units 1 and 2 plus half
|
|
911
|
-
* of axle unit 2 spread. Axle dimensions are stored in centimetres.
|
|
916
|
+
* Validates wheelbase legal limits for supported power unit vehicle sub-types.
|
|
912
917
|
*/
|
|
913
|
-
function
|
|
914
|
-
|
|
915
|
-
const powerUnitSubtype = vehicleConfiguration[0];
|
|
916
|
-
const steerAxle = axleConfiguration[0];
|
|
917
|
-
const driveAxle = axleConfiguration[1];
|
|
918
|
-
if (powerUnitSubtype !== 'TRKTRAC' ||
|
|
919
|
-
!steerAxle ||
|
|
920
|
-
!driveAxle ||
|
|
921
|
-
steerAxle.numberOfAxles !== 1 ||
|
|
922
|
-
driveAxle.numberOfAxles !== 2 ||
|
|
923
|
-
driveAxle.interaxleSpacing === undefined ||
|
|
924
|
-
driveAxle.axleSpread === undefined) {
|
|
925
|
-
return [];
|
|
926
|
-
}
|
|
927
|
-
const wheelbase = driveAxle.interaxleSpacing + driveAxle.axleSpread / 2;
|
|
918
|
+
function CheckWheelbaseLegalLimits(policy, vehicleConfiguration, axleConfiguration) {
|
|
919
|
+
var _a, _b, _c;
|
|
928
920
|
const resultBase = {
|
|
929
|
-
id:
|
|
921
|
+
id: enum_1.PolicyCheckId.WheelbaseLegalLimits,
|
|
930
922
|
startAxleUnit: 1,
|
|
931
923
|
endAxleUnit: 2,
|
|
932
924
|
};
|
|
933
|
-
|
|
925
|
+
const powerUnitSubtype = vehicleConfiguration[0];
|
|
926
|
+
const steerAxle = Object.assign(Object.assign({}, axleConfiguration[0]), { axleSpread: (_a = axleConfiguration[0].axleSpread) !== null && _a !== void 0 ? _a : 0 });
|
|
927
|
+
const driveAxle = Object.assign(Object.assign({}, axleConfiguration[1]), { axleSpread: (_b = axleConfiguration[1].axleSpread) !== null && _b !== void 0 ? _b : 0, interaxleSpacing: (_c = axleConfiguration[1].interaxleSpacing) !== null && _c !== void 0 ? _c : 0 });
|
|
928
|
+
// TODO we need to add Truck with PME and Truck Tractor with PME when ready
|
|
929
|
+
const isSupportedVehicleSubtype = (value) => {
|
|
930
|
+
return (value === 'REGTRCK' ||
|
|
931
|
+
value === 'TRKTRAC' ||
|
|
932
|
+
value === 'PICKRTT' ||
|
|
933
|
+
value === 'OGBEDTK');
|
|
934
|
+
};
|
|
935
|
+
const isSingleSteer = steerAxle.numberOfAxles === 1;
|
|
936
|
+
const isTandemSteer = steerAxle.numberOfAxles === 2;
|
|
937
|
+
const isTandemDrive = driveAxle.numberOfAxles === 2;
|
|
938
|
+
const isTridemDrive = driveAxle.numberOfAxles === 3;
|
|
939
|
+
const isTruckTractor = powerUnitSubtype === 'TRKTRAC';
|
|
940
|
+
const isPickerTruckTractor = powerUnitSubtype === 'PICKRTT';
|
|
941
|
+
const isOilfieldBedTruck = powerUnitSubtype === 'OGBEDTK';
|
|
942
|
+
const wheelbase = isSingleSteer
|
|
943
|
+
? driveAxle.interaxleSpacing + driveAxle.axleSpread / 2
|
|
944
|
+
: steerAxle.axleSpread / 2 +
|
|
945
|
+
driveAxle.interaxleSpacing +
|
|
946
|
+
driveAxle.axleSpread / 2;
|
|
947
|
+
// the following logic covers the ASW 6.2 to 7.2m feature, we are grouping it with CheckWheelBaseLegalLimits because of feature overlap
|
|
948
|
+
if ((isTruckTractor || isPickerTruckTractor) &&
|
|
949
|
+
isSingleSteer &&
|
|
950
|
+
isTandemDrive &&
|
|
951
|
+
wheelbase > 620) {
|
|
952
|
+
if (wheelbase > 720) {
|
|
953
|
+
return [
|
|
954
|
+
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.' }),
|
|
955
|
+
];
|
|
956
|
+
}
|
|
957
|
+
if (wheelbase >= 620) {
|
|
958
|
+
const hasDisallowedTrailer = vehicleConfiguration.slice(1).some((v) => {
|
|
959
|
+
const trailer = policy.getTrailerDefinition(v);
|
|
960
|
+
const isSemiTrailer = (trailer === null || trailer === void 0 ? void 0 : trailer.id) === 'SEMITRL';
|
|
961
|
+
return !isSemiTrailer;
|
|
962
|
+
});
|
|
963
|
+
const hasTrailer = vehicleConfiguration.length > 1;
|
|
964
|
+
return [
|
|
965
|
+
Object.assign(Object.assign({}, resultBase), { result: hasDisallowedTrailer
|
|
966
|
+
? enum_1.PolicyCheckResultType.Fail
|
|
967
|
+
: enum_1.PolicyCheckResultType.Warning, message: hasTrailer && !hasDisallowedTrailer
|
|
968
|
+
? 'Wheelbase for Axle Unit X and Axle Unit Y is between 6.2m and 7.2m. Semi-Trailer wheelbase must be within dimensions table found in CTPM 5.3.7.A.'
|
|
969
|
+
: 'Wheelbase for Axle Unit 1 and Axle Unit 2 is between 6.2m and 7.2m. See CTPM 5.3.7.A.' }),
|
|
970
|
+
];
|
|
971
|
+
}
|
|
934
972
|
return [
|
|
935
|
-
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.
|
|
973
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
|
|
936
974
|
];
|
|
937
975
|
}
|
|
938
|
-
if (
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
976
|
+
if (isSupportedVehicleSubtype(powerUnitSubtype)) {
|
|
977
|
+
if (isSingleSteer && isTridemDrive) {
|
|
978
|
+
// TODO we need to add Truck with PME and Truck Tractor with PME when ready
|
|
979
|
+
if (isTruckTractor || isPickerTruckTractor) {
|
|
980
|
+
if (wheelbase < 660) {
|
|
981
|
+
return [
|
|
982
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 6.6 m.' }),
|
|
983
|
+
];
|
|
984
|
+
}
|
|
985
|
+
if (wheelbase > 680) {
|
|
986
|
+
return [
|
|
987
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is greater than 6.8 m.' }),
|
|
988
|
+
];
|
|
989
|
+
}
|
|
943
990
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
991
|
+
else {
|
|
992
|
+
if (wheelbase < 660) {
|
|
993
|
+
return [
|
|
994
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 6.6 m.' }),
|
|
995
|
+
];
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
if (isTandemSteer && isTridemDrive) {
|
|
1000
|
+
if (wheelbase < 770) {
|
|
1001
|
+
if (isOilfieldBedTruck) {
|
|
1002
|
+
if (driveAxle.axleSpread >= 280 &&
|
|
1003
|
+
driveAxle.axleSpread < 300 &&
|
|
1004
|
+
wheelbase < 780) {
|
|
1005
|
+
return [
|
|
1006
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 7.8 m.' }),
|
|
1007
|
+
];
|
|
1008
|
+
}
|
|
1009
|
+
if (driveAxle.axleSpread >= 300 &&
|
|
1010
|
+
driveAxle.axleSpread <= 310 &&
|
|
1011
|
+
wheelbase < 790) {
|
|
1012
|
+
return [
|
|
1013
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 7.9 m.' }),
|
|
1014
|
+
];
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (!isOilfieldBedTruck &&
|
|
1018
|
+
driveAxle.axleSpread >= 240 &&
|
|
1019
|
+
driveAxle.axleSpread < 280) {
|
|
1020
|
+
return [
|
|
1021
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 7.7 m.' }),
|
|
1022
|
+
];
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
if (isOilfieldBedTruck && wheelbase > 1000) {
|
|
1026
|
+
return [
|
|
1027
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is greater than 10.0 m.' }),
|
|
1028
|
+
];
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
947
1031
|
return [
|
|
948
|
-
Object.assign(Object.assign({}, resultBase), { result:
|
|
949
|
-
? enum_1.PolicyCheckResultType.Fail
|
|
950
|
-
: 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.' }),
|
|
1032
|
+
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
|
|
951
1033
|
];
|
|
952
1034
|
}
|
|
953
|
-
return [
|
|
954
|
-
Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Pass, message: '' }),
|
|
955
|
-
];
|
|
1035
|
+
return [];
|
|
956
1036
|
}
|
|
957
1037
|
/**
|
|
958
1038
|
* Validates that the drive axle unit and first jeep axle unit are load equalized
|
|
@@ -1021,7 +1101,8 @@ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfi
|
|
|
1021
1101
|
* - NumberOfAxles: Validates axle count per axle unit
|
|
1022
1102
|
* - NumberOfWheelsPerAxle: Validates tire count per axle unit
|
|
1023
1103
|
* - BoosterAxleLimit: Validates booster axle count against the preceding trailer
|
|
1024
|
-
* -
|
|
1104
|
+
* - TruckTractorWheelbaseLegalLimits: Validates derived wheelbase for single steer, tandem drive truck tractors
|
|
1105
|
+
* - WheelbaseLegalLimits: Validates wheelbase against legal limits
|
|
1025
1106
|
* - DriveJeepLoadEqualization: Validates drive and jeep axle unit load equalization
|
|
1026
1107
|
*
|
|
1027
1108
|
* @see PolicyCheck
|
|
@@ -1046,6 +1127,6 @@ exports.policyCheckMap = new Map([
|
|
|
1046
1127
|
],
|
|
1047
1128
|
[enum_1.PolicyCheckId.NumberOfWheelsPerAxle, CheckNumTiresPerAxle],
|
|
1048
1129
|
[enum_1.PolicyCheckId.BoosterAxleLimit, CheckBoosterAxleLimit],
|
|
1049
|
-
[enum_1.PolicyCheckId.TruckTractorWheelbase, CheckTruckTractorWheelbase],
|
|
1050
1130
|
[enum_1.PolicyCheckId.DriveJeepLoadEqualization, CheckDriveJeepLoadEqualization],
|
|
1131
|
+
[enum_1.PolicyCheckId.WheelbaseLegalLimits, CheckWheelbaseLegalLimits],
|
|
1051
1132
|
]);
|
|
@@ -129,9 +129,6 @@ function getSimplifiedVehicleConfigurationHelper(vehicleDetails, vehicleConfigur
|
|
|
129
129
|
*/
|
|
130
130
|
function combineAxleConfigurationsHelper(powerUnitAxleConfiguration, trailers) {
|
|
131
131
|
const powerUnitAxles = powerUnitAxleConfiguration.map((axle) => (Object.assign(Object.assign({}, axle), { vehicleIndex: 0 })));
|
|
132
|
-
const trailerAxles = trailers.flatMap((trailer, trailerIndex) => {
|
|
133
|
-
var _a;
|
|
134
|
-
return ((_a = trailer.axleConfiguration) !== null && _a !== void 0 ? _a : []).map((axle) => (Object.assign(Object.assign({}, axle), { vehicleIndex: trailerIndex + 1 })));
|
|
135
|
-
});
|
|
132
|
+
const trailerAxles = trailers.flatMap((trailer, trailerIndex) => { var _a; return ((_a = trailer.axleConfiguration) !== null && _a !== void 0 ? _a : []).map((axle) => (Object.assign(Object.assign({}, axle), { vehicleIndex: trailerIndex + 1 }))); });
|
|
136
133
|
return [...powerUnitAxles, ...trailerAxles];
|
|
137
134
|
}
|
|
@@ -36,14 +36,15 @@ class ValidationResults {
|
|
|
36
36
|
this.cost = [];
|
|
37
37
|
if (engineResult) {
|
|
38
38
|
engineResult.events.forEach((e) => {
|
|
39
|
-
var _a, _b, _c, _d, _e
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
const
|
|
39
|
+
var _a, _b, _c, _d, _e;
|
|
40
|
+
var _f, _g, _h;
|
|
41
|
+
const message = (_f = (_a = e.params) === null || _a === void 0 ? void 0 : _a.message) !== null && _f !== void 0 ? _f : `Unknown message: params=${JSON.stringify(e.params)}`;
|
|
42
|
+
const code = (_g = (_b = e.params) === null || _b === void 0 ? void 0 : _b.code) !== null && _g !== void 0 ? _g : validation_result_code_1.ValidationResultCode.GeneralResult;
|
|
43
|
+
const type = (_h = e.type) !== null && _h !== void 0 ? _h : validation_result_type_1.ValidationResultType.Violation.toString();
|
|
43
44
|
const result = new validation_result_1.ValidationResult(type, code, message);
|
|
44
|
-
result.fieldReference = (
|
|
45
|
-
result.cost = (
|
|
46
|
-
result.details = (
|
|
45
|
+
result.fieldReference = (_c = e.params) === null || _c === void 0 ? void 0 : _c.fieldReference;
|
|
46
|
+
result.cost = (_d = e.params) === null || _d === void 0 ? void 0 : _d.cost;
|
|
47
|
+
result.details = (_e = e.params) === null || _e === void 0 ? void 0 : _e.details;
|
|
47
48
|
switch (type) {
|
|
48
49
|
case validation_result_type_1.ValidationResultType.Violation:
|
|
49
50
|
this.violations.push(result);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
1
|
+
export declare const version = "v2.20.1";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED