onroute-policy-engine 2.1.1 → 2.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.
- package/.github/workflows/pipeline.yml +25 -6
- package/dist/enum/custom-operator.d.ts +6 -0
- package/dist/enum/custom-operator.js +10 -0
- package/dist/enum/facts.d.ts +8 -4
- package/dist/enum/facts.js +8 -4
- package/dist/enum/index.d.ts +2 -0
- package/dist/enum/index.js +6 -1
- package/dist/enum/permit-app-info.d.ts +8 -5
- package/dist/enum/permit-app-info.js +8 -5
- package/dist/enum/policy-check.d.ts +11 -0
- package/dist/enum/policy-check.js +16 -0
- package/dist/enum/validation-result-code.d.ts +1 -0
- package/dist/enum/validation-result-code.js +1 -0
- package/dist/helper/dimensions.helper.js +7 -3
- package/dist/helper/facts.helper.js +64 -0
- package/dist/helper/policy-check.helper.d.ts +183 -0
- package/dist/helper/policy-check.helper.js +337 -0
- package/dist/helper/vehicles.helper.d.ts +45 -1
- package/dist/helper/vehicles.helper.js +61 -0
- package/dist/policy-engine.d.ts +70 -1
- package/dist/policy-engine.js +78 -0
- package/dist/rule-operator/custom-operators.d.ts +7 -0
- package/dist/rule-operator/custom-operators.js +57 -3
- package/dist/types/axle-calculation-results.d.ts +49 -0
- package/dist/types/axle-calculation-results.js +8 -0
- package/dist/types/axle-configuration.d.ts +12 -0
- package/dist/types/axle-configuration.js +6 -0
- package/dist/types/bridge-calculation-constants.d.ts +8 -0
- package/dist/types/bridge-calculation-result.d.ts +11 -0
- package/dist/types/commodity.d.ts +10 -0
- package/dist/types/commodity.js +6 -0
- package/dist/types/cost-rule.d.ts +8 -0
- package/dist/types/cost-rule.js +6 -0
- package/dist/types/dimension-modifier.d.ts +27 -0
- package/dist/types/dimension-modifier.js +6 -0
- package/dist/types/display-code-defaults.d.ts +22 -0
- package/dist/types/display-code-defaults.js +6 -0
- package/dist/types/facts.d.ts +14 -0
- package/dist/types/facts.js +6 -0
- package/dist/types/geographic-region.d.ts +10 -0
- package/dist/types/geographic-region.js +6 -0
- package/dist/types/identified-object.d.ts +8 -0
- package/dist/types/identified-object.js +6 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/permit-application.d.ts +109 -0
- package/dist/types/permit-application.js +6 -0
- package/dist/types/permit-condition.d.ts +18 -0
- package/dist/types/permit-condition.js +6 -0
- package/dist/types/permit-type.d.ts +18 -0
- package/dist/types/permit-type.js +6 -0
- package/dist/types/policy-definition.d.ts +24 -0
- package/dist/types/policy-definition.js +7 -0
- package/dist/types/range-matrix.d.ts +17 -0
- package/dist/types/range-matrix.js +6 -0
- package/dist/types/region-size-override.d.ts +10 -0
- package/dist/types/region-size-override.js +6 -0
- package/dist/types/self-issuable.d.ts +7 -0
- package/dist/types/self-issuable.js +6 -0
- package/dist/types/size-dimension.d.ts +17 -0
- package/dist/types/size-dimension.js +6 -0
- package/dist/types/special-authorizations.d.ts +9 -0
- package/dist/types/special-authorizations.js +6 -0
- package/dist/types/standard-tire-size.d.ts +8 -0
- package/dist/types/standard-tire-size.js +6 -0
- package/dist/types/vehicle-category.d.ts +27 -0
- package/dist/types/vehicle-category.js +6 -0
- package/dist/types/vehicle-type.d.ts +36 -0
- package/dist/types/vehicle-type.js +6 -0
- package/dist/types/vehicle.d.ts +27 -0
- package/dist/types/vehicle.js +6 -0
- package/dist/types/weight-dimension.d.ts +34 -0
- package/dist/types/weight-dimension.js +6 -0
- package/dist/validation-result.d.ts +1 -0
- package/dist/validation-results.js +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Custom Operators for JSON Rules Engine
|
|
4
|
+
*
|
|
5
|
+
* This module defines custom operators that extend the functionality of the json-rules-engine
|
|
6
|
+
* library. These operators provide specialized validation and comparison logic for the
|
|
7
|
+
* onRouteBC policy engine.
|
|
8
|
+
*/
|
|
2
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
11
|
};
|
|
@@ -7,23 +14,70 @@ exports.CustomOperators = void 0;
|
|
|
7
14
|
const json_rules_engine_1 = require("json-rules-engine");
|
|
8
15
|
const enum_1 = require("onroute-policy-engine/enum");
|
|
9
16
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
17
|
+
/**
|
|
18
|
+
* Validates that the input is a string type
|
|
19
|
+
* @param a - The value to validate
|
|
20
|
+
* @returns True if the value is a string, false otherwise
|
|
21
|
+
*/
|
|
10
22
|
function stringValidator(a) {
|
|
11
23
|
return typeof a === 'string';
|
|
12
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Validates that the input is a valid date string in the permit application format
|
|
27
|
+
* @param a - The date string to validate
|
|
28
|
+
* @returns True if the date string is valid, false otherwise
|
|
29
|
+
*/
|
|
13
30
|
function dateStringValidator(a) {
|
|
14
31
|
const d = (0, dayjs_1.default)(a, enum_1.PermitAppInfo.PermitDateFormat.toString());
|
|
15
32
|
return d.isValid();
|
|
16
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Validates that the input is an array
|
|
36
|
+
* @param a - The value to validate
|
|
37
|
+
* @returns True if the value is an array, false otherwise
|
|
38
|
+
*/
|
|
39
|
+
function arrayValidator(a) {
|
|
40
|
+
return Array.isArray(a);
|
|
41
|
+
}
|
|
42
|
+
// Array to store all custom operators
|
|
17
43
|
const CustomOperators = [];
|
|
18
44
|
exports.CustomOperators = CustomOperators;
|
|
19
|
-
|
|
45
|
+
/**
|
|
46
|
+
* String Minimum Length Operator
|
|
47
|
+
*
|
|
48
|
+
* Checks if a string has a minimum length after trimming whitespace.
|
|
49
|
+
* Returns false if the input is falsy (null, undefined, empty string).
|
|
50
|
+
*/
|
|
51
|
+
CustomOperators.push(new json_rules_engine_1.Operator(enum_1.CustomOperator.StringMinimumLength, (a, b) => {
|
|
52
|
+
// Return false for falsy values
|
|
20
53
|
if (!a)
|
|
21
54
|
return false;
|
|
55
|
+
// Check if trimmed string length meets minimum requirement
|
|
22
56
|
return a.trim().length >= b;
|
|
23
57
|
}, stringValidator));
|
|
24
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Date Less Than Operator
|
|
60
|
+
*
|
|
61
|
+
* Compares two date strings in permit application format.
|
|
62
|
+
* Returns true if the first date is before the second date.
|
|
63
|
+
*/
|
|
64
|
+
CustomOperators.push(new json_rules_engine_1.Operator(enum_1.CustomOperator.DateLessThan, (a, b) => {
|
|
65
|
+
// Parse both dates using the permit application date format
|
|
25
66
|
const firstDate = (0, dayjs_1.default)(a, enum_1.PermitAppInfo.PermitDateFormat.toString());
|
|
26
67
|
const secondDate = (0, dayjs_1.default)(b, enum_1.PermitAppInfo.PermitDateFormat.toString());
|
|
68
|
+
// Return true if first date is before second date (difference is negative)
|
|
27
69
|
return firstDate.diff(secondDate) < 0;
|
|
28
70
|
}, dateStringValidator));
|
|
29
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Regular Expression Operator
|
|
73
|
+
*
|
|
74
|
+
* Tests if a string matches a regular expression pattern.
|
|
75
|
+
* Uses RegExp.exec() to check for matches.
|
|
76
|
+
*/
|
|
77
|
+
CustomOperators.push(new json_rules_engine_1.Operator(enum_1.CustomOperator.Regex, (a, b) => RegExp(b).exec(a) !== null, stringValidator));
|
|
78
|
+
/**
|
|
79
|
+
* Is Empty Array Operator
|
|
80
|
+
*
|
|
81
|
+
* Checks if an array is empty (has length 0).
|
|
82
|
+
*/
|
|
83
|
+
CustomOperators.push(new json_rules_engine_1.Operator(enum_1.CustomOperator.IsEmptyArray, (arr) => arr.length === 0, arrayValidator));
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Axle Calculation Results Types
|
|
3
|
+
*
|
|
4
|
+
* These types define the structure for axle calculation results and policy check outcomes.
|
|
5
|
+
* Used for validating vehicle configurations against weight and axle requirements.
|
|
6
|
+
*/
|
|
7
|
+
import { PolicyCheckResultType } from 'onroute-policy-engine/enum';
|
|
8
|
+
/**
|
|
9
|
+
* Complete results from axle calculations including all policy checks and total overload
|
|
10
|
+
*/
|
|
11
|
+
export type AxleCalcResults = {
|
|
12
|
+
/** Array of individual policy check results */
|
|
13
|
+
results: Array<PolicyCheckResult>;
|
|
14
|
+
/** Total weight overload across all axles in kilograms */
|
|
15
|
+
totalOverload: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Individual policy check result for a specific validation rule
|
|
19
|
+
*/
|
|
20
|
+
export type PolicyCheckResult = {
|
|
21
|
+
/** Actual weight measured/calculated in kilograms */
|
|
22
|
+
actualWeight?: number;
|
|
23
|
+
/** Maximum allowed weight threshold in kilograms */
|
|
24
|
+
thresholdWeight?: number;
|
|
25
|
+
/** Unique identifier for the policy check */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Result of the policy check (pass/fail) */
|
|
28
|
+
result: PolicyCheckResultType;
|
|
29
|
+
/** Human-readable message describing the check result */
|
|
30
|
+
message: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Policy check result for a single axle unit
|
|
34
|
+
* Extends PolicyCheckResult with axle unit identification
|
|
35
|
+
*/
|
|
36
|
+
export type AxleUnitPolicyCheckResult = PolicyCheckResult & {
|
|
37
|
+
/** The axle unit number being checked */
|
|
38
|
+
axleUnit: number;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Policy check result for a group of axles
|
|
42
|
+
* Extends PolicyCheckResult with axle group range
|
|
43
|
+
*/
|
|
44
|
+
export type AxleGroupPolicyCheckResult = PolicyCheckResult & {
|
|
45
|
+
/** Starting axle unit number in the group */
|
|
46
|
+
startAxleUnit: number;
|
|
47
|
+
/** Ending axle unit number in the group */
|
|
48
|
+
endAxleUnit: number;
|
|
49
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Axle Calculation Results Types
|
|
4
|
+
*
|
|
5
|
+
* These types define the structure for axle calculation results and policy check outcomes.
|
|
6
|
+
* Used for validating vehicle configurations against weight and axle requirements.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Axle Configuration Type
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for individual axle configurations within a vehicle.
|
|
5
|
+
* Used for weight calculations, spacing requirements, and compliance validation.
|
|
6
|
+
*/
|
|
1
7
|
export type AxleConfiguration = {
|
|
8
|
+
/** Number of axles in this configuration (1 for single, 2+ for groups) */
|
|
2
9
|
numberOfAxles: number;
|
|
10
|
+
/** Total spread between first and last axle in centimeters */
|
|
3
11
|
axleSpread?: number;
|
|
12
|
+
/** Spacing from the previous axle unit in centimeters */
|
|
4
13
|
interaxleSpacing?: number;
|
|
14
|
+
/** Weight carried by this axle unit in kilograms */
|
|
5
15
|
axleUnitWeight: number;
|
|
16
|
+
/** Number of tires on this axle unit */
|
|
6
17
|
numberOfTires?: number;
|
|
18
|
+
/** Tire size in inches */
|
|
7
19
|
tireSize?: number;
|
|
8
20
|
};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Axle Configuration Type
|
|
4
|
+
*
|
|
5
|
+
* Defines the structure for individual axle configurations within a vehicle.
|
|
6
|
+
* Used for weight calculations, spacing requirements, and compliance validation.
|
|
7
|
+
*/
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge Calculation Constants Type
|
|
3
|
+
*
|
|
4
|
+
* Defines constants used in bridge formula calculations for determining
|
|
5
|
+
* maximum allowable weights based on axle spacing and configuration.
|
|
6
|
+
*/
|
|
1
7
|
export type BridgeCalculationConstants = {
|
|
8
|
+
/** Multiplier factor for bridge formula calculations */
|
|
2
9
|
multiplier: number;
|
|
10
|
+
/** Minimum weight threshold in kilograms */
|
|
3
11
|
minWeight: number;
|
|
4
12
|
};
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge Calculation Result Type
|
|
3
|
+
*
|
|
4
|
+
* Defines the result structure for bridge formula calculations.
|
|
5
|
+
* Used to determine if a vehicle configuration meets bridge weight requirements.
|
|
6
|
+
*/
|
|
1
7
|
export type BridgeCalculationResult = {
|
|
8
|
+
/** Starting axle unit number in the calculation */
|
|
2
9
|
startAxleUnit: number;
|
|
10
|
+
/** Ending axle unit number in the calculation */
|
|
3
11
|
endAxleUnit: number;
|
|
12
|
+
/** Maximum allowable weight according to bridge formula in kilograms */
|
|
4
13
|
maxBridge: number;
|
|
14
|
+
/** Actual weight being carried in kilograms */
|
|
5
15
|
actualWeight: number;
|
|
16
|
+
/** Whether the configuration passes bridge formula requirements */
|
|
6
17
|
success: boolean;
|
|
7
18
|
};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commodity Type
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for permitted commodities that can be transported.
|
|
5
|
+
* Extends IdentifiedObject with vehicle dimension requirements.
|
|
6
|
+
*/
|
|
1
7
|
import { IdentifiedObject, VehicleDimensions } from 'onroute-policy-engine/types';
|
|
8
|
+
/**
|
|
9
|
+
* A permitted commodity that can be transported with specific vehicle requirements
|
|
10
|
+
*/
|
|
2
11
|
export type Commodity = IdentifiedObject & {
|
|
12
|
+
/** Array of power unit dimensions required for this commodity */
|
|
3
13
|
powerUnits: Array<VehicleDimensions>;
|
|
4
14
|
};
|
package/dist/types/commodity.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cost Rule Type
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for cost calculation rules used in permit pricing.
|
|
5
|
+
* Maps facts to parameters for dynamic cost calculations.
|
|
6
|
+
*/
|
|
1
7
|
export type CostRule = {
|
|
8
|
+
/** The fact identifier used in the cost calculation */
|
|
2
9
|
fact: string;
|
|
10
|
+
/** Parameters passed to the cost calculation function */
|
|
3
11
|
params: Record<string, any>;
|
|
4
12
|
};
|
package/dist/types/cost-rule.js
CHANGED
|
@@ -1,19 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dimension Modifier Types
|
|
3
|
+
*
|
|
4
|
+
* Defines structures for modifying vehicle dimensions based on configuration
|
|
5
|
+
* and relationships between vehicle components.
|
|
6
|
+
*/
|
|
1
7
|
import { SelfIssuable } from 'onroute-policy-engine/types';
|
|
8
|
+
/**
|
|
9
|
+
* Modifier for adjusting vehicle dimensions based on configuration
|
|
10
|
+
* Extends SelfIssuable to include self-issuance capability
|
|
11
|
+
*/
|
|
2
12
|
export type DimensionModifier = SelfIssuable & {
|
|
13
|
+
/** Position identifier for the modifier (e.g., 'first', 'last', 'next') */
|
|
3
14
|
position: string;
|
|
15
|
+
/** Type of vehicle component being modified */
|
|
4
16
|
type?: string;
|
|
17
|
+
/** Category of vehicle component being modified */
|
|
5
18
|
category?: string;
|
|
19
|
+
/** Number of axles in the axle unit affected by this modifier */
|
|
6
20
|
axles?: number;
|
|
21
|
+
/** Minimum interaxle spacing in millimeters */
|
|
7
22
|
minInterAxleSpacing?: number;
|
|
23
|
+
/** Maximum interaxle spacing in millimeters */
|
|
8
24
|
maxInterAxleSpacing?: number;
|
|
9
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Defines relationships between vehicle components for dimension calculations
|
|
28
|
+
*/
|
|
10
29
|
export type VehicleRelatives = {
|
|
30
|
+
/** First vehicle type in the configuration */
|
|
11
31
|
firstType: string;
|
|
32
|
+
/** Last vehicle type in the configuration */
|
|
12
33
|
lastType?: string;
|
|
34
|
+
/** Next vehicle type in sequence */
|
|
13
35
|
nextType?: string | null;
|
|
36
|
+
/** Previous vehicle type in sequence */
|
|
14
37
|
prevType?: string | null;
|
|
38
|
+
/** First vehicle category in the configuration */
|
|
15
39
|
firstCategory?: string | null;
|
|
40
|
+
/** Last vehicle category in the configuration */
|
|
16
41
|
lastCategory?: string | null;
|
|
42
|
+
/** Next vehicle category in sequence */
|
|
17
43
|
nextCategory?: string | null;
|
|
44
|
+
/** Previous vehicle category in sequence */
|
|
18
45
|
prevCategory?: string | null;
|
|
19
46
|
};
|
|
@@ -1,18 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vehicle Display Code Defaults Type
|
|
3
|
+
*
|
|
4
|
+
* Defines default values and formatting rules for generating vehicle display codes.
|
|
5
|
+
* Used for creating standardized vehicle identification codes across the system.
|
|
6
|
+
*/
|
|
1
7
|
export type VehicleDisplayCodeDefaults = {
|
|
8
|
+
/** Standard prefix for display codes */
|
|
2
9
|
prefixStandard: string;
|
|
10
|
+
/** Universal prefix for display codes */
|
|
3
11
|
prefixUniversal: string;
|
|
12
|
+
/** Standard padding character for display codes */
|
|
4
13
|
paddingStandard: string;
|
|
14
|
+
/** Universal padding character for display codes */
|
|
5
15
|
paddingUniversal: string;
|
|
16
|
+
/** Default spacing for universal display codes */
|
|
6
17
|
spacingUniversalDefault: string;
|
|
18
|
+
/** Spacing for small universal display codes */
|
|
7
19
|
spacingUniversalSmall: string;
|
|
20
|
+
/** Spacing for large universal display codes */
|
|
8
21
|
spacingUniversalLarge: string;
|
|
22
|
+
/** Maximum threshold for small universal spacing */
|
|
9
23
|
spacingUniversalSmallMax: number;
|
|
24
|
+
/** Minimum threshold for large universal spacing */
|
|
10
25
|
spacingUniversalLargeMin: number;
|
|
26
|
+
/** Code for extra axles in universal format */
|
|
11
27
|
extraAxleUniversal: string;
|
|
28
|
+
/** Code for end axles in universal format */
|
|
12
29
|
endAxleUniversal: string;
|
|
30
|
+
/** Maximum number of axles for standard format */
|
|
13
31
|
maxAxlesStandard: number;
|
|
32
|
+
/** Threshold number of axles for universal format */
|
|
14
33
|
thresholdAxlesUniversal: number;
|
|
34
|
+
/** Code for over-threshold axles in universal format */
|
|
15
35
|
overAxlesCodeUniversal: string;
|
|
36
|
+
/** Universal axle code format */
|
|
16
37
|
universalAxleCode: string;
|
|
38
|
+
/** Prefix for multi-digit axle codes */
|
|
17
39
|
multiDigitPrefix: string;
|
|
18
40
|
};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Vehicle Display Code Defaults Type
|
|
4
|
+
*
|
|
5
|
+
* Defines default values and formatting rules for generating vehicle display codes.
|
|
6
|
+
* Used for creating standardized vehicle identification codes across the system.
|
|
7
|
+
*/
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/types/facts.d.ts
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permit Facts Type
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for permit application facts used in policy validation.
|
|
5
|
+
* Contains essential information about the permit application and vehicle.
|
|
6
|
+
*/
|
|
1
7
|
export type PermitFacts = {
|
|
8
|
+
/** Company name applying for the permit */
|
|
2
9
|
companyName?: string;
|
|
10
|
+
/** Duration of the permit in days */
|
|
3
11
|
duration?: number;
|
|
12
|
+
/** Type of permit being applied for */
|
|
4
13
|
permitType?: string;
|
|
14
|
+
/** Start date of the permit (YYYY-MM-DD format) */
|
|
5
15
|
startDate?: string;
|
|
16
|
+
/** Vehicle Identification Number */
|
|
6
17
|
vehicleIdentificationNumber?: string;
|
|
18
|
+
/** Vehicle license plate number */
|
|
7
19
|
vehiclePlate?: string;
|
|
20
|
+
/** Type of vehicle permitted (primary vehicle) (e.g., 'TRKTRAC') */
|
|
8
21
|
vehicleType?: string;
|
|
22
|
+
/** Additional application data as a generic object */
|
|
9
23
|
app?: object;
|
|
10
24
|
};
|
package/dist/types/facts.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Permit Facts Type
|
|
4
|
+
*
|
|
5
|
+
* Defines the structure for permit application facts used in policy validation.
|
|
6
|
+
* Contains essential information about the permit application and vehicle.
|
|
7
|
+
*/
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geographic Region Type
|
|
3
|
+
*
|
|
4
|
+
* Defines the structure for geographic regions used in permit routing and validation.
|
|
5
|
+
* Extends IdentifiedObject with optional description for enhanced identification.
|
|
6
|
+
*/
|
|
1
7
|
import { IdentifiedObject } from 'onroute-policy-engine/types';
|
|
8
|
+
/**
|
|
9
|
+
* A geographic region with identification and optional description
|
|
10
|
+
*/
|
|
2
11
|
export type GeographicRegion = IdentifiedObject & {
|
|
12
|
+
/** Optional description of the geographic region */
|
|
3
13
|
description?: string;
|
|
4
14
|
};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Geographic Region Type
|
|
4
|
+
*
|
|
5
|
+
* Defines the structure for geographic regions used in permit routing and validation.
|
|
6
|
+
* Extends IdentifiedObject with optional description for enhanced identification.
|
|
7
|
+
*/
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identified Object Type
|
|
3
|
+
*
|
|
4
|
+
* Base type for objects that require unique identification and naming.
|
|
5
|
+
* Used as a foundation for many other types in the system.
|
|
6
|
+
*/
|
|
1
7
|
export type IdentifiedObject = {
|
|
8
|
+
/** Unique identifier for the object */
|
|
2
9
|
id: string;
|
|
10
|
+
/** Human-readable name for the object */
|
|
3
11
|
name: string;
|
|
4
12
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { AxleCalcResults, PolicyCheckResult, AxleUnitPolicyCheckResult, AxleGroupPolicyCheckResult, } from './axle-calculation-results';
|
|
1
2
|
export { AxleConfiguration } from './axle-configuration';
|
|
2
3
|
export { BridgeCalculationConstants } from './bridge-calculation-constants';
|
|
3
4
|
export { BridgeCalculationResult } from './bridge-calculation-result';
|
|
@@ -1,93 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permit Application Types
|
|
3
|
+
*
|
|
4
|
+
* Defines the complete structure for permit applications including contact details,
|
|
5
|
+
* vehicle information, routing, and configuration data.
|
|
6
|
+
*/
|
|
1
7
|
import { AxleConfiguration } from 'onroute-policy-engine/types';
|
|
8
|
+
/**
|
|
9
|
+
* Mailing address for permit correspondence
|
|
10
|
+
*/
|
|
2
11
|
export type PermitMailingAddress = {
|
|
12
|
+
/** Primary address line */
|
|
3
13
|
addressLine1: string;
|
|
14
|
+
/** Secondary address line (optional) */
|
|
4
15
|
addressLine2?: string | null;
|
|
16
|
+
/** City name */
|
|
5
17
|
city: string;
|
|
18
|
+
/** Province/state code (e.g., 'BC', 'AB') */
|
|
6
19
|
provinceCode: string;
|
|
20
|
+
/** Country code (e.g., 'CA', 'US') */
|
|
7
21
|
countryCode: string;
|
|
22
|
+
/** Postal/zip code */
|
|
8
23
|
postalCode: string;
|
|
9
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Contact information for the permit applicant
|
|
27
|
+
*/
|
|
10
28
|
export type PermitContactDetails = {
|
|
29
|
+
/** Contact's first name */
|
|
11
30
|
firstName: string;
|
|
31
|
+
/** Contact's last name */
|
|
12
32
|
lastName: string;
|
|
33
|
+
/** Primary phone number */
|
|
13
34
|
phone1: string;
|
|
35
|
+
/** Primary phone extension (optional) */
|
|
14
36
|
phone1Extension?: string | null;
|
|
37
|
+
/** Secondary phone number (optional) */
|
|
15
38
|
phone2?: string | null;
|
|
39
|
+
/** Secondary phone extension (optional) */
|
|
16
40
|
phone2Extension?: string | null;
|
|
41
|
+
/** Primary email address */
|
|
17
42
|
email: string;
|
|
43
|
+
/** Additional email address (optional) */
|
|
18
44
|
additionalEmail?: string | null;
|
|
45
|
+
/** Fax number (optional) */
|
|
19
46
|
fax?: string | null;
|
|
20
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Detailed information about the vehicle in the permit application
|
|
50
|
+
*/
|
|
21
51
|
export type PermitVehicleDetails = {
|
|
52
|
+
/** Internal vehicle identifier (optional) */
|
|
22
53
|
vehicleId?: string | null;
|
|
54
|
+
/** Unit number for fleet vehicles (optional) */
|
|
23
55
|
unitNumber?: string | null;
|
|
56
|
+
/** Vehicle Identification Number */
|
|
24
57
|
vin: string;
|
|
58
|
+
/** License plate number */
|
|
25
59
|
plate: string;
|
|
60
|
+
/** Vehicle make (optional) */
|
|
26
61
|
make?: string | null;
|
|
62
|
+
/** Vehicle model year (optional) */
|
|
27
63
|
year?: number | null;
|
|
64
|
+
/** Country code where vehicle is registered */
|
|
28
65
|
countryCode: string;
|
|
66
|
+
/** Province/state code where vehicle is registered */
|
|
29
67
|
provinceCode: string;
|
|
68
|
+
/** Type of vehicle (e.g., 'powerUnit', 'trailer') */
|
|
30
69
|
vehicleType: string;
|
|
70
|
+
/** Subtype of vehicle (e.g., 'TRKTRAC', 'SEMITRL') */
|
|
31
71
|
vehicleSubType: string;
|
|
72
|
+
/** Licensed Gross Vehicle Weight in kilograms (optional) */
|
|
32
73
|
licensedGVW?: number | null;
|
|
74
|
+
/** Whether to save this vehicle to the inventory (optional) */
|
|
33
75
|
saveVehicle?: boolean | null;
|
|
34
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* Commodity information for the permit application
|
|
79
|
+
*/
|
|
35
80
|
export type PermitCommodity = {
|
|
81
|
+
/** Description of the commodity being transported */
|
|
36
82
|
description: string;
|
|
83
|
+
/** Special conditions for the commodity */
|
|
37
84
|
condition: string;
|
|
85
|
+
/** Link to detailed commodity conditions */
|
|
38
86
|
conditionLink: string;
|
|
87
|
+
/** Whether this commodity is selected */
|
|
39
88
|
checked: boolean;
|
|
89
|
+
/** Whether this commodity option is disabled */
|
|
40
90
|
disabled: boolean;
|
|
41
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* Complete permit data including all application details
|
|
94
|
+
*/
|
|
42
95
|
export type PermitData = {
|
|
96
|
+
/** Company name applying for the permit */
|
|
43
97
|
companyName: string;
|
|
98
|
+
/** Doing Business As name (optional) */
|
|
44
99
|
doingBusinessAs?: string;
|
|
100
|
+
/** Client number for the company */
|
|
45
101
|
clientNumber: string;
|
|
102
|
+
/** Duration of the permit in days */
|
|
46
103
|
permitDuration: number;
|
|
104
|
+
/** Array of commodities being transported */
|
|
47
105
|
commodities: Array<PermitCommodity>;
|
|
106
|
+
/** Contact details for the applicant */
|
|
48
107
|
contactDetails: PermitContactDetails;
|
|
108
|
+
/** Mailing address for correspondence */
|
|
49
109
|
mailingAddress: PermitMailingAddress;
|
|
110
|
+
/** Detailed vehicle information */
|
|
50
111
|
vehicleDetails: PermitVehicleDetails;
|
|
112
|
+
/** Fee summary information (optional) */
|
|
51
113
|
feeSummary?: string | null;
|
|
114
|
+
/** Permit start date (YYYY-MM-DD format) */
|
|
52
115
|
startDate: string;
|
|
116
|
+
/** Permit expiry date (YYYY-MM-DD format, optional) */
|
|
53
117
|
expiryDate?: string | null;
|
|
118
|
+
/** Selected permitted commodity (optional) */
|
|
54
119
|
permittedCommodity?: PermittedCommodity | null;
|
|
120
|
+
/** Vehicle configuration details (optional) */
|
|
55
121
|
vehicleConfiguration?: VehicleConfiguration | null;
|
|
122
|
+
/** Permitted route information (optional) */
|
|
56
123
|
permittedRoute?: PermittedRoute | null;
|
|
124
|
+
/** Additional application notes (optional) */
|
|
57
125
|
applicationNotes?: string | null;
|
|
126
|
+
/** Third party liability information (optional) */
|
|
58
127
|
thirdPartyLiability?: string | null;
|
|
128
|
+
/** Conditional licensing fee information (optional) */
|
|
59
129
|
conditionalLicensingFee?: string | null;
|
|
60
130
|
};
|
|
131
|
+
/**
|
|
132
|
+
* Selected commodity for the permit with load description
|
|
133
|
+
*/
|
|
61
134
|
export type PermittedCommodity = {
|
|
135
|
+
/** Type of commodity being transported */
|
|
62
136
|
commodityType: string;
|
|
137
|
+
/** Description of the load being transported */
|
|
63
138
|
loadDescription: string;
|
|
64
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* Vehicle configuration within the permit application
|
|
142
|
+
*/
|
|
65
143
|
export type VehicleInConfiguration = {
|
|
144
|
+
/** Subtype of the vehicle */
|
|
66
145
|
vehicleSubType: string;
|
|
67
146
|
};
|
|
147
|
+
/**
|
|
148
|
+
* Complete vehicle configuration including dimensions and axles
|
|
149
|
+
*/
|
|
68
150
|
export type VehicleConfiguration = {
|
|
151
|
+
/** Overall length in meters (optional) */
|
|
69
152
|
overallLength?: number;
|
|
153
|
+
/** Overall width in meters (optional) */
|
|
70
154
|
overallWidth?: number;
|
|
155
|
+
/** Overall height in meters (optional) */
|
|
71
156
|
overallHeight?: number;
|
|
157
|
+
/** Front projection in meters (optional) */
|
|
72
158
|
frontProjection?: number;
|
|
159
|
+
/** Rear projection in meters (optional) */
|
|
73
160
|
rearProjection?: number;
|
|
161
|
+
/** Array of trailers in the configuration (optional) */
|
|
74
162
|
trailers?: Array<VehicleInConfiguration> | null;
|
|
163
|
+
/** Loaded Gross Vehicle Weight in kilograms (optional) */
|
|
75
164
|
loadedGVW?: number;
|
|
165
|
+
/** Net weight in kilograms (optional) */
|
|
76
166
|
netWeight?: number;
|
|
167
|
+
/** Axle configuration details (optional) */
|
|
77
168
|
axleConfiguration?: Array<AxleConfiguration>;
|
|
78
169
|
};
|
|
170
|
+
/**
|
|
171
|
+
* Route information for the permit
|
|
172
|
+
*/
|
|
79
173
|
export type PermittedRoute = {
|
|
174
|
+
/** Manual route details (optional) */
|
|
80
175
|
manualRoute?: ManualRoute | null;
|
|
176
|
+
/** Additional route details (optional) */
|
|
81
177
|
routeDetails?: string | null;
|
|
82
178
|
};
|
|
179
|
+
/**
|
|
180
|
+
* Manual route configuration with highway sequence
|
|
181
|
+
*/
|
|
83
182
|
export type ManualRoute = {
|
|
183
|
+
/** Sequence of highways for the route */
|
|
84
184
|
highwaySequence: Array<string>;
|
|
185
|
+
/** Origin point of the route */
|
|
85
186
|
origin: string;
|
|
187
|
+
/** Destination point of the route */
|
|
86
188
|
destination: string;
|
|
189
|
+
/** Exit point from the route (optional) */
|
|
87
190
|
exitPoint?: string;
|
|
191
|
+
/** Total distance in kilometers (optional) */
|
|
88
192
|
totalDistance?: number;
|
|
89
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* Complete permit application structure
|
|
196
|
+
*/
|
|
90
197
|
export type PermitApplication = {
|
|
198
|
+
/** All permit data and details */
|
|
91
199
|
permitData: PermitData;
|
|
200
|
+
/** Type of permit being applied for */
|
|
92
201
|
permitType: string;
|
|
93
202
|
};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Permit Application Types
|
|
4
|
+
*
|
|
5
|
+
* Defines the complete structure for permit applications including contact details,
|
|
6
|
+
* vehicle information, routing, and configuration data.
|
|
7
|
+
*/
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|