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.lcv) {
78
+ !policy.specialAuthorizations.isLcvAllowed) {
79
79
  allowedVehicles =
80
80
  policy.filterOutLongCombinationVehicles(allowedVehicles);
81
81
  }
@@ -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.lcv) {
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.clientNumber}'`));
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.lcv)) {
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.lcv)) {
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 || !this.specialAuthorizations.lcv) {
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) {
@@ -1,5 +1,5 @@
1
1
  export type SpecialAuthorizations = {
2
- clientNumber: string;
3
- lcv?: boolean;
4
- noFee?: boolean;
2
+ companyId: number;
3
+ isLcvAllowed?: boolean;
4
+ noFeeType?: string;
5
5
  };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v1.1.0";
1
+ export declare const version = "v1.2.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 = 'v1.1.0';
5
+ exports.version = 'v1.2.0';
package/package.json CHANGED
@@ -89,5 +89,5 @@
89
89
  ],
90
90
  "testEnvironment": "node"
91
91
  },
92
- "version": "v1.1.0"
92
+ "version": "v1.2.0"
93
93
  }