onroute-policy-engine 2.35.1 → 2.36.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.
- package/dist/helper/interaxle-spacing.helper.d.ts +25 -1
- package/dist/helper/interaxle-spacing.helper.js +79 -31
- package/dist/helper/policy-check.helper.js +4 -4
- package/dist/policy-engine.d.ts +31 -0
- package/dist/policy-engine.js +35 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/interaxle-spacing-requirement.d.ts +14 -3
- package/dist/types/policy-definition.d.ts +3 -0
- package/dist/types/vehicle-category.d.ts +3 -1
- package/dist/types/vehicle-type.d.ts +3 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/constants/interaxle-spacing-legal-minimums.d.ts +0 -17
- package/dist/constants/interaxle-spacing-legal-minimums.js +0 -20
|
@@ -1,4 +1,28 @@
|
|
|
1
|
+
import { Policy } from '../policy-engine';
|
|
1
2
|
import { AxleConfiguration } from '../types/axle-configuration';
|
|
2
3
|
import { InteraxleSpacingRequirement } from '../types/interaxle-spacing-requirement';
|
|
3
4
|
export declare function getFailedInteraxleSpacingMessage(requirement: InteraxleSpacingRequirement, previousAxleUnitNumber: number, currentAxleUnitNumber: number): string;
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the legal interaxle spacing requirement for a given axle pair.
|
|
7
|
+
* Uses the configured policy defaults for the vehicle subtype, falling back to
|
|
8
|
+
* the global default for the matching axle combination when no subtype-specific
|
|
9
|
+
* override exists.
|
|
10
|
+
* @param policy The instantiated policy object with interaxle spacing configuration
|
|
11
|
+
* @param axleConfiguration Full axle configuration for the vehicle combination
|
|
12
|
+
* @param axleIndex Index of the current axle unit being evaluated
|
|
13
|
+
* @param vehicleConfiguration Array of vehicle IDs in sequence for the combination
|
|
14
|
+
* @param axleUnitVehicleIndexes Mapping of each axle unit to its parent vehicle
|
|
15
|
+
* @returns The minimum/maximum interaxle spacing requirement for the current axle pair, or undefined when no spacing rule applies
|
|
16
|
+
*/
|
|
17
|
+
export declare function getInteraxleSpacingRequirement(policy: Policy, axleConfiguration: Array<AxleConfiguration>, axleIndex: number, vehicleConfiguration: Array<string>, axleUnitVehicleIndexes: Array<number>): InteraxleSpacingRequirement | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Helper function for getting the default interaxle spacing value,
|
|
20
|
+
* works for both power units and trailers based on the
|
|
21
|
+
* value of the isPowerUnit flag.
|
|
22
|
+
* @param policy The instantiated policy object with weight config
|
|
23
|
+
* @param subType Power Unit or Trailer subtype
|
|
24
|
+
* @param axles 2-digit numner representing the two axle units to which this requirement applies. The number of with the most significant digit representing the current axle unit and the least significant digit representing the next axle unit.
|
|
25
|
+
* @param isPowerUnit Whether this vehicle is a power unit
|
|
26
|
+
* @returns Array of interaxle spacing specifications
|
|
27
|
+
*/
|
|
28
|
+
export declare function getDefaultInteraxleSpacingHelper(policy: Policy, subType: string, axles: number, isPowerUnit: boolean): InteraxleSpacingRequirement;
|
|
@@ -2,19 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFailedInteraxleSpacingMessage = getFailedInteraxleSpacingMessage;
|
|
4
4
|
exports.getInteraxleSpacingRequirement = getInteraxleSpacingRequirement;
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const axle_unit_type_1 = require("../types/axle-unit-type");
|
|
5
|
+
exports.getDefaultInteraxleSpacingHelper = getDefaultInteraxleSpacingHelper;
|
|
6
|
+
const power_unit_axle_code_multiplier_1 = require("../constants/power-unit-axle-code-multiplier");
|
|
8
7
|
const format_meters_helper_1 = require("./format-meters.helper");
|
|
9
8
|
function getFailedInteraxleSpacingMessage(requirement, previousAxleUnitNumber, currentAxleUnitNumber) {
|
|
10
|
-
if (requirement.groupLabel) {
|
|
11
|
-
if (requirement.min && requirement.max) {
|
|
12
|
-
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.`;
|
|
13
|
-
}
|
|
14
|
-
if (requirement.min) {
|
|
15
|
-
return `Interaxle Spacing for ${requirement.groupLabel} must be at least ${(0, format_meters_helper_1.formatMeters)(requirement.min)} m.`;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
9
|
if (requirement.min && requirement.max) {
|
|
19
10
|
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.`;
|
|
20
11
|
}
|
|
@@ -23,32 +14,89 @@ function getFailedInteraxleSpacingMessage(requirement, previousAxleUnitNumber, c
|
|
|
23
14
|
}
|
|
24
15
|
return '';
|
|
25
16
|
}
|
|
26
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the legal interaxle spacing requirement for a given axle pair.
|
|
19
|
+
* Uses the configured policy defaults for the vehicle subtype, falling back to
|
|
20
|
+
* the global default for the matching axle combination when no subtype-specific
|
|
21
|
+
* override exists.
|
|
22
|
+
* @param policy The instantiated policy object with interaxle spacing configuration
|
|
23
|
+
* @param axleConfiguration Full axle configuration for the vehicle combination
|
|
24
|
+
* @param axleIndex Index of the current axle unit being evaluated
|
|
25
|
+
* @param vehicleConfiguration Array of vehicle IDs in sequence for the combination
|
|
26
|
+
* @param axleUnitVehicleIndexes Mapping of each axle unit to its parent vehicle
|
|
27
|
+
* @returns The minimum/maximum interaxle spacing requirement for the current axle pair, or undefined when no spacing rule applies
|
|
28
|
+
*/
|
|
29
|
+
function getInteraxleSpacingRequirement(policy, axleConfiguration, axleIndex, vehicleConfiguration, axleUnitVehicleIndexes) {
|
|
27
30
|
// the first axle unit will never have an interaxle spacing value or previous axle unit to compare against
|
|
28
31
|
if (axleIndex === 0) {
|
|
29
32
|
return undefined;
|
|
30
33
|
}
|
|
31
|
-
const
|
|
34
|
+
const currentAxleUnit = axleConfiguration[axleIndex];
|
|
32
35
|
const previousAxleUnit = axleConfiguration[axleIndex - 1];
|
|
33
|
-
|
|
36
|
+
const vehicleIndex = axleUnitVehicleIndexes[axleIndex];
|
|
37
|
+
const vehicleType = vehicleConfiguration[vehicleIndex];
|
|
38
|
+
const isPowerUnit = vehicleIndex === 0;
|
|
39
|
+
if (!Number.isFinite(currentAxleUnit.interaxleSpacing) ||
|
|
34
40
|
!Number.isFinite(previousAxleUnit.numberOfAxles)) {
|
|
35
41
|
return undefined;
|
|
36
42
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
const axles = previousAxleUnit.numberOfAxles * power_unit_axle_code_multiplier_1.POWER_UNIT_AXLE_CODE_MULTIPLIER +
|
|
44
|
+
currentAxleUnit.numberOfAxles;
|
|
45
|
+
// NOTE: This intentionally resolves to a single requirement for the current
|
|
46
|
+
// axle pair. This mirrors the current simple lookup pattern, but if modifier-
|
|
47
|
+
// based interaxle spacing rules are introduced later, this should follow the
|
|
48
|
+
// same selection pattern used by CheckLegalWeight via
|
|
49
|
+
// selectCorrectWeightDimensionHelper, which chooses the correct candidate
|
|
50
|
+
// before applying the min/max threshold. We may also eventually start using
|
|
51
|
+
// legalMin/legalMax/permittableMin/permittableMax fields in this contract.
|
|
52
|
+
const requirement = isPowerUnit
|
|
53
|
+
? policy.getDefaultPowerUnitInteraxleSpacing(vehicleType, axles)
|
|
54
|
+
: policy.getDefaultTrailerInteraxleSpacing(vehicleType, axles);
|
|
55
|
+
// Defensive compatibility guard for older callers that may still hand us an
|
|
56
|
+
// array-shaped requirement. The validator expects a single object.
|
|
57
|
+
return Array.isArray(requirement) ? requirement[0] : requirement;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Helper function for getting the default interaxle spacing value,
|
|
61
|
+
* works for both power units and trailers based on the
|
|
62
|
+
* value of the isPowerUnit flag.
|
|
63
|
+
* @param policy The instantiated policy object with weight config
|
|
64
|
+
* @param subType Power Unit or Trailer subtype
|
|
65
|
+
* @param axles 2-digit numner representing the two axle units to which this requirement applies. The number of with the most significant digit representing the current axle unit and the least significant digit representing the next axle unit.
|
|
66
|
+
* @param isPowerUnit Whether this vehicle is a power unit
|
|
67
|
+
* @returns Array of interaxle spacing specifications
|
|
68
|
+
*/
|
|
69
|
+
function getDefaultInteraxleSpacingHelper(policy, subType, axles, isPowerUnit) {
|
|
70
|
+
var _a, _b, _c, _d;
|
|
71
|
+
const vehicleDefinition = isPowerUnit
|
|
72
|
+
? policy.getPowerUnitDefinition(subType)
|
|
73
|
+
: policy.getTrailerDefinition(subType);
|
|
74
|
+
if (!vehicleDefinition) {
|
|
75
|
+
throw new Error(`No definition found for vehicle type '${subType}'`);
|
|
76
|
+
}
|
|
77
|
+
// Prefer specific power unit / trailer subtype interaxle spacing.
|
|
78
|
+
// The config stores these as arrays, but validation expects a single
|
|
79
|
+
// requirement object for the current axle pair.
|
|
80
|
+
const interaxleSpacings = (_a = vehicleDefinition.interaxleSpacings) === null || _a === void 0 ? void 0 : _a.filter((exception) => exception.axles === axles);
|
|
81
|
+
if (interaxleSpacings && interaxleSpacings.length > 0) {
|
|
82
|
+
return JSON.parse(JSON.stringify(interaxleSpacings[0]));
|
|
83
|
+
}
|
|
84
|
+
// Second preference is category interaxle spacing.
|
|
85
|
+
const vehicleCategories = isPowerUnit
|
|
86
|
+
? (_b = policy.policyDefinition.vehicleCategories) === null || _b === void 0 ? void 0 : _b.powerUnitCategories
|
|
87
|
+
: (_c = policy.policyDefinition.vehicleCategories) === null || _c === void 0 ? void 0 : _c.trailerCategories;
|
|
88
|
+
const vehicleCategory = vehicleCategories === null || vehicleCategories === void 0 ? void 0 : vehicleCategories.find((c) => c.id === vehicleDefinition.category);
|
|
89
|
+
if (vehicleCategory) {
|
|
90
|
+
const overridesForAxle = (_d = vehicleCategory.interaxleSpacings) === null || _d === void 0 ? void 0 : _d.filter((override) => override.axles === axles);
|
|
91
|
+
if (overridesForAxle && overridesForAxle.length > 0) {
|
|
92
|
+
return JSON.parse(JSON.stringify(overridesForAxle[0]));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// Least preference is global interaxle defaults.
|
|
96
|
+
const globalDefaults = policy.policyDefinition.globalInteraxleSpacingDefaults;
|
|
97
|
+
const vehicleDefaults = globalDefaults === null || globalDefaults === void 0 ? void 0 : globalDefaults.filter((specification) => specification.axles === axles);
|
|
98
|
+
if (vehicleDefaults && vehicleDefaults.length > 0) {
|
|
99
|
+
return JSON.parse(JSON.stringify(vehicleDefaults[0]));
|
|
100
|
+
}
|
|
101
|
+
return {};
|
|
54
102
|
}
|
|
@@ -1180,24 +1180,24 @@ function CheckLegalInteraxleSpacing(policy, vehicleConfiguration, axleConfigurat
|
|
|
1180
1180
|
const policyId = enum_1.PolicyCheckId.LegalInteraxleSpacing;
|
|
1181
1181
|
const axleUnitVehicleIndexes = (0, dimensions_helper_1.getAxleUnitVehicleIndexLookup)(policy, vehicleConfiguration, axleConfiguration);
|
|
1182
1182
|
return axleConfiguration.map((axleUnit, axleIndex) => {
|
|
1183
|
-
const requirement = (0, interaxle_spacing_helper_1.getInteraxleSpacingRequirement)(axleConfiguration, axleIndex, vehicleConfiguration, axleUnitVehicleIndexes);
|
|
1183
|
+
const requirement = (0, interaxle_spacing_helper_1.getInteraxleSpacingRequirement)(policy, axleConfiguration, axleIndex, vehicleConfiguration, axleUnitVehicleIndexes);
|
|
1184
1184
|
// Pass when no requirement exists, interaxle spacing is missing, or interaxle spacing falls within the requirement's min/max bounds.
|
|
1185
1185
|
const shouldPass = !requirement ||
|
|
1186
1186
|
!axleUnit.interaxleSpacing ||
|
|
1187
1187
|
((!requirement.min || axleUnit.interaxleSpacing >= requirement.min) &&
|
|
1188
1188
|
(!requirement.max || axleUnit.interaxleSpacing <= requirement.max));
|
|
1189
|
-
const
|
|
1189
|
+
const currentAxleUnitNumber = axleIndex + 1;
|
|
1190
1190
|
const previousAxleUnitNumber = axleIndex;
|
|
1191
1191
|
const message = shouldPass
|
|
1192
1192
|
? ''
|
|
1193
|
-
: (0, interaxle_spacing_helper_1.getFailedInteraxleSpacingMessage)(requirement, previousAxleUnitNumber,
|
|
1193
|
+
: (0, interaxle_spacing_helper_1.getFailedInteraxleSpacingMessage)(requirement, previousAxleUnitNumber, currentAxleUnitNumber);
|
|
1194
1194
|
return {
|
|
1195
1195
|
id: policyId,
|
|
1196
1196
|
message,
|
|
1197
1197
|
result: shouldPass
|
|
1198
1198
|
? enum_1.PolicyCheckResultType.Pass
|
|
1199
1199
|
: enum_1.PolicyCheckResultType.Fail,
|
|
1200
|
-
axleUnit:
|
|
1200
|
+
axleUnit: currentAxleUnitNumber,
|
|
1201
1201
|
};
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
package/dist/policy-engine.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { PolicyDefinition, PermitType, Commodity, VehicleType, SizeDimension, Ax
|
|
|
2
2
|
import { Engine } from 'json-rules-engine';
|
|
3
3
|
import { ValidationResults } from './validation-results';
|
|
4
4
|
import { SpecialAuthorizations } from './types/special-authorizations';
|
|
5
|
+
import { InteraxleSpacingRequirement } from './types/interaxle-spacing-requirement';
|
|
5
6
|
/** Class representing commercial vehicle policy. */
|
|
6
7
|
export declare class Policy {
|
|
7
8
|
/** Object representation of policy definition and rules. */
|
|
@@ -259,6 +260,36 @@ export declare class Policy {
|
|
|
259
260
|
* if the number of axles is not configured in policy.
|
|
260
261
|
*/
|
|
261
262
|
getDefaultPowerUnitWeight(subType: string, axles: number): Array<PowerUnitWeightDimension>;
|
|
263
|
+
/**
|
|
264
|
+
* Gets the default legal and permittable weights for a
|
|
265
|
+
* given power unit type and number of axles. The number of
|
|
266
|
+
* axles is supplied as a 2-digit number, with the most
|
|
267
|
+
* significant digit representing the current (steer) axle unit and the
|
|
268
|
+
* least significant digit representing the next (drive) axle unit.
|
|
269
|
+
* @param subType Power unit subtype
|
|
270
|
+
* @param axles Number of axles in the power unit axle units
|
|
271
|
+
* @returns Array of power unit weights. Multiple power unit
|
|
272
|
+
* weights may be returned if there are different weights
|
|
273
|
+
* depending on prior / subsequent vehicles in the
|
|
274
|
+
* configuration (weight modifiers). Will return an empty array
|
|
275
|
+
* if the number of axles is not configured in policy.
|
|
276
|
+
*/
|
|
277
|
+
getDefaultPowerUnitInteraxleSpacing(subType: string, axles: number): InteraxleSpacingRequirement;
|
|
278
|
+
/**
|
|
279
|
+
* Gets the default legal and permittable weights for a
|
|
280
|
+
* given trailer type and number of axles. The number of
|
|
281
|
+
* axles is supplied as a 2-digit number, with the most
|
|
282
|
+
* significant digit representing the current axle unit and the
|
|
283
|
+
* least significant digit representing the next axle unit.
|
|
284
|
+
* @param subType Trailer subtype
|
|
285
|
+
* @param axles Number of axles in the trailer axle units
|
|
286
|
+
* @returns Array of trailer weights. Multiple trailer
|
|
287
|
+
* weights may be returned if there are different weights
|
|
288
|
+
* depending on prior / subsequent vehicles in the
|
|
289
|
+
* configuration (weight modifiers). Will return an empty array
|
|
290
|
+
* if the number of axles is not configured in policy.
|
|
291
|
+
*/
|
|
292
|
+
getDefaultTrailerInteraxleSpacing(subType: string, axles: number): InteraxleSpacingRequirement;
|
|
262
293
|
/**
|
|
263
294
|
* Given a list of default weight dimensions and a vehicle
|
|
264
295
|
* configuration, select the correct weight dimensions for
|
package/dist/policy-engine.js
CHANGED
|
@@ -24,6 +24,7 @@ const policy_check_helper_1 = require("./helper/policy-check.helper");
|
|
|
24
24
|
const cost_1 = require("./constants/cost");
|
|
25
25
|
const overload_helper_1 = require("./helper/overload.helper");
|
|
26
26
|
const permit_codes_1 = require("./constants/permit-codes");
|
|
27
|
+
const interaxle_spacing_helper_1 = require("./helper/interaxle-spacing.helper");
|
|
27
28
|
/** Class representing commercial vehicle policy. */
|
|
28
29
|
class Policy {
|
|
29
30
|
/**
|
|
@@ -818,6 +819,40 @@ class Policy {
|
|
|
818
819
|
getDefaultPowerUnitWeight(subType, axles) {
|
|
819
820
|
return (0, dimensions_helper_2.getDefaultPowerUnitWeightHelper)(this, subType, axles);
|
|
820
821
|
}
|
|
822
|
+
/**
|
|
823
|
+
* Gets the default legal and permittable weights for a
|
|
824
|
+
* given power unit type and number of axles. The number of
|
|
825
|
+
* axles is supplied as a 2-digit number, with the most
|
|
826
|
+
* significant digit representing the current (steer) axle unit and the
|
|
827
|
+
* least significant digit representing the next (drive) axle unit.
|
|
828
|
+
* @param subType Power unit subtype
|
|
829
|
+
* @param axles Number of axles in the power unit axle units
|
|
830
|
+
* @returns Array of power unit weights. Multiple power unit
|
|
831
|
+
* weights may be returned if there are different weights
|
|
832
|
+
* depending on prior / subsequent vehicles in the
|
|
833
|
+
* configuration (weight modifiers). Will return an empty array
|
|
834
|
+
* if the number of axles is not configured in policy.
|
|
835
|
+
*/
|
|
836
|
+
getDefaultPowerUnitInteraxleSpacing(subType, axles) {
|
|
837
|
+
return (0, interaxle_spacing_helper_1.getDefaultInteraxleSpacingHelper)(this, subType, axles, true);
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Gets the default legal and permittable weights for a
|
|
841
|
+
* given trailer type and number of axles. The number of
|
|
842
|
+
* axles is supplied as a 2-digit number, with the most
|
|
843
|
+
* significant digit representing the current axle unit and the
|
|
844
|
+
* least significant digit representing the next axle unit.
|
|
845
|
+
* @param subType Trailer subtype
|
|
846
|
+
* @param axles Number of axles in the trailer axle units
|
|
847
|
+
* @returns Array of trailer weights. Multiple trailer
|
|
848
|
+
* weights may be returned if there are different weights
|
|
849
|
+
* depending on prior / subsequent vehicles in the
|
|
850
|
+
* configuration (weight modifiers). Will return an empty array
|
|
851
|
+
* if the number of axles is not configured in policy.
|
|
852
|
+
*/
|
|
853
|
+
getDefaultTrailerInteraxleSpacing(subType, axles) {
|
|
854
|
+
return (0, interaxle_spacing_helper_1.getDefaultInteraxleSpacingHelper)(this, subType, axles, false);
|
|
855
|
+
}
|
|
821
856
|
/**
|
|
822
857
|
* Given a list of default weight dimensions and a vehicle
|
|
823
858
|
* configuration, select the correct weight dimensions for
|
package/dist/types/index.d.ts
CHANGED
|
@@ -23,3 +23,4 @@ export type { VehicleCategory, PowerUnitCategory, TrailerCategory, VehicleCatego
|
|
|
23
23
|
export type { VehicleType, PowerUnitType, TrailerType, VehicleTypes, } from './vehicle-type';
|
|
24
24
|
export type { TrailerDimensions, Vehicle, VehicleDimensions } from './vehicle';
|
|
25
25
|
export type { WeightDimension, PowerUnitWeightDimension, TrailerWeightDimension, DefaultWeightDimensions, SingleAxleDimension, } from './weight-dimension';
|
|
26
|
+
export type { InteraxleSpacingRequirement } from './interaxle-spacing-requirement';
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { DimensionModifier } from './dimension-modifier';
|
|
2
|
+
import { SelfIssuable } from './self-issuable';
|
|
3
|
+
/**
|
|
4
|
+
* Base interaxle spacing requirement with axle count and modifier
|
|
5
|
+
* Extends SelfIssuable to include self-issuance capability
|
|
6
|
+
*/
|
|
7
|
+
export type InteraxleSpacingRequirement = SelfIssuable & {
|
|
8
|
+
/** Number of axles applicable to this requirement */
|
|
9
|
+
axles: number;
|
|
10
|
+
/** The minimum interaxle spacing value (optional) */
|
|
2
11
|
min?: number;
|
|
12
|
+
/** The maximum interaxle spacing value (optional) */
|
|
3
13
|
max?: number;
|
|
4
|
-
|
|
5
|
-
|
|
14
|
+
/** Dimension modifier for special configurations (optional) */
|
|
15
|
+
modifier?: DimensionModifier;
|
|
16
|
+
};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { GeographicRegion, PermitType, DefaultWeightDimensions, VehicleTypes, Commodity, SizeDimension, VehicleCategories, RangeMatrix, BridgeCalculationConstants, PermitConditionDefinition, StandardTireSize, VehicleDisplayCodeDefaults } from 'onroute-policy-engine/types';
|
|
9
9
|
import { RuleProperties } from 'json-rules-engine';
|
|
10
|
+
import { InteraxleSpacingRequirement } from './interaxle-spacing-requirement';
|
|
10
11
|
/**
|
|
11
12
|
* Complete policy definition containing all configuration data for the policy engine
|
|
12
13
|
*/
|
|
@@ -23,6 +24,8 @@ export type PolicyDefinition = {
|
|
|
23
24
|
globalWeightDefaults: DefaultWeightDimensions;
|
|
24
25
|
/** Global default size dimensions for vehicles */
|
|
25
26
|
globalSizeDefaults: SizeDimension;
|
|
27
|
+
/** Global default interaxle spacing values for vehicles */
|
|
28
|
+
globalInteraxleSpacingDefaults: InteraxleSpacingRequirement[];
|
|
26
29
|
/** Vehicle categories configuration */
|
|
27
30
|
vehicleCategories: VehicleCategories;
|
|
28
31
|
/** Vehicle types configuration */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines the structure for vehicle categories including power units and trailers.
|
|
5
5
|
* Extends IdentifiedObject with size and weight dimension defaults.
|
|
6
6
|
*/
|
|
7
|
-
import { IdentifiedObject, SizeDimension, PowerUnitWeightDimension, TrailerWeightDimension, WeightDimension } from 'onroute-policy-engine/types';
|
|
7
|
+
import { IdentifiedObject, SizeDimension, PowerUnitWeightDimension, TrailerWeightDimension, WeightDimension, InteraxleSpacingRequirement } from 'onroute-policy-engine/types';
|
|
8
8
|
/**
|
|
9
9
|
* Base vehicle category with identification and default dimensions
|
|
10
10
|
* Extends IdentifiedObject with dimension defaults
|
|
@@ -14,6 +14,8 @@ export type VehicleCategory = IdentifiedObject & {
|
|
|
14
14
|
defaultSizeDimensions?: SizeDimension;
|
|
15
15
|
/** Default weight dimensions for this vehicle category (optional) */
|
|
16
16
|
defaultWeightDimensions?: Array<WeightDimension>;
|
|
17
|
+
/** Interaxle spacing values for this vehicle category (optional) */
|
|
18
|
+
interaxleSpacings?: Array<InteraxleSpacingRequirement>;
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
19
21
|
* Power unit category with power unit specific weight dimensions
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines the structure for vehicle types including power units and trailers.
|
|
5
5
|
* Extends IdentifiedObject with category, dimensions, and special configurations.
|
|
6
6
|
*/
|
|
7
|
-
import { ConditionRequirement, IdentifiedObject, SizeDimension, PowerUnitWeightDimension, TrailerWeightDimension } from 'onroute-policy-engine/types';
|
|
7
|
+
import { ConditionRequirement, IdentifiedObject, SizeDimension, PowerUnitWeightDimension, TrailerWeightDimension, InteraxleSpacingRequirement } from 'onroute-policy-engine/types';
|
|
8
8
|
/**
|
|
9
9
|
* Base vehicle type with identification and configuration options
|
|
10
10
|
* Extends IdentifiedObject with vehicle-specific properties
|
|
@@ -24,6 +24,8 @@ export type VehicleType = IdentifiedObject & {
|
|
|
24
24
|
conditions?: Array<ConditionRequirement>;
|
|
25
25
|
/** Additional axle subtype identifier (optional) */
|
|
26
26
|
additionalAxleSubType?: string;
|
|
27
|
+
/** Specfic interaxle spacing values for this vehicle type (optional) */
|
|
28
|
+
interaxleSpacings?: InteraxleSpacingRequirement[];
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
31
|
* Power unit type with power unit specific configurations
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "v2.
|
|
1
|
+
export declare const version = "v2.36.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
};
|