onroute-policy-engine 2.26.0 → 2.27.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.
Files changed (29) hide show
  1. package/dist/constants/axle-spread-legal-limits.d.ts +30 -0
  2. package/dist/constants/axle-spread-legal-limits.js +33 -0
  3. package/dist/constants/axle-weight-legal-maximums.d.ts +9 -0
  4. package/dist/constants/axle-weight-legal-maximums.js +12 -0
  5. package/dist/constants/axle-weight-permittable-maximums.d.ts +7 -0
  6. package/dist/constants/axle-weight-permittable-maximums.js +10 -0
  7. package/dist/constants/interaxle-spacing-legal-minimums.d.ts +17 -0
  8. package/dist/constants/interaxle-spacing-legal-minimums.js +20 -0
  9. package/dist/constants/power-unit-axle-code-multiplier.d.ts +1 -0
  10. package/dist/constants/power-unit-axle-code-multiplier.js +4 -0
  11. package/dist/constants/semi-trailer-types.d.ts +2 -0
  12. package/dist/constants/semi-trailer-types.js +47 -0
  13. package/dist/enum/policy-check.d.ts +1 -0
  14. package/dist/enum/policy-check.js +1 -0
  15. package/dist/helper/axle-spread.helper.d.ts +13 -0
  16. package/dist/helper/axle-spread.helper.js +83 -0
  17. package/dist/helper/format-meters.helper.d.ts +1 -0
  18. package/dist/helper/format-meters.helper.js +6 -0
  19. package/dist/helper/interaxle-spacing.helper.d.ts +6 -0
  20. package/dist/helper/interaxle-spacing.helper.js +50 -0
  21. package/dist/helper/policy-check.helper.d.ts +6 -1
  22. package/dist/helper/policy-check.helper.js +90 -112
  23. package/dist/types/axle-unit-type.d.ts +6 -0
  24. package/dist/types/axle-unit-type.js +8 -0
  25. package/dist/types/interaxle-spacing-requirement.d.ts +5 -0
  26. package/dist/types/interaxle-spacing-requirement.js +2 -0
  27. package/dist/version.d.ts +1 -1
  28. package/dist/version.js +1 -1
  29. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ export declare const AXLE_SPREAD_LEGAL_LIMITS: {
2
+ SINGLE: {
3
+ MINIMUM: number;
4
+ MAXIMUM: number;
5
+ };
6
+ TANDEM: {
7
+ MINIMUM: number;
8
+ MAXIMUM: number;
9
+ SPREAD_TANDEM_SEMI_TRAILER: {
10
+ MINIMUM: number;
11
+ MAXIMUM: number;
12
+ };
13
+ };
14
+ TRIDEM: {
15
+ MINIMUM: number;
16
+ MAXIMUM: number;
17
+ PONY_TRAILER: {
18
+ MAXIMUM: number;
19
+ };
20
+ SEMI_TRAILER: {
21
+ MAXIMUM: number;
22
+ };
23
+ POLE_TRAILER: {
24
+ MAXIMUM: number;
25
+ };
26
+ OILFIELD_BED_TRUCK: {
27
+ MAXIMUM: number;
28
+ };
29
+ };
30
+ };
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AXLE_SPREAD_LEGAL_LIMITS = void 0;
4
+ exports.AXLE_SPREAD_LEGAL_LIMITS = {
5
+ SINGLE: {
6
+ MINIMUM: 0,
7
+ MAXIMUM: 100,
8
+ },
9
+ TANDEM: {
10
+ MINIMUM: 100,
11
+ MAXIMUM: 185,
12
+ SPREAD_TANDEM_SEMI_TRAILER: {
13
+ MINIMUM: 186,
14
+ MAXIMUM: 307,
15
+ },
16
+ },
17
+ TRIDEM: {
18
+ MINIMUM: 240,
19
+ MAXIMUM: 280,
20
+ PONY_TRAILER: {
21
+ MAXIMUM: 250,
22
+ },
23
+ SEMI_TRAILER: {
24
+ MAXIMUM: 370,
25
+ },
26
+ POLE_TRAILER: {
27
+ MAXIMUM: 310,
28
+ },
29
+ OILFIELD_BED_TRUCK: {
30
+ MAXIMUM: 310,
31
+ },
32
+ },
33
+ };
@@ -0,0 +1,9 @@
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
+ };
@@ -0,0 +1,12 @@
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
+ };
@@ -0,0 +1,7 @@
1
+ export declare const AXLE_WEIGHT_PERMITTABLE_MAXIMUMS: {
2
+ SINGLE_STEER: number;
3
+ SINGLE_NON_STEER: number;
4
+ TANDEM: number;
5
+ STANDARD_TRIDEM: number;
6
+ QUALIFYING_TRIDEM: number;
7
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AXLE_WEIGHT_PERMITTABLE_MAXIMUMS = void 0;
4
+ exports.AXLE_WEIGHT_PERMITTABLE_MAXIMUMS = {
5
+ SINGLE_STEER: 9100,
6
+ SINGLE_NON_STEER: 11000,
7
+ TANDEM: 23000,
8
+ STANDARD_TRIDEM: 28000,
9
+ QUALIFYING_TRIDEM: 29000,
10
+ };
@@ -0,0 +1,17 @@
1
+ export declare const INTERAXLE_SPACING_LEGAL_MINIMUMS: {
2
+ readonly SINGLE: {
3
+ readonly SINGLE: 300;
4
+ readonly TANDEM: 300;
5
+ readonly TRIDEM: 300;
6
+ };
7
+ readonly TANDEM: {
8
+ readonly SINGLE: 300;
9
+ readonly TANDEM: 500;
10
+ readonly TRIDEM: 550;
11
+ };
12
+ readonly TRIDEM: {
13
+ readonly SINGLE: 300;
14
+ readonly TANDEM: 550;
15
+ readonly TRIDEM: 600;
16
+ };
17
+ };
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INTERAXLE_SPACING_LEGAL_MINIMUMS = void 0;
4
+ exports.INTERAXLE_SPACING_LEGAL_MINIMUMS = {
5
+ SINGLE: {
6
+ SINGLE: 300,
7
+ TANDEM: 300,
8
+ TRIDEM: 300,
9
+ },
10
+ TANDEM: {
11
+ SINGLE: 300,
12
+ TANDEM: 500,
13
+ TRIDEM: 550,
14
+ },
15
+ TRIDEM: {
16
+ SINGLE: 300,
17
+ TANDEM: 550,
18
+ TRIDEM: 600,
19
+ },
20
+ };
@@ -0,0 +1 @@
1
+ export declare const POWER_UNIT_AXLE_CODE_MULTIPLIER = 10;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.POWER_UNIT_AXLE_CODE_MULTIPLIER = void 0;
4
+ exports.POWER_UNIT_AXLE_CODE_MULTIPLIER = 10;
@@ -0,0 +1,2 @@
1
+ export declare const SEMI_TRAILER_TYPES: Set<string>;
2
+ export declare function isSemiTrailerType(vehicleType: string): boolean;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SEMI_TRAILER_TYPES = void 0;
4
+ exports.isSemiTrailerType = isSemiTrailerType;
5
+ exports.SEMI_TRAILER_TYPES = new Set([
6
+ // Expando Semi-Trailers
7
+ 'EXPANDO',
8
+ // Fixed Equipment - Conveyors
9
+ 'FECVYRX',
10
+ // Fixed Equipment - Counter Flow Asphalt Drum Mixers
11
+ 'FEDRMMX',
12
+ // Fixed Equipment - Portable Asphalt Baghouses
13
+ 'FEBGHSE',
14
+ // Fixed Equipment - Semi-Trailers
15
+ 'FESEMTR',
16
+ // Fixed Equipment - Wheeler Semi-Trailers
17
+ 'FEWHELR',
18
+ // Semi-Trailers - Hiboys/Expandos
19
+ 'HIBOEXP',
20
+ // Semi-Trailers - Hiboys/Flat Decks
21
+ 'HIBOFLT',
22
+ // Oil and Gas - Oversize Oilfield Flat Deck Semi-Trailers
23
+ 'OGOSFDT',
24
+ // Platform Trailer
25
+ 'PLATFRM',
26
+ // Platform Trailers - Wheelers
27
+ 'PLATWHE',
28
+ // Pole Trailers
29
+ 'POLETRL',
30
+ // Ready Mix Concrete Pump Semi-Trailers
31
+ 'REDIMIX',
32
+ // Semi-Trailers
33
+ 'SEMITRL',
34
+ // Semi-Trailers - Single Drop, Double Drop, Step Decks, Lowbed, Expandos, etc.
35
+ 'STSDBDK',
36
+ // Semi-Trailers with Crane
37
+ 'STCRANE',
38
+ // Semi-Trailers - Spread Tandem
39
+ 'STWDTAN',
40
+ // Semi-Trailers - Wheelers
41
+ 'STWHELR',
42
+ // Semi-Trailers - Wide Wheelers
43
+ 'STWIDWH',
44
+ ]);
45
+ function isSemiTrailerType(vehicleType) {
46
+ return exports.SEMI_TRAILER_TYPES.has(vehicleType);
47
+ }
@@ -8,6 +8,7 @@ export declare enum PolicyCheckId {
8
8
  BoosterAxleLimit = "booster-axle-limit",
9
9
  BridgeFormula = "bridge-formula",
10
10
  DriveJeepLoadEqualization = "drive-jeep-load-equalization",
11
+ LegalAxleSpread = "legal-axle-spread",
11
12
  LegalInteraxleSpacing = "legal-interaxle-spacing",
12
13
  LegalWeight = "legal-weight",
13
14
  MaxTireLoad = "max-tire-load",
@@ -13,6 +13,7 @@ var PolicyCheckId;
13
13
  PolicyCheckId["BoosterAxleLimit"] = "booster-axle-limit";
14
14
  PolicyCheckId["BridgeFormula"] = "bridge-formula";
15
15
  PolicyCheckId["DriveJeepLoadEqualization"] = "drive-jeep-load-equalization";
16
+ PolicyCheckId["LegalAxleSpread"] = "legal-axle-spread";
16
17
  PolicyCheckId["LegalInteraxleSpacing"] = "legal-interaxle-spacing";
17
18
  PolicyCheckId["LegalWeight"] = "legal-weight";
18
19
  PolicyCheckId["MaxTireLoad"] = "max-tire-load";
@@ -0,0 +1,13 @@
1
+ import { AxleConfiguration } from '../types/axle-configuration';
2
+ export declare function getTandemAxleSpreadThreshold(vehicleConfiguration: Array<string>, vehicleIndex: number): {
3
+ minCm: number;
4
+ maxCm: number;
5
+ };
6
+ export declare function getTridemAxleSpreadThreshold(vehicleConfiguration: Array<string>, vehicleIndex: number, axleConfiguration: Array<AxleConfiguration>, axleIndex: number): {
7
+ minCm: number;
8
+ maxCm: number;
9
+ };
10
+ export declare function getAxleSpreadThreshold(vehicleConfiguration: Array<string>, axleUnitVehicleIndexes: Array<number>, axleConfiguration: Array<AxleConfiguration>, axleIndex: number): {
11
+ minCm: number;
12
+ maxCm: number;
13
+ } | undefined;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTandemAxleSpreadThreshold = getTandemAxleSpreadThreshold;
4
+ exports.getTridemAxleSpreadThreshold = getTridemAxleSpreadThreshold;
5
+ exports.getAxleSpreadThreshold = getAxleSpreadThreshold;
6
+ const axle_spread_legal_limits_1 = require("../constants/axle-spread-legal-limits");
7
+ const semi_trailer_types_1 = require("../constants/semi-trailer-types");
8
+ function getTandemAxleSpreadThreshold(vehicleConfiguration, vehicleIndex) {
9
+ const vehicleType = vehicleConfiguration[vehicleIndex];
10
+ const isSpreadTandemSemiTrailer = vehicleType === 'STWDTAN';
11
+ if (isSpreadTandemSemiTrailer) {
12
+ return {
13
+ minCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TANDEM.SPREAD_TANDEM_SEMI_TRAILER.MINIMUM,
14
+ maxCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TANDEM.SPREAD_TANDEM_SEMI_TRAILER.MAXIMUM,
15
+ };
16
+ }
17
+ return {
18
+ minCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TANDEM.MINIMUM,
19
+ maxCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TANDEM.MAXIMUM,
20
+ };
21
+ }
22
+ function getTridemAxleSpreadThreshold(vehicleConfiguration, vehicleIndex, axleConfiguration, axleIndex) {
23
+ const vehicleType = vehicleConfiguration[vehicleIndex];
24
+ const isDriveAxle = axleIndex === 1;
25
+ const isTridemDrive = axleConfiguration[1].numberOfAxles === 3;
26
+ const isPonyTrailer = vehicleType === 'PONYTRL';
27
+ const isPoleTrailer = vehicleType === 'POLETRL';
28
+ const isOilfieldBedTruck = vehicleType === 'OGBEDTK';
29
+ const isPowerUnitTruckTractor = vehicleConfiguration[0] === 'TRKTRAC';
30
+ if (isOilfieldBedTruck && isDriveAxle) {
31
+ return {
32
+ minCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.MINIMUM,
33
+ maxCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.OILFIELD_BED_TRUCK.MAXIMUM,
34
+ };
35
+ }
36
+ if (isPonyTrailer) {
37
+ return {
38
+ minCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.MINIMUM,
39
+ maxCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.PONY_TRAILER.MAXIMUM,
40
+ };
41
+ }
42
+ if (isPowerUnitTruckTractor && (0, semi_trailer_types_1.isSemiTrailerType)(vehicleType)) {
43
+ return {
44
+ minCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.MINIMUM,
45
+ maxCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.SEMI_TRAILER.MAXIMUM,
46
+ };
47
+ }
48
+ if (isPowerUnitTruckTractor && isTridemDrive && isPoleTrailer) {
49
+ return {
50
+ minCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.MINIMUM,
51
+ maxCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.POLE_TRAILER.MAXIMUM,
52
+ };
53
+ }
54
+ return {
55
+ minCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.MINIMUM,
56
+ maxCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.TRIDEM.MAXIMUM,
57
+ };
58
+ }
59
+ function getAxleSpreadThreshold(vehicleConfiguration, axleUnitVehicleIndexes, axleConfiguration, axleIndex) {
60
+ const axleUnit = axleConfiguration[axleIndex];
61
+ if (!Number.isFinite(axleUnit.axleSpread)) {
62
+ return undefined;
63
+ }
64
+ const vehicleIndex = axleUnitVehicleIndexes[axleIndex];
65
+ const numberOfAxles = axleUnit.numberOfAxles;
66
+ const isSingleAxle = numberOfAxles === 1;
67
+ const isTandemAxle = numberOfAxles === 2;
68
+ const isTridemAxle = numberOfAxles === 3;
69
+ if (isSingleAxle) {
70
+ // the ASW table specifically disables the axleSpread input for single axle unit types, so this code will never run, but have left these in place in case something changes
71
+ return {
72
+ minCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.SINGLE.MINIMUM,
73
+ maxCm: axle_spread_legal_limits_1.AXLE_SPREAD_LEGAL_LIMITS.SINGLE.MAXIMUM,
74
+ };
75
+ }
76
+ if (isTandemAxle) {
77
+ return getTandemAxleSpreadThreshold(vehicleConfiguration, vehicleIndex);
78
+ }
79
+ if (isTridemAxle) {
80
+ return getTridemAxleSpreadThreshold(vehicleConfiguration, vehicleIndex, axleConfiguration, axleIndex);
81
+ }
82
+ return undefined;
83
+ }
@@ -0,0 +1 @@
1
+ export declare function formatMeters(cm: number): string;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatMeters = formatMeters;
4
+ function formatMeters(cm) {
5
+ return (cm / 100).toFixed(2).replace(/(\.\d)0$/u, '$1');
6
+ }
@@ -0,0 +1,6 @@
1
+ import { INTERAXLE_SPACING_LEGAL_MINIMUMS } from '../constants/interaxle-spacing-legal-minimums';
2
+ import { AxleConfiguration } from '../types/axle-configuration';
3
+ import { InteraxleSpacingRequirement } from '../types/interaxle-spacing-requirement';
4
+ export declare function getAxleUnitType(numberOfAxles: number): keyof typeof INTERAXLE_SPACING_LEGAL_MINIMUMS;
5
+ export declare function getFailedInteraxleSpacingMessage(requirement: InteraxleSpacingRequirement, previousAxleUnitNumber: number, currentAxleUnitNumber: number): string;
6
+ export declare function getInteraxleSpacingRequirement(axleConfiguration: Array<AxleConfiguration>, axleIndex: number): InteraxleSpacingRequirement | undefined;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAxleUnitType = getAxleUnitType;
4
+ exports.getFailedInteraxleSpacingMessage = getFailedInteraxleSpacingMessage;
5
+ exports.getInteraxleSpacingRequirement = getInteraxleSpacingRequirement;
6
+ const interaxle_spacing_legal_minimums_1 = require("../constants/interaxle-spacing-legal-minimums");
7
+ const format_meters_helper_1 = require("./format-meters.helper");
8
+ function getAxleUnitType(numberOfAxles) {
9
+ if (numberOfAxles === 1) {
10
+ return 'SINGLE';
11
+ }
12
+ if (numberOfAxles === 2) {
13
+ return 'TANDEM';
14
+ }
15
+ return 'TRIDEM';
16
+ }
17
+ function getFailedInteraxleSpacingMessage(requirement, previousAxleUnitNumber, currentAxleUnitNumber) {
18
+ if (requirement.groupLabel) {
19
+ if (requirement.min && requirement.max) {
20
+ return `Interaxle Spacing for ${requirement.groupLabel} must be between ${(0, format_meters_helper_1.formatMeters)(requirement.min)} m and ${(0, format_meters_helper_1.formatMeters)(requirement.max)} m.`;
21
+ }
22
+ if (requirement.min) {
23
+ return `Interaxle Spacing for ${requirement.groupLabel} must be at least ${(0, format_meters_helper_1.formatMeters)(requirement.min)} m.`;
24
+ }
25
+ }
26
+ if (requirement.min && requirement.max) {
27
+ return `Interaxle Spacing between Axle Unit ${previousAxleUnitNumber} and Axle Unit ${currentAxleUnitNumber} must be between ${(0, format_meters_helper_1.formatMeters)(requirement.min)} m and ${(0, format_meters_helper_1.formatMeters)(requirement.max)} m.`;
28
+ }
29
+ if (requirement.min) {
30
+ return `Interaxle Spacing between Axle Unit ${previousAxleUnitNumber} and Axle Unit ${currentAxleUnitNumber} must be at least ${(0, format_meters_helper_1.formatMeters)(requirement.min)} m.`;
31
+ }
32
+ return '';
33
+ }
34
+ function getInteraxleSpacingRequirement(axleConfiguration, axleIndex) {
35
+ // the first axle unit will never have an interaxle spacing value or previous axle unit to compare against
36
+ if (axleIndex === 0) {
37
+ return undefined;
38
+ }
39
+ const axleUnit = axleConfiguration[axleIndex];
40
+ const previousAxleUnit = axleConfiguration[axleIndex - 1];
41
+ if (!Number.isFinite(axleUnit.interaxleSpacing) ||
42
+ !Number.isFinite(previousAxleUnit.numberOfAxles)) {
43
+ return undefined;
44
+ }
45
+ const previousAxleUnitType = getAxleUnitType(previousAxleUnit.numberOfAxles);
46
+ const currentAxleUnitType = getAxleUnitType(axleUnit.numberOfAxles);
47
+ return {
48
+ min: interaxle_spacing_legal_minimums_1.INTERAXLE_SPACING_LEGAL_MINIMUMS[previousAxleUnitType][currentAxleUnitType],
49
+ };
50
+ }
@@ -283,7 +283,7 @@ export declare function CheckBoosterAxleLimit(_policy: Policy, vehicleConfigurat
283
283
  /**
284
284
  * Validates wheelbase legal limits for supported power unit vehicle sub-types.
285
285
  */
286
- export declare function CheckWheelbaseLegalLimits(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
286
+ export declare function CheckWheelbaseLegalLimits(_policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
287
287
  /**
288
288
  * Validates that the drive axle unit and first jeep axle unit are load equalized
289
289
  * within 1000 kg when they have the same number of axles.
@@ -303,6 +303,10 @@ export declare function CheckDriveJeepLoadEqualization(_policy: Policy, vehicleC
303
303
  * current axle unit and the next axle unit, per Table II.
304
304
  */
305
305
  export declare function CheckLegalInteraxleSpacing(_policy: Policy, _vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
306
+ /**
307
+ * Validates each axle unit against its legal axle spread maximum.
308
+ */
309
+ export declare function CheckLegalAxleSpread(policy: Policy, vehicleConfiguration: Array<string>, axleConfiguration: Array<AxleConfiguration>): Array<PolicyCheckResult>;
306
310
  /**
307
311
  * Map of policy check functions keyed by their corresponding PolicyCheckId.
308
312
  *
@@ -315,6 +319,7 @@ export declare function CheckLegalInteraxleSpacing(_policy: Policy, _vehicleConf
315
319
  * - AxleGroupMaximumLegalWeightThreshold: Validates axle groups within 8 m against CTR 7.17
316
320
  * - BridgeFormula: Validates axle groups against bridge formula requirements
317
321
  * - CheckLegalWeight: Validates axle units against legal weight limits
322
+ * - CheckLegalAxleSpread: Validates axle units against legal axle spread limits
318
323
  * - CheckPermittableWeight: Validates total vehicle weight against permit limits
319
324
  * - MaxTireLoad: Validates tire load capacity for each axle unit
320
325
  * - MinDriveAxleWeight: Validates minimum weight requirements for drive axles
@@ -17,47 +17,17 @@ exports.CheckBoosterAxleLimit = CheckBoosterAxleLimit;
17
17
  exports.CheckWheelbaseLegalLimits = CheckWheelbaseLegalLimits;
18
18
  exports.CheckDriveJeepLoadEqualization = CheckDriveJeepLoadEqualization;
19
19
  exports.CheckLegalInteraxleSpacing = CheckLegalInteraxleSpacing;
20
+ exports.CheckLegalAxleSpread = CheckLegalAxleSpread;
20
21
  const dimensions_helper_1 = require("./dimensions.helper");
21
22
  const ctr_717_helper_1 = require("./ctr-717.helper");
22
23
  const enum_1 = require("../enum");
23
- const POWER_UNIT_AXLE_CODE_MULTIPLIER = 10;
24
- const LEGAL_WEIGHT_MAXIMUM_KG = {
25
- SINGLE_AXLE: 9100,
26
- STANDARD_TRUCK_TRACTOR_STEER: 6000,
27
- STANDARD_SINGLE_STEER_WITH_TRIDEM_DRIVE: 7300,
28
- TANDEM_AXLE: 17000,
29
- STANDARD_TANDEM_STEER_WITH_TRIDEM_DRIVE: 13600,
30
- PME_TANDEM_STEER_WITH_TRIDEM_DRIVE: 15200,
31
- TRIDEM_AXLE: 24000,
32
- };
33
- const PERMITTABLE_WEIGHT_MAXIMUM_KG = {
34
- SINGLE_STEER: 9100,
35
- SINGLE_NON_STEER: 11000,
36
- TANDEM: 23000,
37
- STANDARD_TRIDEM: 28000,
38
- QUALIFYING_TRIDEM: 29000,
39
- };
40
- const QUALIFYING_TRIDEM_SPREAD_CM = {
41
- MINIMUM: 240,
42
- MAXIMUM: 370,
43
- };
44
- const INTERAXLE_SPACING_MINIMUM_CM = {
45
- SINGLE: {
46
- SINGLE: 300,
47
- TANDEM: 300,
48
- TRIDEM: 300,
49
- },
50
- TANDEM: {
51
- SINGLE: 300,
52
- TANDEM: 500,
53
- TRIDEM: 550,
54
- },
55
- TRIDEM: {
56
- SINGLE: 300,
57
- TANDEM: 550,
58
- TRIDEM: 600,
59
- },
60
- };
24
+ const axle_weight_legal_maximums_1 = require("../constants/axle-weight-legal-maximums");
25
+ const axle_weight_permittable_maximums_1 = require("../constants/axle-weight-permittable-maximums");
26
+ const power_unit_axle_code_multiplier_1 = require("../constants/power-unit-axle-code-multiplier");
27
+ const axle_spread_helper_1 = require("./axle-spread.helper");
28
+ const semi_trailer_types_1 = require("../constants/semi-trailer-types");
29
+ const interaxle_spacing_helper_1 = require("./interaxle-spacing.helper");
30
+ const format_meters_helper_1 = require("./format-meters.helper");
61
31
  /** Applies the standard lower-of rule or the exact 7.16(g) exception. */
62
32
  function getMaximumLegalAxleGroupWeightThreshold(individualLegalWeightSum, ctr717TableValue, isTandemDriveSingleJeepException) {
63
33
  const tandemDriveSingleJeepMinimumKg = 24000;
@@ -74,7 +44,7 @@ function getApplicableLegalWeightThreshold(policy, vehicleConfiguration, axleCon
74
44
  return undefined;
75
45
  }
76
46
  const weights = vehicleIndex === 0
77
- ? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles * POWER_UNIT_AXLE_CODE_MULTIPLIER +
47
+ ? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles * power_unit_axle_code_multiplier_1.POWER_UNIT_AXLE_CODE_MULTIPLIER +
78
48
  axleConfiguration[1].numberOfAxles)
79
49
  : policy.getDefaultTrailerWeight(vehicleType, axle.numberOfAxles);
80
50
  if (weights.length === 0) {
@@ -101,7 +71,7 @@ function getConfiguredAxleUnitWeightThreshold(policy, vehicleConfiguration, axle
101
71
  return 0;
102
72
  }
103
73
  const weights = vehicleIndex === 0
104
- ? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles * POWER_UNIT_AXLE_CODE_MULTIPLIER +
74
+ ? policy.getDefaultPowerUnitWeight(vehicleType, axleConfiguration[0].numberOfAxles * power_unit_axle_code_multiplier_1.POWER_UNIT_AXLE_CODE_MULTIPLIER +
105
75
  axleConfiguration[1].numberOfAxles)
106
76
  : policy.getDefaultTrailerWeight(vehicleType, axleUnit.numberOfAxles);
107
77
  if (weights.length === 0) {
@@ -123,28 +93,28 @@ function getFeatureLegalPowerUnitWeightThreshold(vehicleType, axleConfiguration,
123
93
  if (steerAxle.numberOfAxles === 1 &&
124
94
  (driveAxle.numberOfAxles === 1 || driveAxle.numberOfAxles === 2)) {
125
95
  return hasPme || vehicleType === 'REGTRCK'
126
- ? LEGAL_WEIGHT_MAXIMUM_KG.SINGLE_AXLE
127
- : LEGAL_WEIGHT_MAXIMUM_KG.STANDARD_TRUCK_TRACTOR_STEER;
96
+ ? axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.SINGLE_AXLE
97
+ : axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.STANDARD_TRUCK_TRACTOR_STEER;
128
98
  }
129
99
  if (steerAxle.numberOfAxles === 1 && driveAxle.numberOfAxles === 3) {
130
100
  return hasPme
131
- ? LEGAL_WEIGHT_MAXIMUM_KG.SINGLE_AXLE
132
- : LEGAL_WEIGHT_MAXIMUM_KG.STANDARD_SINGLE_STEER_WITH_TRIDEM_DRIVE;
101
+ ? axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.SINGLE_AXLE
102
+ : axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.STANDARD_SINGLE_STEER_WITH_TRIDEM_DRIVE;
133
103
  }
134
104
  if (steerAxle.numberOfAxles === 2 && driveAxle.numberOfAxles === 2) {
135
- return LEGAL_WEIGHT_MAXIMUM_KG.TANDEM_AXLE;
105
+ return axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.TANDEM_AXLE;
136
106
  }
137
107
  if (steerAxle.numberOfAxles === 2 && driveAxle.numberOfAxles === 3) {
138
108
  return hasPme
139
- ? LEGAL_WEIGHT_MAXIMUM_KG.PME_TANDEM_STEER_WITH_TRIDEM_DRIVE
140
- : LEGAL_WEIGHT_MAXIMUM_KG.STANDARD_TANDEM_STEER_WITH_TRIDEM_DRIVE;
109
+ ? axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.PME_TANDEM_STEER_WITH_TRIDEM_DRIVE
110
+ : axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.STANDARD_TANDEM_STEER_WITH_TRIDEM_DRIVE;
141
111
  }
142
112
  }
143
113
  if (axleIndex === 1) {
144
114
  return {
145
- 1: LEGAL_WEIGHT_MAXIMUM_KG.SINGLE_AXLE,
146
- 2: LEGAL_WEIGHT_MAXIMUM_KG.TANDEM_AXLE,
147
- 3: LEGAL_WEIGHT_MAXIMUM_KG.TRIDEM_AXLE,
115
+ 1: axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.SINGLE_AXLE,
116
+ 2: axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.TANDEM_AXLE,
117
+ 3: axle_weight_legal_maximums_1.AXLE_WEIGHT_LEGAL_MAXIMUMS.TRIDEM_AXLE,
148
118
  }[driveAxle.numberOfAxles];
149
119
  }
150
120
  return undefined;
@@ -511,20 +481,24 @@ function CheckNumTiresPerAxle(_policy, _vehicleConfiguration, axleConfiguration)
511
481
  function CheckPermittableWeight(policy, vehicleConfiguration, axleConfiguration) {
512
482
  const policyId = enum_1.PolicyCheckId.PermittableWeight;
513
483
  const axleUnitVehicleIndexes = getAxleUnitVehicleIndexLookup(policy, vehicleConfiguration, axleConfiguration);
484
+ const QUALIFYING_TRIDEM_SPREAD_CM = {
485
+ MINIMUM: 240,
486
+ MAXIMUM: 370,
487
+ };
514
488
  return axleConfiguration.map((axleUnit, axleIndex) => {
515
489
  const vehicleIndex = axleUnitVehicleIndexes[axleIndex];
516
490
  const isSingleSteer = axleIndex === 0 && vehicleIndex === 0 && axleUnit.numberOfAxles === 1;
517
491
  const isTandemSteer = axleIndex === 0 && vehicleIndex === 0 && axleUnit.numberOfAxles === 2;
518
492
  let permittableWeight;
519
493
  if (isSingleSteer) {
520
- permittableWeight = PERMITTABLE_WEIGHT_MAXIMUM_KG.SINGLE_STEER;
494
+ permittableWeight = axle_weight_permittable_maximums_1.AXLE_WEIGHT_PERMITTABLE_MAXIMUMS.SINGLE_STEER;
521
495
  }
522
496
  else if (!isTandemSteer) {
523
497
  if (axleUnit.numberOfAxles === 1) {
524
- permittableWeight = PERMITTABLE_WEIGHT_MAXIMUM_KG.SINGLE_NON_STEER;
498
+ permittableWeight = axle_weight_permittable_maximums_1.AXLE_WEIGHT_PERMITTABLE_MAXIMUMS.SINGLE_NON_STEER;
525
499
  }
526
500
  else if (axleUnit.numberOfAxles === 2) {
527
- permittableWeight = PERMITTABLE_WEIGHT_MAXIMUM_KG.TANDEM;
501
+ permittableWeight = axle_weight_permittable_maximums_1.AXLE_WEIGHT_PERMITTABLE_MAXIMUMS.TANDEM;
528
502
  }
529
503
  else if (axleUnit.numberOfAxles === 3) {
530
504
  const spreadQualifies = axleUnit.axleSpread !== undefined &&
@@ -538,8 +512,8 @@ function CheckPermittableWeight(policy, vehicleConfiguration, axleConfiguration)
538
512
  const boosterQualifies = !hasImmediatelyFollowingBooster || (boosterAxle === null || boosterAxle === void 0 ? void 0 : boosterAxle.numberOfAxles) === 1;
539
513
  permittableWeight =
540
514
  spreadQualifies && boosterQualifies
541
- ? PERMITTABLE_WEIGHT_MAXIMUM_KG.QUALIFYING_TRIDEM
542
- : PERMITTABLE_WEIGHT_MAXIMUM_KG.STANDARD_TRIDEM;
515
+ ? axle_weight_permittable_maximums_1.AXLE_WEIGHT_PERMITTABLE_MAXIMUMS.QUALIFYING_TRIDEM
516
+ : axle_weight_permittable_maximums_1.AXLE_WEIGHT_PERMITTABLE_MAXIMUMS.STANDARD_TRIDEM;
543
517
  }
544
518
  }
545
519
  permittableWeight !== null && permittableWeight !== void 0 ? permittableWeight : (permittableWeight = getConfiguredAxleUnitWeightThreshold(policy, vehicleConfiguration, axleConfiguration, axleUnitVehicleIndexes, axleIndex, 'permittable'));
@@ -772,9 +746,12 @@ function CheckMinDriveAxleWeight(_policy, vehicleConfiguration, axleConfiguratio
772
746
  const driveAxle = axleConfiguration[1];
773
747
  const isTandemDrive = driveAxle.numberOfAxles === 2;
774
748
  const isTridemDrive = driveAxle.numberOfAxles === 3;
775
- // TODO we need to add Truck with PME and Truck Tractor with PME when ready
776
749
  const isSupportedVehicleSubtype = (value) => {
777
- return value === 'REGTRCK' || value === 'TRKTRAC' || value === 'PICKRTT';
750
+ return (value === 'REGTRCK' ||
751
+ value === 'TRKTRAC' ||
752
+ value === 'PICKRTT' ||
753
+ value === 'TRCKPME' ||
754
+ value === 'TRACPME');
778
755
  };
779
756
  if ((isTandemDrive || isTridemDrive) &&
780
757
  isSupportedVehicleSubtype(powerUnitSubtype)) {
@@ -975,6 +952,14 @@ function CheckMaxTireLoad(_policy, _vehicleConfiguration, axleConfiguration) {
975
952
  }
976
953
  return;
977
954
  }
955
+ // ORV2-5903 keeps this exact configuration as a grandfathered TPS case.
956
+ const hasGrandfatheredTpsTireLimit = ac.numberOfAxles === 2 &&
957
+ tireSize === 279.4 &&
958
+ numberOfTires === 8 &&
959
+ axleWeight <= 23000;
960
+ if (hasGrandfatheredTpsTireLimit) {
961
+ return;
962
+ }
978
963
  /**
979
964
  * Standard non-steering axle — all vehicles except Crane - All Terrain,
980
965
  * Mobile Crane (non-steering), Rubber Tired Loader
@@ -1060,7 +1045,7 @@ function CheckBoosterAxleLimit(_policy, vehicleConfiguration, axleConfiguration)
1060
1045
  /**
1061
1046
  * Validates wheelbase legal limits for supported power unit vehicle sub-types.
1062
1047
  */
1063
- function CheckWheelbaseLegalLimits(policy, vehicleConfiguration, axleConfiguration) {
1048
+ function CheckWheelbaseLegalLimits(_policy, vehicleConfiguration, axleConfiguration) {
1064
1049
  var _a, _b, _c;
1065
1050
  const resultBase = {
1066
1051
  id: enum_1.PolicyCheckId.WheelbaseLegalLimits,
@@ -1070,12 +1055,13 @@ function CheckWheelbaseLegalLimits(policy, vehicleConfiguration, axleConfigurati
1070
1055
  const powerUnitSubtype = vehicleConfiguration[0];
1071
1056
  const steerAxle = Object.assign(Object.assign({}, axleConfiguration[0]), { axleSpread: (_a = axleConfiguration[0].axleSpread) !== null && _a !== void 0 ? _a : 0 });
1072
1057
  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 });
1073
- // TODO we need to add Truck with PME and Truck Tractor with PME when ready
1074
1058
  const isSupportedVehicleSubtype = (value) => {
1075
1059
  return (value === 'REGTRCK' ||
1076
1060
  value === 'TRKTRAC' ||
1077
1061
  value === 'PICKRTT' ||
1078
- value === 'OGBEDTK');
1062
+ value === 'OGBEDTK' ||
1063
+ value === 'TRCKPME' ||
1064
+ value === 'TRACPME');
1079
1065
  };
1080
1066
  const isSingleSteer = steerAxle.numberOfAxles === 1;
1081
1067
  const isTandemSteer = steerAxle.numberOfAxles === 2;
@@ -1083,6 +1069,8 @@ function CheckWheelbaseLegalLimits(policy, vehicleConfiguration, axleConfigurati
1083
1069
  const isTridemDrive = driveAxle.numberOfAxles === 3;
1084
1070
  const isTruckTractor = powerUnitSubtype === 'TRKTRAC';
1085
1071
  const isPickerTruckTractor = powerUnitSubtype === 'PICKRTT';
1072
+ const isTruckWithPME = powerUnitSubtype === 'TRCKPME';
1073
+ const isTruckTractorWithPME = powerUnitSubtype === 'TRACPME';
1086
1074
  const isOilfieldBedTruck = powerUnitSubtype === 'OGBEDTK';
1087
1075
  const wheelbase = isSingleSteer
1088
1076
  ? driveAxle.interaxleSpacing + driveAxle.axleSpread / 2
@@ -1100,12 +1088,10 @@ function CheckWheelbaseLegalLimits(policy, vehicleConfiguration, axleConfigurati
1100
1088
  ];
1101
1089
  }
1102
1090
  if (wheelbase >= 620) {
1103
- const hasDisallowedTrailer = vehicleConfiguration.slice(1).some((v) => {
1104
- const trailer = policy.getTrailerDefinition(v);
1105
- const isSemiTrailer = (trailer === null || trailer === void 0 ? void 0 : trailer.id) === 'SEMITRL';
1106
- return !isSemiTrailer;
1107
- });
1108
1091
  const hasTrailer = vehicleConfiguration.length > 1;
1092
+ const hasDisallowedTrailer = vehicleConfiguration
1093
+ .slice(1)
1094
+ .some((vehicleType) => !(0, semi_trailer_types_1.isSemiTrailerType)(vehicleType));
1109
1095
  return [
1110
1096
  Object.assign(Object.assign({}, resultBase), { result: hasDisallowedTrailer
1111
1097
  ? enum_1.PolicyCheckResultType.Fail
@@ -1120,8 +1106,10 @@ function CheckWheelbaseLegalLimits(policy, vehicleConfiguration, axleConfigurati
1120
1106
  }
1121
1107
  if (isSupportedVehicleSubtype(powerUnitSubtype)) {
1122
1108
  if (isSingleSteer && isTridemDrive) {
1123
- // TODO we need to add Truck with PME and Truck Tractor with PME when ready
1124
- if (isTruckTractor || isPickerTruckTractor) {
1109
+ if (isTruckTractor ||
1110
+ isPickerTruckTractor ||
1111
+ isTruckWithPME ||
1112
+ isTruckTractorWithPME) {
1125
1113
  if (wheelbase < 660) {
1126
1114
  return [
1127
1115
  Object.assign(Object.assign({}, resultBase), { result: enum_1.PolicyCheckResultType.Fail, message: 'Wheelbase for Axle Unit 1 is less than 6.6 m.' }),
@@ -1226,49 +1214,6 @@ function CheckDriveJeepLoadEqualization(_policy, vehicleConfiguration, axleConfi
1226
1214
  });
1227
1215
  return policyCheckResults;
1228
1216
  }
1229
- function getAxleUnitType(numberOfAxles) {
1230
- if (numberOfAxles === 1) {
1231
- return 'SINGLE';
1232
- }
1233
- if (numberOfAxles === 2) {
1234
- return 'TANDEM';
1235
- }
1236
- return 'TRIDEM';
1237
- }
1238
- function getInteraxleSpacingRequirement(axleConfiguration, axleIndex) {
1239
- // the first axle unit will never have an interaxle spacing value or previous axle unit to compare against
1240
- if (axleIndex === 0) {
1241
- return undefined;
1242
- }
1243
- const axleUnit = axleConfiguration[axleIndex];
1244
- const previousAxleUnit = axleConfiguration[axleIndex - 1];
1245
- if (!Number.isFinite(axleUnit.interaxleSpacing) ||
1246
- !Number.isFinite(previousAxleUnit.numberOfAxles)) {
1247
- return undefined;
1248
- }
1249
- const previousAxleUnitType = getAxleUnitType(previousAxleUnit.numberOfAxles);
1250
- const currentAxleUnitType = getAxleUnitType(axleUnit.numberOfAxles);
1251
- return {
1252
- min: INTERAXLE_SPACING_MINIMUM_CM[previousAxleUnitType][currentAxleUnitType],
1253
- };
1254
- }
1255
- function formatMeters(cm) {
1256
- return (cm / 100).toFixed(2).replace(/\.0+$/u, '');
1257
- }
1258
- function getFailedInteraxleSpacingMessage(requirement, previousAxleUnitNumber, currentAxleUnitNumber) {
1259
- if (requirement.groupLabel) {
1260
- if (requirement.min && requirement.max) {
1261
- return `Interaxle Spacing for ${requirement.groupLabel} must be between ${formatMeters(requirement.min)} m and ${formatMeters(requirement.max)} m.`;
1262
- }
1263
- if (requirement.min) {
1264
- return `Interaxle Spacing for ${requirement.groupLabel} must be at least ${formatMeters(requirement.min)} m.`;
1265
- }
1266
- }
1267
- if (requirement.min) {
1268
- return `Interaxle Spacing between Axle Unit ${previousAxleUnitNumber} and Axle Unit ${currentAxleUnitNumber} must be at least ${formatMeters(requirement.min)} m.`;
1269
- }
1270
- return '';
1271
- }
1272
1217
  /**
1273
1218
  * Validates each axle unit against the minimum interaxle spacing for its
1274
1219
  * current axle unit and the next axle unit, per Table II.
@@ -1276,7 +1221,7 @@ function getFailedInteraxleSpacingMessage(requirement, previousAxleUnitNumber, c
1276
1221
  function CheckLegalInteraxleSpacing(_policy, _vehicleConfiguration, axleConfiguration) {
1277
1222
  const policyId = enum_1.PolicyCheckId.LegalInteraxleSpacing;
1278
1223
  return axleConfiguration.map((axleUnit, axleIndex) => {
1279
- const requirement = getInteraxleSpacingRequirement(axleConfiguration, axleIndex);
1224
+ const requirement = (0, interaxle_spacing_helper_1.getInteraxleSpacingRequirement)(axleConfiguration, axleIndex);
1280
1225
  // Pass when no requirement exists, interaxle spacing is missing, or interaxle spacing falls within the requirement's min/max bounds.
1281
1226
  const shouldPass = !requirement ||
1282
1227
  !axleUnit.interaxleSpacing ||
@@ -1286,7 +1231,7 @@ function CheckLegalInteraxleSpacing(_policy, _vehicleConfiguration, axleConfigur
1286
1231
  const previousAxleUnitNumber = axleIndex;
1287
1232
  const message = shouldPass
1288
1233
  ? ''
1289
- : getFailedInteraxleSpacingMessage(requirement, previousAxleUnitNumber, axleUnitNumber);
1234
+ : (0, interaxle_spacing_helper_1.getFailedInteraxleSpacingMessage)(requirement, previousAxleUnitNumber, axleUnitNumber);
1290
1235
  return {
1291
1236
  id: policyId,
1292
1237
  message,
@@ -1297,6 +1242,37 @@ function CheckLegalInteraxleSpacing(_policy, _vehicleConfiguration, axleConfigur
1297
1242
  };
1298
1243
  });
1299
1244
  }
1245
+ /**
1246
+ * Validates each axle unit against its legal axle spread maximum.
1247
+ */
1248
+ function CheckLegalAxleSpread(policy, vehicleConfiguration, axleConfiguration) {
1249
+ const policyId = enum_1.PolicyCheckId.LegalAxleSpread;
1250
+ const axleUnitVehicleIndexes = getAxleUnitVehicleIndexLookup(policy, vehicleConfiguration, axleConfiguration);
1251
+ return axleConfiguration.flatMap((axleUnit, axleIndex) => {
1252
+ const threshold = (0, axle_spread_helper_1.getAxleSpreadThreshold)(vehicleConfiguration, axleUnitVehicleIndexes, axleConfiguration, axleIndex);
1253
+ if (!axleUnit.axleSpread ||
1254
+ !threshold ||
1255
+ !Number.isFinite(axleUnit.axleSpread)) {
1256
+ return [];
1257
+ }
1258
+ const result = axleUnit.axleSpread >= threshold.minCm &&
1259
+ axleUnit.axleSpread <= threshold.maxCm;
1260
+ const axleUnitNumber = axleIndex + 1;
1261
+ const message = result
1262
+ ? ''
1263
+ : `Axle Spread for Axle Unit ${axleUnitNumber} must be between ${(0, format_meters_helper_1.formatMeters)(threshold.minCm)} m and ${(0, format_meters_helper_1.formatMeters)(threshold.maxCm)} m.`;
1264
+ return [
1265
+ {
1266
+ id: policyId,
1267
+ result: result
1268
+ ? enum_1.PolicyCheckResultType.Pass
1269
+ : enum_1.PolicyCheckResultType.Fail,
1270
+ message,
1271
+ axleUnit: axleUnitNumber,
1272
+ },
1273
+ ];
1274
+ });
1275
+ }
1300
1276
  /**
1301
1277
  * Map of policy check functions keyed by their corresponding PolicyCheckId.
1302
1278
  *
@@ -1309,6 +1285,7 @@ function CheckLegalInteraxleSpacing(_policy, _vehicleConfiguration, axleConfigur
1309
1285
  * - AxleGroupMaximumLegalWeightThreshold: Validates axle groups within 8 m against CTR 7.17
1310
1286
  * - BridgeFormula: Validates axle groups against bridge formula requirements
1311
1287
  * - CheckLegalWeight: Validates axle units against legal weight limits
1288
+ * - CheckLegalAxleSpread: Validates axle units against legal axle spread limits
1312
1289
  * - CheckPermittableWeight: Validates total vehicle weight against permit limits
1313
1290
  * - MaxTireLoad: Validates tire load capacity for each axle unit
1314
1291
  * - MinDriveAxleWeight: Validates minimum weight requirements for drive axles
@@ -1333,6 +1310,7 @@ exports.policyCheckMap = new Map([
1333
1310
  enum_1.PolicyCheckId.AxleGroupMaximumLegalWeightThreshold,
1334
1311
  CheckAxleGroupMaximumLegalWeightThreshold,
1335
1312
  ],
1313
+ [enum_1.PolicyCheckId.LegalAxleSpread, CheckLegalAxleSpread],
1336
1314
  [enum_1.PolicyCheckId.LegalWeight, CheckLegalWeight],
1337
1315
  [enum_1.PolicyCheckId.PermittableWeight, CheckPermittableWeight],
1338
1316
  [enum_1.PolicyCheckId.MaxTireLoad, CheckMaxTireLoad],
@@ -0,0 +1,6 @@
1
+ export declare const AXLE_UNIT_TYPES: {
2
+ readonly SINGLE: 'SINGLE';
3
+ readonly TANDEM: 'TANDEM';
4
+ readonly TRIDEM: 'TRIDEM';
5
+ };
6
+ export type AxleUnitType = (typeof AXLE_UNIT_TYPES)[keyof typeof AXLE_UNIT_TYPES];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AXLE_UNIT_TYPES = void 0;
4
+ exports.AXLE_UNIT_TYPES = {
5
+ SINGLE: 'SINGLE',
6
+ TANDEM: 'TANDEM',
7
+ TRIDEM: 'TRIDEM',
8
+ };
@@ -0,0 +1,5 @@
1
+ export interface InteraxleSpacingRequirement {
2
+ min?: number;
3
+ max?: number;
4
+ groupLabel?: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v2.26.0";
1
+ export declare const version = "v2.27.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.26.0';
5
+ exports.version = 'v2.27.0';
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  ],
92
92
  "testEnvironment": "node"
93
93
  },
94
- "version": "v2.26.0"
94
+ "version": "v2.27.0"
95
95
  }