Skip to content

Commit

Permalink
Blokh/feat/decistion persistence (#961)
Browse files Browse the repository at this point in the history
* fixed flow handling for decistion

* added === instead of ==
  • Loading branch information
Blokh authored Aug 23, 2023
1 parent cef3cda commit f70781a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions examples/kyb-app/src/domains/collection-flow/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export interface Document {
properties: object;
category: string;
type: string;
decision?: {
status?: string;
revisionReason?: string;
rejectionReason?: string;
};
}

export interface UBO {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const selectDocuments = (
return {
...doc,
id: existingDocument.id,
decision: doc?.decision?.status === 'approved' ? doc.decision : undefined,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ export const useBaseFlow = () => {
setLoading(true);

await uploadFilesAndSaveToStorage(documentConfigurations, context);
const documents = await selectDocuments(context, flowData.documents, documentConfigurations);

const updatePayload: UpdateFlowDto = {
flowId: context.shared.workflowId,
flowType: import.meta.env.VITE_KYB_DEFINITION_ID,
payload: {
mainRepresentative: selectMainRepresentative(context, user),
ubos: selectUbos(context, user),
documents: await selectDocuments(context, flowData.documents, documentConfigurations),
documents: documents,
dynamicData: assignFileIdsToFlowData(context, documentConfigurations).flowData,
flowState: views.at(-1).key,
entityData: selectEntityData(context, customer),
Expand Down

0 comments on commit f70781a

Please sign in to comment.