@opencrvs/toolkit 1.8.1-rc.4c1434e → 1.8.1-rc.4f4b65a
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/commons/api/router.d.ts +391 -394
- package/dist/commons/conditionals/validate.d.ts +8 -0
- package/dist/commons/events/ActionConfig.d.ts +2004 -366
- package/dist/commons/events/ActionDocument.d.ts +736 -736
- package/dist/commons/events/ActionInput.d.ts +600 -600
- package/dist/commons/events/AdvancedSearchConfig.d.ts +49 -31
- package/dist/commons/events/CompositeFieldValue.d.ts +6 -6
- package/dist/commons/events/CountryConfigQueryInput.d.ts +88 -88
- package/dist/commons/events/Draft.d.ts +48 -48
- package/dist/commons/events/EventConfig.d.ts +673 -146
- package/dist/commons/events/EventDocument.d.ts +432 -432
- package/dist/commons/events/EventIndex.d.ts +62 -65
- package/dist/commons/events/EventMetadata.d.ts +9 -12
- package/dist/commons/events/FieldConfig.d.ts +254 -43
- package/dist/commons/events/FieldTypeMapping.d.ts +16 -16
- package/dist/commons/events/FieldValue.d.ts +12 -12
- package/dist/commons/events/FormConfig.d.ts +1032 -246
- package/dist/commons/events/PageConfig.d.ts +264 -46
- package/dist/commons/events/WorkqueueConfig.d.ts +199 -164
- package/dist/commons/events/defineConfig.d.ts +127 -28
- package/dist/commons/events/event.d.ts +6 -6
- package/dist/commons/events/test.utils.d.ts +12 -12
- package/dist/commons/events/utils.d.ts +234 -58
- package/dist/conditionals/index.js +3 -2
- package/dist/events/index.js +112 -66
- package/package.json +1 -1
- package/tsconfig.json +1 -1
- package/dist/commons/conditionals/conditionals.test.d.ts +0 -2
- package/dist/commons/conditionals/validate-address.test.d.ts +0 -2
- package/dist/commons/conditionals/validate.test.d.ts +0 -2
- package/dist/commons/events/utils.test.d.ts +0 -2
package/dist/events/index.js
CHANGED
@@ -40,6 +40,7 @@ __export(events_exports, {
|
|
40
40
|
ActionConfigBase: () => ActionConfigBase,
|
41
41
|
ActionCreationMetadata: () => ActionCreationMetadata,
|
42
42
|
ActionDocument: () => ActionDocument,
|
43
|
+
ActionFlag: () => ActionFlag,
|
43
44
|
ActionFormConfig: () => ActionFormConfig,
|
44
45
|
ActionInput: () => ActionInput,
|
45
46
|
ActionStatus: () => ActionStatus,
|
@@ -95,6 +96,7 @@ __export(events_exports, {
|
|
95
96
|
EventDocument: () => EventDocument,
|
96
97
|
EventFieldConfigSchema: () => EventFieldConfigSchema,
|
97
98
|
EventFieldId: () => EventFieldId,
|
99
|
+
EventFieldIdInput: () => EventFieldIdInput,
|
98
100
|
EventIndex: () => EventIndex,
|
99
101
|
EventInput: () => EventInput,
|
100
102
|
EventMetadata: () => EventMetadata,
|
@@ -129,8 +131,10 @@ __export(events_exports, {
|
|
129
131
|
InherentFlags: () => InherentFlags,
|
130
132
|
LanguageConfig: () => LanguageConfig,
|
131
133
|
LegalStatuses: () => LegalStatuses,
|
134
|
+
METADATA_FIELD_PREFIX: () => METADATA_FIELD_PREFIX,
|
132
135
|
MarkedAsDuplicateActionInput: () => MarkedAsDuplicateActionInput,
|
133
136
|
MimeType: () => MimeType,
|
137
|
+
NameConfig: () => NameConfig,
|
134
138
|
NameFieldUpdateValue: () => NameFieldUpdateValue,
|
135
139
|
NameFieldValue: () => NameFieldValue,
|
136
140
|
NonEmptyTextValue: () => NonEmptyTextValue,
|
@@ -168,6 +172,7 @@ __export(events_exports, {
|
|
168
172
|
TENNIS_CLUB_MEMBERSHIP: () => TENNIS_CLUB_MEMBERSHIP,
|
169
173
|
TEST_SYSTEM_IANA_TIMEZONE: () => TEST_SYSTEM_IANA_TIMEZONE,
|
170
174
|
TestUserRole: () => TestUserRole,
|
175
|
+
TextField: () => TextField,
|
171
176
|
TextValue: () => TextValue,
|
172
177
|
TimeValue: () => TimeValue,
|
173
178
|
TranslationConfig: () => TranslationConfig,
|
@@ -179,7 +184,6 @@ __export(events_exports, {
|
|
179
184
|
ValidationConfig: () => ValidationConfig,
|
180
185
|
VerificationActionConfig: () => VerificationActionConfig,
|
181
186
|
VerificationPageConfig: () => VerificationPageConfig,
|
182
|
-
VisibleStatus: () => VisibleStatus,
|
183
187
|
WRITE_ACTION_SCOPES: () => WRITE_ACTION_SCOPES,
|
184
188
|
Within: () => Within,
|
185
189
|
WorkqueueActionsWithDefault: () => WorkqueueActionsWithDefault,
|
@@ -322,6 +326,7 @@ __export(events_exports, {
|
|
322
326
|
or: () => or,
|
323
327
|
resolveDateOfEvent: () => resolveDateOfEvent,
|
324
328
|
runFieldValidations: () => runFieldValidations,
|
329
|
+
runStructuralValidations: () => runStructuralValidations,
|
325
330
|
timePeriodToDateRange: () => timePeriodToDateRange,
|
326
331
|
user: () => user,
|
327
332
|
validate: () => validate,
|
@@ -556,7 +561,7 @@ var import_zod6 = require("zod");
|
|
556
561
|
var import_zod4 = require("zod");
|
557
562
|
var import_zod_openapi3 = require("zod-openapi");
|
558
563
|
(0, import_zod_openapi3.extendZodWithOpenApi)(import_zod4.z);
|
559
|
-
var
|
564
|
+
var FullDocumentUrl = import_zod4.z.string().brand("FullDocumentUrl").describe(
|
560
565
|
"A full url with protocol, host, bucket name, starting from the root of the S3 server, https://minio/bucket-name/document-id.jpg"
|
561
566
|
);
|
562
567
|
var FullDocumentPath = import_zod4.z.string().transform((val) => val.startsWith("/") ? val : `/${val}`).openapi({ effectType: "input", type: "string" }).describe(
|
@@ -608,13 +613,13 @@ var UrbanAddressUpdateValue = AdminStructure.extend({
|
|
608
613
|
zipCode: import_zod5.z.string().nullish()
|
609
614
|
});
|
610
615
|
var NameFieldValue = import_zod5.z.object({
|
611
|
-
firstname: import_zod5.z.string()
|
612
|
-
surname: import_zod5.z.string()
|
616
|
+
firstname: import_zod5.z.string(),
|
617
|
+
surname: import_zod5.z.string(),
|
613
618
|
middlename: import_zod5.z.string().optional()
|
614
619
|
});
|
615
620
|
var NameFieldUpdateValue = import_zod5.z.object({
|
616
|
-
firstname: import_zod5.z.string()
|
617
|
-
surname: import_zod5.z.string()
|
621
|
+
firstname: import_zod5.z.string(),
|
622
|
+
surname: import_zod5.z.string(),
|
618
623
|
middlename: import_zod5.z.string().nullish()
|
619
624
|
}).or(import_zod5.z.null()).or(import_zod5.z.undefined());
|
620
625
|
var RuralAddressUpdateValue = AdminStructure.extend({
|
@@ -911,18 +916,32 @@ var SelectDateRangeField = BaseField.extend({
|
|
911
916
|
defaultValue: SelectDateRangeValue.optional(),
|
912
917
|
options: import_zod7.z.array(SelectDateRangeOption).describe("A list of options")
|
913
918
|
}).describe("Select input with date range options");
|
919
|
+
var NameConfig = import_zod7.z.object({
|
920
|
+
firstname: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional(),
|
921
|
+
middlename: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional(),
|
922
|
+
surname: import_zod7.z.object({ required: import_zod7.z.boolean() }).optional()
|
923
|
+
});
|
914
924
|
var NameField = BaseField.extend({
|
915
925
|
type: import_zod7.z.literal(FieldType.NAME),
|
916
926
|
defaultValue: import_zod7.z.object({
|
917
|
-
firstname: NonEmptyTextValue,
|
918
|
-
|
927
|
+
firstname: NonEmptyTextValue.optional(),
|
928
|
+
middlename: NonEmptyTextValue.optional(),
|
929
|
+
surname: NonEmptyTextValue.optional()
|
919
930
|
}).optional(),
|
920
931
|
configuration: import_zod7.z.object({
|
932
|
+
name: NameConfig.default({
|
933
|
+
firstname: { required: true },
|
934
|
+
surname: { required: true }
|
935
|
+
}).optional(),
|
921
936
|
maxLength: import_zod7.z.number().optional().describe("Maximum length of the text"),
|
922
937
|
prefix: TranslationConfig.optional(),
|
923
938
|
postfix: TranslationConfig.optional(),
|
924
|
-
includeMiddlename: import_zod7.z.boolean().default(false).optional().describe("To make middle name visible in Name form field"),
|
925
939
|
searchMode: import_zod7.z.boolean().optional()
|
940
|
+
}).default({
|
941
|
+
name: {
|
942
|
+
firstname: { required: true },
|
943
|
+
surname: { required: true }
|
944
|
+
}
|
926
945
|
}).optional()
|
927
946
|
}).describe("Name input field");
|
928
947
|
var PhoneField = BaseField.extend({
|
@@ -1397,22 +1416,30 @@ var FieldConfigSchema = BaseField3.extend({
|
|
1397
1416
|
fieldType: import_zod15.z.literal("field"),
|
1398
1417
|
alternateFieldIds: import_zod15.z.array(import_zod15.z.string()).optional().describe(
|
1399
1418
|
`Sometimes there might be need to search a value against multiple field of same FormField type. For example
|
1400
|
-
search Country, Province, District against child.address.private and child.address.other. In such case, we
|
1419
|
+
search Country, Province, District against child.address.private and child.address.other. In such case, we
|
1401
1420
|
add a one field as fieldId, and accomodate others in alternateFieldIds`
|
1402
1421
|
),
|
1403
|
-
excludeInSearchQuery: import_zod15.z.boolean().default(false).optional().describe(`Sometimes there will be search fields which are used to
|
1404
|
-
conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
|
1422
|
+
excludeInSearchQuery: import_zod15.z.boolean().default(false).optional().describe(`Sometimes there will be search fields which are used to
|
1423
|
+
conditionally display another search field, but its not needed in search query. For example, child.placeOfBirth
|
1405
1424
|
is select field, which has 3 options, FACILITY, PRIVATE_HOME, OTHER. Upon selecting any of the option, pops up another field
|
1406
1425
|
related to the selected option, whose value is required in the search query. But child.placeOfBirth itself is not needed in the query.
|
1407
1426
|
In such case, populate this field (excludeInSearchQuery) with boolean true`)
|
1408
1427
|
});
|
1409
|
-
var
|
1428
|
+
var EventFieldIdInput = import_zod15.z.enum([
|
1410
1429
|
"trackingId",
|
1411
1430
|
"status",
|
1412
1431
|
"legalStatuses.REGISTERED.acceptedAt",
|
1413
1432
|
"legalStatuses.REGISTERED.createdAtLocation",
|
1414
1433
|
"updatedAt"
|
1415
1434
|
]);
|
1435
|
+
var METADATA_FIELD_PREFIX = "event.";
|
1436
|
+
var EventFieldId = import_zod15.z.enum([
|
1437
|
+
`${METADATA_FIELD_PREFIX}trackingId`,
|
1438
|
+
`${METADATA_FIELD_PREFIX}status`,
|
1439
|
+
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.acceptedAt`,
|
1440
|
+
`${METADATA_FIELD_PREFIX}legalStatuses.REGISTERED.createdAtLocation`,
|
1441
|
+
`${METADATA_FIELD_PREFIX}updatedAt`
|
1442
|
+
]);
|
1416
1443
|
var EventFieldConfigSchema = BaseField3.extend({
|
1417
1444
|
fieldId: EventFieldId,
|
1418
1445
|
fieldType: import_zod15.z.literal("event")
|
@@ -2438,6 +2465,23 @@ function validateFieldInput({
|
|
2438
2465
|
const rawError = zodType.safeParse(value, { errorMap: zodToIntlErrorMap });
|
2439
2466
|
return rawError.error?.issues.map((issue) => issue.message) ?? [];
|
2440
2467
|
}
|
2468
|
+
function runStructuralValidations({
|
2469
|
+
field: field2,
|
2470
|
+
values
|
2471
|
+
}) {
|
2472
|
+
if (!isFieldVisible(field2, values) || isFieldEmptyAndNotRequired(field2, values)) {
|
2473
|
+
return {
|
2474
|
+
errors: []
|
2475
|
+
};
|
2476
|
+
}
|
2477
|
+
const fieldValidationResult = validateFieldInput({
|
2478
|
+
field: field2,
|
2479
|
+
value: values[field2.id]
|
2480
|
+
});
|
2481
|
+
return {
|
2482
|
+
errors: fieldValidationResult
|
2483
|
+
};
|
2484
|
+
}
|
2441
2485
|
function runFieldValidations({
|
2442
2486
|
field: field2,
|
2443
2487
|
values
|
@@ -2728,16 +2772,16 @@ function timePeriodToDateRange(value) {
|
|
2728
2772
|
let startDate;
|
2729
2773
|
switch (value) {
|
2730
2774
|
case "last7Days":
|
2731
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2775
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 7);
|
2732
2776
|
break;
|
2733
2777
|
case "last30Days":
|
2734
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2778
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 30);
|
2735
2779
|
break;
|
2736
2780
|
case "last90Days":
|
2737
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2781
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 90);
|
2738
2782
|
break;
|
2739
2783
|
case "last365Days":
|
2740
|
-
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(),
|
2784
|
+
startDate = (0, import_date_fns2.subDays)(/* @__PURE__ */ new Date(), 365);
|
2741
2785
|
break;
|
2742
2786
|
}
|
2743
2787
|
return {
|
@@ -3104,8 +3148,9 @@ function createFieldConditionals(fieldId) {
|
|
3104
3148
|
properties: {
|
3105
3149
|
[fieldId]: {
|
3106
3150
|
type: "string",
|
3107
|
-
|
3108
|
-
|
3151
|
+
minLength: 1,
|
3152
|
+
pattern: "^[\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*( [\\p{Script=Latin}0-9'.-]*(\\([\\p{Script=Latin}0-9'.-]+\\))?[\\p{Script=Latin}0-9'.-]*)*$",
|
3153
|
+
description: "Name must contain only letters, numbers, and allowed special characters ('.-). No double spaces."
|
3109
3154
|
}
|
3110
3155
|
}
|
3111
3156
|
}),
|
@@ -3218,7 +3263,7 @@ function createSearchConfig(baseField) {
|
|
3218
3263
|
// ../commons/src/event-config/event-configuration.ts
|
3219
3264
|
function createEventFieldConfig(fieldId) {
|
3220
3265
|
const baseField = {
|
3221
|
-
fieldId
|
3266
|
+
fieldId: `${METADATA_FIELD_PREFIX}${fieldId}`,
|
3222
3267
|
fieldType: "event"
|
3223
3268
|
};
|
3224
3269
|
return createSearchConfig(baseField);
|
@@ -3350,24 +3395,23 @@ var EventStatus = import_zod23.z.enum([
|
|
3350
3395
|
"DECLARED",
|
3351
3396
|
"VALIDATED",
|
3352
3397
|
"REGISTERED",
|
3353
|
-
"CERTIFIED",
|
3354
3398
|
"ARCHIVED"
|
3355
3399
|
]);
|
3356
|
-
var VisibleStatus = import_zod23.z.enum([...EventStatus.options, "REJECTED"]);
|
3357
3400
|
var InherentFlags = {
|
3358
|
-
|
3401
|
+
PENDING_CERTIFICATION: "pending-certification",
|
3359
3402
|
INCOMPLETE: "incomplete",
|
3360
3403
|
REJECTED: "rejected",
|
3361
3404
|
CORRECTION_REQUESTED: "correction-requested"
|
3362
3405
|
};
|
3363
|
-
var
|
3406
|
+
var ActionFlag = import_zod23.z.string().regex(
|
3364
3407
|
new RegExp(
|
3365
3408
|
`^(${Object.values(ActionType).join("|").toLowerCase()}):(${Object.values(
|
3366
3409
|
ActionStatus
|
3367
3410
|
).join("|").toLowerCase()})$`
|
3368
3411
|
),
|
3369
3412
|
"Flag must be in the format ActionType:ActionStatus (lowerCase)"
|
3370
|
-
)
|
3413
|
+
);
|
3414
|
+
var Flag = ActionFlag.or(import_zod23.z.nativeEnum(InherentFlags));
|
3371
3415
|
var ZodDate = import_zod23.z.string().date();
|
3372
3416
|
var ActionCreationMetadata = import_zod23.z.object({
|
3373
3417
|
createdAt: import_zod23.z.string().datetime().describe("The timestamp when the action request was created."),
|
@@ -3416,8 +3460,7 @@ var EventMetadata = import_zod23.z.object({
|
|
3416
3460
|
trackingId: import_zod23.z.string().describe(
|
3417
3461
|
"System-generated tracking ID used by informants or registrars to look up the event."
|
3418
3462
|
),
|
3419
|
-
flags: import_zod23.z.array(Flag)
|
3420
|
-
modifiedAt: import_zod23.z.string().optional()
|
3463
|
+
flags: import_zod23.z.array(Flag)
|
3421
3464
|
});
|
3422
3465
|
var EventMetadataKeysArray = [
|
3423
3466
|
"id",
|
@@ -3884,7 +3927,8 @@ var WorkqueueConfig = import_zod28.z.object({
|
|
3884
3927
|
})
|
3885
3928
|
),
|
3886
3929
|
columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
|
3887
|
-
icon: AvailableIcons
|
3930
|
+
icon: AvailableIcons,
|
3931
|
+
emptyMessage: TranslationConfig.optional()
|
3888
3932
|
}).describe("Configuration for workqueue.");
|
3889
3933
|
var WorkqueueConfigWithoutQuery = WorkqueueConfig.omit({
|
3890
3934
|
query: true,
|
@@ -3903,7 +3947,8 @@ var WorkqueueConfigInput = import_zod28.z.object({
|
|
3903
3947
|
})
|
3904
3948
|
),
|
3905
3949
|
columns: import_zod28.z.array(WorkqueueColumn).default(mandatoryColumns),
|
3906
|
-
icon: AvailableIcons
|
3950
|
+
icon: AvailableIcons,
|
3951
|
+
emptyMessage: TranslationConfig.optional()
|
3907
3952
|
});
|
3908
3953
|
function defineWorkqueue(workqueueInput) {
|
3909
3954
|
const queryInput = workqueueInput.query;
|
@@ -4205,16 +4250,19 @@ function getLegalStatuses(actions) {
|
|
4205
4250
|
}
|
4206
4251
|
|
4207
4252
|
// ../commons/src/events/state/flags.ts
|
4208
|
-
function
|
4253
|
+
function isPendingCertification(actions) {
|
4254
|
+
if (getStatusFromActions(actions) !== EventStatus.enum.REGISTERED) {
|
4255
|
+
return false;
|
4256
|
+
}
|
4209
4257
|
return actions.reduce((prev, { type }) => {
|
4210
4258
|
if (type === ActionType.PRINT_CERTIFICATE) {
|
4211
|
-
return
|
4259
|
+
return false;
|
4212
4260
|
}
|
4213
4261
|
if (type === ActionType.APPROVE_CORRECTION) {
|
4214
|
-
return
|
4262
|
+
return true;
|
4215
4263
|
}
|
4216
4264
|
return prev;
|
4217
|
-
},
|
4265
|
+
}, true);
|
4218
4266
|
}
|
4219
4267
|
function isCorrectionRequested(actions) {
|
4220
4268
|
return actions.reduce((prev, { type }) => {
|
@@ -4249,8 +4297,8 @@ function getFlagsFromActions(actions) {
|
|
4249
4297
|
const flag = joinValues([type, status], ":").toLowerCase();
|
4250
4298
|
return flag;
|
4251
4299
|
});
|
4252
|
-
if (
|
4253
|
-
flags.push(InherentFlags.
|
4300
|
+
if (isPendingCertification(sortedActions)) {
|
4301
|
+
flags.push(InherentFlags.PENDING_CERTIFICATION);
|
4254
4302
|
}
|
4255
4303
|
if (isCorrectionRequested(sortedActions)) {
|
4256
4304
|
flags.push(InherentFlags.CORRECTION_REQUESTED);
|
@@ -4281,7 +4329,6 @@ function getStatusFromActions(actions) {
|
|
4281
4329
|
case ActionType.NOTIFY:
|
4282
4330
|
return EventStatus.enum.NOTIFIED;
|
4283
4331
|
case ActionType.PRINT_CERTIFICATE:
|
4284
|
-
return EventStatus.enum.CERTIFIED;
|
4285
4332
|
case ActionType.ASSIGN:
|
4286
4333
|
case ActionType.UNASSIGN:
|
4287
4334
|
case ActionType.REJECT:
|
@@ -5246,7 +5293,27 @@ var TENNIS_CLUB_DECLARATION_FORM = defineDeclarationForm({
|
|
5246
5293
|
defaultMessage: "Applicant's name",
|
5247
5294
|
description: "This is the label for the field",
|
5248
5295
|
id: "v2.event.tennis-club-membership.action.declare.form.section.who.field.firstname.label"
|
5249
|
-
}
|
5296
|
+
},
|
5297
|
+
configuration: {
|
5298
|
+
name: {
|
5299
|
+
firstname: { required: true },
|
5300
|
+
middlename: { required: false },
|
5301
|
+
surname: { required: true }
|
5302
|
+
}
|
5303
|
+
},
|
5304
|
+
validation: [
|
5305
|
+
{
|
5306
|
+
validator: field("applicant.name").object({
|
5307
|
+
firstname: field("firstname").isValidEnglishName(),
|
5308
|
+
surname: field("surname").isValidEnglishName()
|
5309
|
+
}),
|
5310
|
+
message: {
|
5311
|
+
defaultMessage: "Input contains invalid characters. Please use only letters (a-z, A-Z), numbers (0-9), hyphens (-), apostrophes(') and underscores (_)",
|
5312
|
+
description: "This is the error message for invalid name",
|
5313
|
+
id: "v2.error.invalidName"
|
5314
|
+
}
|
5315
|
+
}
|
5316
|
+
]
|
5250
5317
|
},
|
5251
5318
|
{
|
5252
5319
|
id: "applicant.email",
|
@@ -5468,22 +5535,6 @@ var statusOptions = [
|
|
5468
5535
|
id: "v2.advancedSearch.form.recordStatusRegistered"
|
5469
5536
|
}
|
5470
5537
|
},
|
5471
|
-
{
|
5472
|
-
value: EventStatus.enum.CERTIFIED,
|
5473
|
-
label: {
|
5474
|
-
defaultMessage: "Certified",
|
5475
|
-
description: "Option for form field: status of record",
|
5476
|
-
id: "v2.advancedSearch.form.recordStatusCertified"
|
5477
|
-
}
|
5478
|
-
},
|
5479
|
-
{
|
5480
|
-
value: VisibleStatus.enum.REJECTED,
|
5481
|
-
label: {
|
5482
|
-
defaultMessage: "Rejected",
|
5483
|
-
description: "Option for form field: status of record",
|
5484
|
-
id: "v2.advancedSearch.form.recordStatusRejected"
|
5485
|
-
}
|
5486
|
-
},
|
5487
5538
|
{
|
5488
5539
|
value: EventStatus.enum.ARCHIVED,
|
5489
5540
|
label: {
|
@@ -7339,14 +7390,6 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
7339
7390
|
ActionType.REJECT_CORRECTION,
|
7340
7391
|
ExclusiveActions.REVIEW_CORRECTION_REQUEST
|
7341
7392
|
],
|
7342
|
-
[EventStatus.enum.CERTIFIED]: [
|
7343
|
-
ActionType.READ,
|
7344
|
-
ActionType.PRINT_CERTIFICATE,
|
7345
|
-
ActionType.REQUEST_CORRECTION,
|
7346
|
-
ActionType.APPROVE_CORRECTION,
|
7347
|
-
ActionType.REJECT_CORRECTION,
|
7348
|
-
ExclusiveActions.REVIEW_CORRECTION_REQUEST
|
7349
|
-
],
|
7350
7393
|
[EventStatus.enum.ARCHIVED]: [
|
7351
7394
|
ActionType.READ,
|
7352
7395
|
ActionType.ASSIGN,
|
@@ -7354,9 +7397,12 @@ var AVAILABLE_ACTIONS_BY_EVENT_STATUS = {
|
|
7354
7397
|
]
|
7355
7398
|
};
|
7356
7399
|
var getAvailableActionsForEvent = (event2) => {
|
7357
|
-
|
7358
|
-
|
7359
|
-
|
7360
|
-
|
7361
|
-
|
7400
|
+
if (event2.flags.includes(InherentFlags.REJECTED)) {
|
7401
|
+
return [
|
7402
|
+
ActionType.READ,
|
7403
|
+
event2.status === EventStatus.Enum.VALIDATED ? ActionType.VALIDATE : ActionType.DECLARE,
|
7404
|
+
ActionType.ARCHIVE
|
7405
|
+
];
|
7406
|
+
}
|
7407
|
+
return AVAILABLE_ACTIONS_BY_EVENT_STATUS[event2.status];
|
7362
7408
|
};
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
"@opencrvs/commons/events": ["../commons/src/events/index.ts"]
|
20
20
|
}
|
21
21
|
},
|
22
|
-
"references": [{ "path": "../commons" }],
|
22
|
+
"references": [{ "path": "../commons/tsconfig-commonjs.json" }],
|
23
23
|
"include": ["src/**/*.ts"],
|
24
24
|
"exclude": ["**/node_modules/**", "dist"]
|
25
25
|
}
|