@valentine-efagene/qshelter-common 2.0.110 → 2.0.112
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 +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/utils/condition-operators.d.ts +54 -0
- package/dist/src/utils/condition-operators.js +24 -0
- package/dist/src/utils/documentation-enums.d.ts +19 -0
- package/dist/src/utils/documentation-enums.js +15 -0
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
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';
|
|
5
|
+
export * from './utils/documentation-enums';
|
|
4
6
|
export * from './config';
|
|
5
7
|
export { PrismaClient, Prisma } from '../generated/client/client';
|
|
6
8
|
export * from '../generated/client/enums';
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
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';
|
|
5
|
+
export * from './utils/documentation-enums';
|
|
4
6
|
export * from './config';
|
|
5
7
|
export { PrismaClient, Prisma } from '../generated/client/client';
|
|
6
8
|
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
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documentation-related enums for documentation plan steps.
|
|
3
|
+
* Used in DocumentationPlanStep metadata to indicate upload responsibility.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Indicates who is responsible for uploading a document in a documentation step.
|
|
7
|
+
*/
|
|
8
|
+
export declare const UPLOADED_BY: {
|
|
9
|
+
/** Document is uploaded by the customer/applicant */
|
|
10
|
+
readonly CUSTOMER: "CUSTOMER";
|
|
11
|
+
/** Document is uploaded by an admin/staff member */
|
|
12
|
+
readonly ADMIN: "ADMIN";
|
|
13
|
+
/** Document is uploaded by the system (auto-generated) */
|
|
14
|
+
readonly SYSTEM: "SYSTEM";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Type representing a valid uploadedBy value.
|
|
18
|
+
*/
|
|
19
|
+
export type UploadedBy = (typeof UPLOADED_BY)[keyof typeof UPLOADED_BY];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Documentation-related enums for documentation plan steps.
|
|
3
|
+
* Used in DocumentationPlanStep metadata to indicate upload responsibility.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Indicates who is responsible for uploading a document in a documentation step.
|
|
7
|
+
*/
|
|
8
|
+
export const UPLOADED_BY = {
|
|
9
|
+
/** Document is uploaded by the customer/applicant */
|
|
10
|
+
CUSTOMER: 'CUSTOMER',
|
|
11
|
+
/** Document is uploaded by an admin/staff member */
|
|
12
|
+
ADMIN: 'ADMIN',
|
|
13
|
+
/** Document is uploaded by the system (auto-generated) */
|
|
14
|
+
SYSTEM: 'SYSTEM',
|
|
15
|
+
};
|
package/package.json
CHANGED