Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @ballerine/backoffice-v2

## 0.7.171

### Patch Changes

- Updated dependencies
- @ballerine/[email protected]
- @ballerine/[email protected]

## 0.7.170

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions apps/backoffice-v2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ballerine/backoffice-v2",
"version": "0.7.170",
"version": "0.7.171",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -52,8 +52,8 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/react-pdf-toolkit": "^1.2.130",
"@ballerine/ui": "0.7.169",
"@ballerine/react-pdf-toolkit": "^1.2.131",
"@ballerine/ui": "0.7.171",
"@ballerine/blocks": "0.2.47",
"@ballerine/common": "0.9.118",
"@ballerine/workflow-browser-sdk": "0.6.142",
Expand Down
8 changes: 8 additions & 0 deletions apps/kyb-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# kyb-app

## 0.3.200

### Patch Changes

- Bump
- Updated dependencies
- @ballerine/[email protected]

## 0.3.199

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions apps/kyb-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/kyb-app",
"private": true,
"version": "0.3.199",
"version": "0.3.200",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -18,7 +18,7 @@
"dependencies": {
"@ballerine/blocks": "0.2.47",
"@ballerine/common": "^0.9.118",
"@ballerine/ui": "0.7.169",
"@ballerine/ui": "0.7.171",
"@ballerine/workflow-browser-sdk": "0.6.142",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-icons": "^1.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ export const CollectionFlowUI: FunctionComponent<ICollectionFlowUIProps> = ({
});
}

setCollectionFlowStatus(values, CollectionFlowStatusesEnum.inprogress);
if (values.collectionFlow?.state?.status === CollectionFlowStatusesEnum.pending) {
setCollectionFlowStatus(values, CollectionFlowStatusesEnum.inprogress);
}

stateApi.setContext(values);

Expand Down
7 changes: 7 additions & 0 deletions packages/react-pdf-toolkit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @ballerine/react-pdf-toolkit

## 1.2.131

### Patch Changes

- Updated dependencies
- @ballerine/[email protected]

## 1.2.130

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-pdf-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/react-pdf-toolkit",
"private": false,
"version": "1.2.130",
"version": "1.2.131",
"types": "./dist/build.d.ts",
"main": "./dist/react-pdf-toolkit.js",
"module": "./dist/react-pdf-toolkit.mjs",
Expand All @@ -27,7 +27,7 @@
},
"dependencies": {
"@ballerine/config": "^1.1.44",
"@ballerine/ui": "0.7.169",
"@ballerine/ui": "0.7.171",
"@react-pdf/renderer": "^3.1.14",
"@sinclair/typebox": "^0.31.7",
"ajv": "^8.12.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ballerine/ui

## 0.7.171

### Patch Changes

- Bump

## 0.7.169

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/ui",
"private": false,
"version": "0.7.169",
"version": "0.7.171",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const Checkbox = React.forwardRef<
<Root
ref={ref}
className={ctw(
'border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer h-4 w-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
'border-slate-900 ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-white data-[state=checked]:text-slate-900 peer h-4 w-4 shrink-0 rounded-sm border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className,
)}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
AnyRecord,
CollectionFlowStatusesEnum,
CollectionFlowStepStatesEnum,
DefaultContextSchema,
TCollectionFlowState,
TCollectionFlowStep,
} from '@ballerine/common';
Expand Down Expand Up @@ -157,38 +158,53 @@ export class CollectionFlowController {
@common.Post('/final-submission')
async finalSubmission(@TokenScope() tokenScope: ITokenScope, @common.Body() body: FinishFlowDto) {
try {
await this.collectionFlowStateService.updateCollectionFlowState(
const { eventName, context } = body;

const collectionFlowState = (context.collectionFlow as AnyRecord)
.state as TCollectionFlowState;

if (collectionFlowState?.status === CollectionFlowStatusesEnum.edit) {
const pluginsOutput = this.collectionFlowService.removePluginsOutput({
context: context as DefaultContextSchema,
plugins: [
'businessInformation',
'companySanctions',
'merchantScreening',
'merchantMonitoring',
'riskEvaluation',
],
});

context.pluginsOutput = pluginsOutput;
}

await this.workflowService.updateWorkflowRuntimeData(
tokenScope.workflowRuntimeDataId,
{
...((body.context.collectionFlow as AnyRecord).state as TCollectionFlowState),
steps: (
(body.context.collectionFlow as AnyRecord).state as TCollectionFlowState
).steps.map((step: TCollectionFlowStep) => ({
...step,
state: CollectionFlowStepStatesEnum.completed,
})),
status: CollectionFlowStatusesEnum.completed,
context,
},
[tokenScope.projectId],
tokenScope.projectId,
);

await this.workflowService.event(
await this.collectionFlowStateService.updateCollectionFlowState(
tokenScope.workflowRuntimeDataId,
{
id: tokenScope.workflowRuntimeDataId,
name: body.eventName,
...((context.collectionFlow as AnyRecord).state as TCollectionFlowState),
steps: ((context.collectionFlow as AnyRecord).state as TCollectionFlowState).steps.map(
(step: TCollectionFlowStep) => ({
...step,
state: CollectionFlowStepStatesEnum.completed,
}),
),
status: CollectionFlowStatusesEnum.completed,
},
[tokenScope.projectId],
tokenScope.projectId,
);

return this.workflowService.event(
{
id: tokenScope.workflowRuntimeDataId,
name: BUILT_IN_EVENT.DEEP_MERGE_CONTEXT,
payload: {
newContext: body.context,
arrayMergeOption: ARRAY_MERGE_OPTION.REPLACE,
},
name: eventName,
},
[tokenScope.projectId],
tokenScope.projectId,
Expand All @@ -198,6 +214,7 @@ export class CollectionFlowController {
throw error;
}

this.appLogger.error(error);
try {
await this.workflowService.event(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,14 @@ export class CollectionFlowService {
{ shouldDownloadFromSource: false },
);
}

removePluginsOutput({ context, plugins }: { context: DefaultContextSchema; plugins: string[] }) {
const pluginsOutput = structuredClone(context.pluginsOutput || {});

plugins.forEach(pluginName => {
delete pluginsOutput[pluginName as keyof typeof pluginsOutput];
});

return pluginsOutput;
}
}
Loading