@opencrvs/toolkit 1.8.1-rc.7e34683 → 1.8.1-rc.7f85c6f
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 +24 -404
- package/dist/commons/events/ActionDocument.d.ts +36 -659
- package/dist/commons/events/ActionInput.d.ts +36 -540
- package/dist/commons/events/Draft.d.ts +0 -44
- package/dist/commons/events/EventDocument.d.ts +26 -416
- package/dist/commons/events/test.utils.d.ts +5 -1
- package/dist/commons/events/utils.d.ts +0 -4
- package/dist/events/index.js +11 -14
- package/package.json +1 -1
@@ -414,7 +414,7 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
414
414
|
requestId: string;
|
415
415
|
keepAssignment: boolean | undefined;
|
416
416
|
};
|
417
|
-
reject: (eventId: string, requestId: string, input
|
417
|
+
reject: (eventId: string, requestId: string, input: Partial<Pick<RejectCorrectionActionInput, "transactionId" | "annotation" | "keepAssignment" | "reason">>) => {
|
418
418
|
type: "REJECT_CORRECTION";
|
419
419
|
transactionId: string;
|
420
420
|
declaration: {};
|
@@ -422,6 +422,10 @@ export declare function eventPayloadGenerator(rng: () => number): {
|
|
422
422
|
eventId: string;
|
423
423
|
requestId: string;
|
424
424
|
keepAssignment: boolean | undefined;
|
425
|
+
reason: {
|
426
|
+
message: string;
|
427
|
+
isDuplicate?: boolean | undefined;
|
428
|
+
};
|
425
429
|
};
|
426
430
|
};
|
427
431
|
};
|
@@ -6758,10 +6758,6 @@ export declare function findActiveDrafts(event: EventDocument, drafts: Draft[]):
|
|
6758
6758
|
start: string;
|
6759
6759
|
end: string;
|
6760
6760
|
} | null | undefined> | null | undefined;
|
6761
|
-
actionDetails?: {
|
6762
|
-
templateId?: string | undefined;
|
6763
|
-
isImmediateCorrection?: boolean | undefined;
|
6764
|
-
} | null | undefined;
|
6765
6761
|
originalActionId?: (string & import("zod").BRAND<"UUID">) | null | undefined;
|
6766
6762
|
};
|
6767
6763
|
}[];
|
package/dist/events/index.js
CHANGED
@@ -39,7 +39,6 @@ __export(events_exports, {
|
|
39
39
|
ActionConfig: () => ActionConfig,
|
40
40
|
ActionConfigBase: () => ActionConfigBase,
|
41
41
|
ActionCreationMetadata: () => ActionCreationMetadata,
|
42
|
-
ActionDetails: () => ActionDetails,
|
43
42
|
ActionDocument: () => ActionDocument,
|
44
43
|
ActionFormConfig: () => ActionFormConfig,
|
45
44
|
ActionInput: () => ActionInput,
|
@@ -607,8 +606,8 @@ var UrbanAddressUpdateValue = AdminStructure.extend({
|
|
607
606
|
zipCode: import_zod5.z.string().nullish()
|
608
607
|
});
|
609
608
|
var NameFieldValue = import_zod5.z.object({
|
610
|
-
firstname: import_zod5.z.string(),
|
611
|
-
surname: import_zod5.z.string(),
|
609
|
+
firstname: import_zod5.z.string().min(1),
|
610
|
+
surname: import_zod5.z.string().min(1),
|
612
611
|
middlename: import_zod5.z.string().optional()
|
613
612
|
});
|
614
613
|
var NameFieldUpdateValue = import_zod5.z.object({
|
@@ -1883,10 +1882,6 @@ var ActionStatus = {
|
|
1883
1882
|
Accepted: "Accepted",
|
1884
1883
|
Rejected: "Rejected"
|
1885
1884
|
};
|
1886
|
-
var ActionDetails = import_zod19.z.object({
|
1887
|
-
templateId: import_zod19.z.string().optional(),
|
1888
|
-
isImmediateCorrection: import_zod19.z.boolean().optional()
|
1889
|
-
});
|
1890
1885
|
var ActionBase = import_zod19.z.object({
|
1891
1886
|
id: UUID,
|
1892
1887
|
transactionId: import_zod19.z.string(),
|
@@ -1898,7 +1893,6 @@ var ActionBase = import_zod19.z.object({
|
|
1898
1893
|
createdAtLocation: CreatedAtLocation,
|
1899
1894
|
declaration: ActionUpdate,
|
1900
1895
|
annotation: ActionUpdate.optional().nullable(),
|
1901
|
-
actionDetails: ActionDetails.optional().nullable(),
|
1902
1896
|
status: import_zod19.z.enum([
|
1903
1897
|
ActionStatus.Requested,
|
1904
1898
|
ActionStatus.Accepted,
|
@@ -1986,7 +1980,8 @@ var ApprovedCorrectionAction = ActionBase.merge(
|
|
1986
1980
|
var RejectedCorrectionAction = ActionBase.merge(
|
1987
1981
|
import_zod19.z.object({
|
1988
1982
|
type: import_zod19.z.literal(ActionType.REJECT_CORRECTION),
|
1989
|
-
requestId: import_zod19.z.string()
|
1983
|
+
requestId: import_zod19.z.string(),
|
1984
|
+
reason: RejectionReason
|
1990
1985
|
})
|
1991
1986
|
);
|
1992
1987
|
var ReadAction = ActionBase.merge(
|
@@ -3840,7 +3835,6 @@ var BaseActionInput = import_zod29.z.object({
|
|
3840
3835
|
transactionId: import_zod29.z.string(),
|
3841
3836
|
declaration: ActionUpdate.default({}),
|
3842
3837
|
annotation: ActionUpdate.optional(),
|
3843
|
-
actionDetails: ActionDetails.optional(),
|
3844
3838
|
originalActionId: UUID.optional(),
|
3845
3839
|
// should not be part of base action.
|
3846
3840
|
keepAssignment: import_zod29.z.boolean().optional()
|
@@ -3923,7 +3917,8 @@ var RequestCorrectionActionInput = BaseActionInput.merge(
|
|
3923
3917
|
var RejectCorrectionActionInput = BaseActionInput.merge(
|
3924
3918
|
import_zod29.z.object({
|
3925
3919
|
requestId: import_zod29.z.string(),
|
3926
|
-
type: import_zod29.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION)
|
3920
|
+
type: import_zod29.z.literal(ActionType.REJECT_CORRECTION).default(ActionType.REJECT_CORRECTION),
|
3921
|
+
reason: RejectionReason
|
3927
3922
|
})
|
3928
3923
|
);
|
3929
3924
|
var ApproveCorrectionActionInput = BaseActionInput.merge(
|
@@ -6762,7 +6757,7 @@ function eventPayloadGenerator(rng) {
|
|
6762
6757
|
requestId,
|
6763
6758
|
keepAssignment: input.keepAssignment
|
6764
6759
|
}),
|
6765
|
-
reject: (eventId, requestId, input
|
6760
|
+
reject: (eventId, requestId, input) => ({
|
6766
6761
|
type: ActionType.REJECT_CORRECTION,
|
6767
6762
|
transactionId: input.transactionId ?? getUUID(),
|
6768
6763
|
declaration: {},
|
@@ -6773,7 +6768,8 @@ function eventPayloadGenerator(rng) {
|
|
6773
6768
|
),
|
6774
6769
|
eventId,
|
6775
6770
|
requestId,
|
6776
|
-
keepAssignment: input.keepAssignment
|
6771
|
+
keepAssignment: input.keepAssignment,
|
6772
|
+
reason: input.reason ?? { message: "" }
|
6777
6773
|
})
|
6778
6774
|
}
|
6779
6775
|
}
|
@@ -6832,7 +6828,8 @@ function generateActionDocument({
|
|
6832
6828
|
return {
|
6833
6829
|
...actionBase,
|
6834
6830
|
requestId: getUUID(),
|
6835
|
-
type: action
|
6831
|
+
type: action,
|
6832
|
+
reason: { message: "Correction rejection" }
|
6836
6833
|
};
|
6837
6834
|
case ActionType.REGISTER:
|
6838
6835
|
return {
|