@opencrvs/toolkit 1.9.13-rc.eead33a → 1.9.13-rc.ef12002
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.
|
@@ -460,7 +460,7 @@ export declare function timePeriodToDateRange(value: SelectDateRangeValue): {
|
|
|
460
460
|
};
|
|
461
461
|
export declare function mergeDrafts(currentDraft: Draft, incomingDraft: Draft): Draft;
|
|
462
462
|
export declare function getPendingAction(actions: Action[]): ActionDocument;
|
|
463
|
-
export declare function getCompleteActionAnnotation(
|
|
463
|
+
export declare function getCompleteActionAnnotation(event: EventDocument, action: ActionDocument): ActionUpdate;
|
|
464
464
|
export declare function getCompleteActionDeclaration<T extends EventState | ActionUpdate>(declaration: T, event: EventDocument, action: ActionDocument): T;
|
|
465
465
|
export declare function getAcceptedActions(event: EventDocument): ActionDocument[];
|
|
466
466
|
export declare function aggregateActionDeclarations(event: EventDocument): EventState;
|
package/dist/events/index.js
CHANGED
|
@@ -4097,20 +4097,16 @@ function getPendingAction(actions) {
|
|
|
4097
4097
|
}
|
|
4098
4098
|
return pendingActions[0];
|
|
4099
4099
|
}
|
|
4100
|
-
function getCompleteActionAnnotation(
|
|
4100
|
+
function getCompleteActionAnnotation(event2, action) {
|
|
4101
4101
|
if (action.originalActionId) {
|
|
4102
4102
|
const originalAction = event2.actions.find(
|
|
4103
4103
|
({ id }) => id === action.originalActionId
|
|
4104
4104
|
);
|
|
4105
|
-
if (originalAction?.status
|
|
4106
|
-
return annotation;
|
|
4105
|
+
if (originalAction?.status === ActionStatus.Requested) {
|
|
4106
|
+
return deepMerge(originalAction.annotation ?? {}, action.annotation ?? {});
|
|
4107
4107
|
}
|
|
4108
|
-
return deepMerge(
|
|
4109
|
-
deepMerge(annotation, originalAction.annotation ?? {}),
|
|
4110
|
-
action.annotation ?? {}
|
|
4111
|
-
);
|
|
4112
4108
|
}
|
|
4113
|
-
return
|
|
4109
|
+
return action.annotation ?? {};
|
|
4114
4110
|
}
|
|
4115
4111
|
function getCompleteActionDeclaration(declaration, event2, action) {
|
|
4116
4112
|
if (action.originalActionId) {
|
|
@@ -4130,7 +4126,7 @@ function getAcceptedActions(event2) {
|
|
|
4130
4126
|
return event2.actions.filter(isAcceptedAction).map((action) => ({
|
|
4131
4127
|
...action,
|
|
4132
4128
|
declaration: getCompleteActionDeclaration({}, event2, action),
|
|
4133
|
-
annotation: getCompleteActionAnnotation(
|
|
4129
|
+
annotation: getCompleteActionAnnotation(event2, action)
|
|
4134
4130
|
}));
|
|
4135
4131
|
}
|
|
4136
4132
|
var EXCLUDED_ACTIONS = [
|
|
@@ -5878,7 +5874,7 @@ function getActionAnnotation({
|
|
|
5878
5874
|
const action = (0, import_lodash3.findLast)(activeActions, (a) => a.type === actionType);
|
|
5879
5875
|
const actionWithCompleteAnnotation = action && {
|
|
5880
5876
|
...action,
|
|
5881
|
-
annotation: getCompleteActionAnnotation(
|
|
5877
|
+
annotation: getCompleteActionAnnotation(event2, action)
|
|
5882
5878
|
};
|
|
5883
5879
|
const matchingDraft = draft?.action.type === actionType ? draft : void 0;
|
|
5884
5880
|
const sortedActions = (0, import_lodash3.orderBy)(
|