@valentine-efagene/qshelter-common 2.0.110 → 2.0.111
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/src/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './types/response';
|
|
2
2
|
export * from './types/action-status';
|
|
3
3
|
export * from './utils/errors';
|
|
4
|
+
export * from './utils/condition-operators';
|
|
4
5
|
export * from './config';
|
|
5
6
|
export { PrismaClient, Prisma } from '../generated/client/client';
|
|
6
7
|
export * from '../generated/client/enums';
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './types/response';
|
|
2
2
|
export * from './types/action-status';
|
|
3
3
|
export * from './utils/errors';
|
|
4
|
+
export * from './utils/condition-operators';
|
|
4
5
|
export * from './config';
|
|
5
6
|
export { PrismaClient, Prisma } from '../generated/client/client';
|
|
6
7
|
export * from '../generated/client/enums';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Condition operators for evaluating step conditions against questionnaire answers.
|
|
3
|
+
* Used in DocumentationPlanStep.condition to conditionally require documents
|
|
4
|
+
* based on prequalification answers.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Supported condition operators for evaluating document step conditions.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CONDITION_OPERATORS: {
|
|
10
|
+
/** Value equals the specified value */
|
|
11
|
+
readonly EQUALS: "EQUALS";
|
|
12
|
+
/** Value does not equal the specified value */
|
|
13
|
+
readonly NOT_EQUALS: "NOT_EQUALS";
|
|
14
|
+
/** Value is in the specified array of values */
|
|
15
|
+
readonly IN: "IN";
|
|
16
|
+
/** Value is not in the specified array of values */
|
|
17
|
+
readonly NOT_IN: "NOT_IN";
|
|
18
|
+
/** Numeric value is greater than the specified value */
|
|
19
|
+
readonly GREATER_THAN: "GREATER_THAN";
|
|
20
|
+
/** Numeric value is less than the specified value */
|
|
21
|
+
readonly LESS_THAN: "LESS_THAN";
|
|
22
|
+
/** Value exists (is not null/undefined) */
|
|
23
|
+
readonly EXISTS: "EXISTS";
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Type representing a valid condition operator.
|
|
27
|
+
*/
|
|
28
|
+
export type ConditionOperator = keyof typeof CONDITION_OPERATORS;
|
|
29
|
+
/**
|
|
30
|
+
* Interface for a simple condition that checks a single question answer.
|
|
31
|
+
*/
|
|
32
|
+
export interface SimpleCondition {
|
|
33
|
+
/** The question key to check the answer for */
|
|
34
|
+
questionKey: string;
|
|
35
|
+
/** The comparison operator */
|
|
36
|
+
operator: ConditionOperator;
|
|
37
|
+
/** The value to compare against (for EQUALS, NOT_EQUALS, GREATER_THAN, LESS_THAN) */
|
|
38
|
+
value?: string | number | boolean;
|
|
39
|
+
/** The values to compare against (for IN, NOT_IN) */
|
|
40
|
+
values?: (string | number)[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Interface for a compound condition that combines multiple conditions.
|
|
44
|
+
*/
|
|
45
|
+
export interface CompoundCondition {
|
|
46
|
+
/** All conditions must be true (AND) */
|
|
47
|
+
all?: StepCondition[];
|
|
48
|
+
/** At least one condition must be true (OR) */
|
|
49
|
+
any?: StepCondition[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A step condition can be either a simple condition or a compound condition.
|
|
53
|
+
*/
|
|
54
|
+
export type StepCondition = SimpleCondition | CompoundCondition;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Condition operators for evaluating step conditions against questionnaire answers.
|
|
3
|
+
* Used in DocumentationPlanStep.condition to conditionally require documents
|
|
4
|
+
* based on prequalification answers.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Supported condition operators for evaluating document step conditions.
|
|
8
|
+
*/
|
|
9
|
+
export const CONDITION_OPERATORS = {
|
|
10
|
+
/** Value equals the specified value */
|
|
11
|
+
EQUALS: 'EQUALS',
|
|
12
|
+
/** Value does not equal the specified value */
|
|
13
|
+
NOT_EQUALS: 'NOT_EQUALS',
|
|
14
|
+
/** Value is in the specified array of values */
|
|
15
|
+
IN: 'IN',
|
|
16
|
+
/** Value is not in the specified array of values */
|
|
17
|
+
NOT_IN: 'NOT_IN',
|
|
18
|
+
/** Numeric value is greater than the specified value */
|
|
19
|
+
GREATER_THAN: 'GREATER_THAN',
|
|
20
|
+
/** Numeric value is less than the specified value */
|
|
21
|
+
LESS_THAN: 'LESS_THAN',
|
|
22
|
+
/** Value exists (is not null/undefined) */
|
|
23
|
+
EXISTS: 'EXISTS',
|
|
24
|
+
};
|
package/package.json
CHANGED