onroute-policy-engine 1.1.0 → 1.2.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.
|
@@ -75,7 +75,7 @@ function addRuntimeFacts(engine, policy) {
|
|
|
75
75
|
allowedVehicles = permitType.allowedVehicles;
|
|
76
76
|
// Filter out long combination vehcles if necessary
|
|
77
77
|
if (!policy.specialAuthorizations ||
|
|
78
|
-
!policy.specialAuthorizations.
|
|
78
|
+
!policy.specialAuthorizations.isLcvAllowed) {
|
|
79
79
|
allowedVehicles =
|
|
80
80
|
policy.filterOutLongCombinationVehicles(allowedVehicles);
|
|
81
81
|
}
|
package/dist/policy-engine.js
CHANGED
|
@@ -73,8 +73,8 @@ class Policy {
|
|
|
73
73
|
// Wrap the json-rules-engine result in a ValidationResult object
|
|
74
74
|
const validationResults = new validation_results_1.ValidationResults(engineResult);
|
|
75
75
|
// Include an informational message if the client is an LCV carrier
|
|
76
|
-
if ((_a = this.specialAuthorizations) === null || _a === void 0 ? void 0 : _a.
|
|
77
|
-
validationResults.information.push(new validation_result_1.ValidationResult(enum_1.ValidationResultType.Information, enum_1.ValidationResultCode.IsLcvCarrier, `Policy validation allowing long combination vahicle permitting for client '${this.specialAuthorizations.
|
|
76
|
+
if ((_a = this.specialAuthorizations) === null || _a === void 0 ? void 0 : _a.isLcvAllowed) {
|
|
77
|
+
validationResults.information.push(new validation_result_1.ValidationResult(enum_1.ValidationResultType.Information, enum_1.ValidationResultCode.IsLcvCarrier, `Policy validation allowing long combination vahicle permitting for client '${this.specialAuthorizations.companyId}'`));
|
|
78
78
|
}
|
|
79
79
|
return validationResults;
|
|
80
80
|
}
|
|
@@ -206,7 +206,7 @@ class Policy {
|
|
|
206
206
|
let puTypeIdsOW = [];
|
|
207
207
|
let trTypeIdsOW = [];
|
|
208
208
|
// Remove long combination vehicles if needed
|
|
209
|
-
if (!((_e = this.specialAuthorizations) === null || _e === void 0 ? void 0 : _e.
|
|
209
|
+
if (!((_e = this.specialAuthorizations) === null || _e === void 0 ? void 0 : _e.isLcvAllowed)) {
|
|
210
210
|
if (puTypeIdsOS) {
|
|
211
211
|
puTypeIdsOS = this.filterOutLongCombinationVehicles(puTypeIdsOS);
|
|
212
212
|
}
|
|
@@ -346,7 +346,7 @@ class Policy {
|
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
// Remove long combination vehicles if required
|
|
349
|
-
if (!((_e = this.specialAuthorizations) === null || _e === void 0 ? void 0 : _e.
|
|
349
|
+
if (!((_e = this.specialAuthorizations) === null || _e === void 0 ? void 0 : _e.isLcvAllowed)) {
|
|
350
350
|
if (vehicleTypeIds) {
|
|
351
351
|
vehicleTypeIds = this.filterOutLongCombinationVehicles(vehicleTypeIds);
|
|
352
352
|
}
|
|
@@ -393,7 +393,8 @@ class Policy {
|
|
|
393
393
|
// invalid as a complete configuration.
|
|
394
394
|
return validatePartial;
|
|
395
395
|
}
|
|
396
|
-
if (!this.specialAuthorizations ||
|
|
396
|
+
if (!this.specialAuthorizations ||
|
|
397
|
+
!this.specialAuthorizations.isLcvAllowed) {
|
|
397
398
|
// No provision for allowing long combination vehicles
|
|
398
399
|
const filteredConfiguration = this.filterOutLongCombinationVehicles(currentConfiguration);
|
|
399
400
|
if (filteredConfiguration.length !== currentConfiguration.length) {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "v1.
|
|
1
|
+
export declare const version = "v1.2.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED