@opencrvs/toolkit 2.0.0-rc.6f16968 → 2.0.0-rc.6f77a66
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Action, RequestedCorrectionAction } from '../ActionDocument';
|
|
1
2
|
import { Flag, CustomFlag } from '../Flag';
|
|
2
3
|
import { EventConfig } from '../EventConfig';
|
|
3
4
|
import { EventDocument } from '../EventDocument';
|
|
5
|
+
export declare function findPendingCorrectionAction(writeActions: Action[]): RequestedCorrectionAction | undefined;
|
|
4
6
|
/**
|
|
5
7
|
* This function resolves custom flags for an event based on its actions.
|
|
6
8
|
* Flags are not stored to the event state or any database directly, instead they are always computed/evaluated from the event actions.
|
package/dist/events/index.js
CHANGED
|
@@ -6388,19 +6388,22 @@ var import_date_fns3 = require("date-fns");
|
|
|
6388
6388
|
function isEditInProgress(actions) {
|
|
6389
6389
|
return actions.at(-1)?.type === ActionType.EDIT;
|
|
6390
6390
|
}
|
|
6391
|
-
function
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
return false;
|
|
6391
|
+
function findPendingCorrectionAction(writeActions2) {
|
|
6392
|
+
let correctionRequestAction;
|
|
6393
|
+
for (let i = writeActions2.length - 1; i >= 0; i--) {
|
|
6394
|
+
const action = writeActions2[i];
|
|
6395
|
+
if (action.type === ActionType.APPROVE_CORRECTION || action.type === ActionType.REJECT_CORRECTION) {
|
|
6396
|
+
break;
|
|
6398
6397
|
}
|
|
6399
|
-
if (type === ActionType.
|
|
6400
|
-
|
|
6398
|
+
if (action.type === ActionType.REQUEST_CORRECTION && action.status === ActionStatus.Accepted) {
|
|
6399
|
+
correctionRequestAction = action;
|
|
6400
|
+
break;
|
|
6401
6401
|
}
|
|
6402
|
-
|
|
6403
|
-
|
|
6402
|
+
}
|
|
6403
|
+
return correctionRequestAction;
|
|
6404
|
+
}
|
|
6405
|
+
function isCorrectionRequested(actions) {
|
|
6406
|
+
return findPendingCorrectionAction(actions) !== void 0;
|
|
6404
6407
|
}
|
|
6405
6408
|
function isDeclarationIncomplete(actions) {
|
|
6406
6409
|
return getStatusFromActions(actions) === EventStatus.enum.NOTIFIED;
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|