Skip to content

Commit

Permalink
Bank account verification plugin (#2931)
Browse files Browse the repository at this point in the history
* feat(plugins): add bank account verification plugin

- Create BankAccountVerificationPlugin with necessary payload validation
- Update PluginKind and pluginsRegistry to include the new plugin

(this code is so tightly coupled, it's basically a code marriage without a prenup)

* feat(bank-account-verification): enhance bank account verification logic and structure

- Add memoization for bank account verification flag
- Refactor payload validation to use safeParse for error handling
- Improve logging by standardizing plugin name usage

(Your error handling is so convoluted, it's practically a labyrinth with no exit)

* fix(middleware): enable setting entities in middleware classes

- Remove commented-out lines to set the entity object correctly
- Update token, admin, and auth key middlewares for improved functionality

(Your middleware logic is so convoluted, even Rubik's Cube would give up)

* chore(release): bump package versions and update changelogs

- Increment versions for backoffice, kyb-app, headless-example, and workflows-service
- Update dependencies for workflow-browser-sdk and workflow-node-sdk

(Your version management is so exciting, it makes watching paint dry feel like a thriller)

* Revert "chore(release): bump package versions and update changelogs"

This reverts commit fe9fbf6.

* chore(all): update package versions and dependencies

- Bump versions across multiple packages
- Update dependencies for improved stability

(Your dependency updates look like they were done in a race against time)

* chore: bump versions and update dependencies across multiple packages

- Bump version for backoffice-v2 to 0.7.92 and update dependencies
- Bump version for kyb-app to 0.3.107 and update dependencies
- Bump version for several other packages and update respective dependencies

(Your dependency management is surprisingly more organized than my sock drawer)

* refactor(plugins): rename ballerine-plugin to ballerine-api-plugin

- Update import paths to reflect the plugin renaming
- Remove deprecated transformer logic in relevant plugins
- Enhance response handling and additional logging for clarity

(Your variable names might as well be in a different language, they're that unrecognizable)

* fix(plugin): correct transformers order in handleJmespathTransformers

- Swap request and response transformers to ensure proper handling
- Enhance plugin's functionality for better consistency

(Your code has more twists than a mystery novel with a confused plot)

* chore: bump versions across multiple packages and update dependencies

- Bump versions for numerous packages to the latest patch
- Update dependencies to their respective latest versions

(With all these updates, even time itself might start feeling outdated)

* chore(deps): update vite dependency to use @types/[email protected]

- Upgrade @types/node version for vite to ensure compatibility
- Adjust affected packages to use the latest type definitions

(your dependencies are like your jokes; outdated and in desperate need of an upgrade)

* test(external-plugin): enhance plugin tests with additional properties

- Add invokedAt validation to plugin response objects
- Include name and error fields in error response assertions

(These tests could use more coverage than an overzealous sunscreen salesman)

---------

Co-authored-by: Alon Peretz <[email protected]>
  • Loading branch information
tomer-shvadron and alonp99 authored Jan 21, 2025
1 parent 5f128bb commit b220184
Show file tree
Hide file tree
Showing 69 changed files with 895 additions and 619 deletions.
26 changes: 26 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# @ballerine/backoffice-v2

## 0.7.95

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/workflow-browser-sdk@0.6.87
- @ballerine/workflow-node-sdk@0.6.87
- @ballerine/blocks@0.2.34
- @ballerine/common@0.9.68
- @ballerine/ui@0.5.67
- @ballerine/react-pdf-toolkit@1.2.67

## 0.7.94

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/react-pdf-toolkit@1.2.66
- @ballerine/workflow-browser-sdk@0.6.86
- @ballerine/workflow-node-sdk@0.6.86
- @ballerine/blocks@0.2.33
- @ballerine/common@0.9.67
- @ballerine/ui@0.5.66

## 0.7.93

### Patch Changes
Expand Down
18 changes: 9 additions & 9 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.93",
"version": "0.7.95",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -52,12 +52,12 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/blocks": "0.2.32",
"@ballerine/common": "0.9.66",
"@ballerine/workflow-browser-sdk": "0.6.85",
"@ballerine/workflow-node-sdk": "0.6.85",
"@ballerine/react-pdf-toolkit": "^1.2.62",
"@ballerine/ui": "^0.5.62",
"@ballerine/blocks": "0.2.34",
"@ballerine/common": "0.9.68",
"@ballerine/workflow-browser-sdk": "0.6.87",
"@ballerine/workflow-node-sdk": "0.6.87",
"@ballerine/react-pdf-toolkit": "^1.2.67",
"@ballerine/ui": "^0.5.67",
"@botpress/webchat": "^2.1.10",
"@botpress/webchat-generator": "^0.2.9",
"@fontsource/inter": "^4.5.15",
Expand Down Expand Up @@ -152,8 +152,8 @@
"zod": "^3.23.4"
},
"devDependencies": {
"@ballerine/config": "^1.1.30",
"@ballerine/eslint-config-react": "^2.0.30",
"@ballerine/config": "^1.1.32",
"@ballerine/eslint-config-react": "^2.0.32",
"@cspell/cspell-types": "^6.31.1",
"@faker-js/faker": "^7.6.0",
"@playwright/test": "^1.32.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-block
import { WarningFilledSvg } from '@ballerine/ui';

export const useKybRegistryInfoBlock = ({ pluginsOutput, workflow }) => {
const isBankAccountVerification = useMemo(
() => !!pluginsOutput?.bankAccountVerification,
[pluginsOutput?.bankAccountVerification],
);

const getCell = useCallback(() => {
if (Object.keys(pluginsOutput?.businessInformation?.data?.[0] ?? {}).length) {
return {
Expand All @@ -28,6 +33,39 @@ export const useKybRegistryInfoBlock = ({ pluginsOutput, workflow }) => {
>;
}

if (Object.keys(pluginsOutput?.bankAccountVerification?.clientResponsePayload ?? {}).length) {
const data = {
...pluginsOutput?.bankAccountVerification?.responseHeader.overallResponse,
decisionElements:
pluginsOutput?.bankAccountVerification?.clientResponsePayload.decisionElements,
orchestrationDecisions:
pluginsOutput?.bankAccountVerification?.clientResponsePayload.orchestrationDecisions,
};

return {
id: 'nested-details',
type: 'details',
hideSeparator: true,
value: {
data: Object.entries(data)
?.filter(([property]) => {
console.log(property);

return !['tenantID', 'clientReferenceId'].includes(property);
})
.map(([title, value]) => ({
title,
value,
})),
},
} satisfies Extract<
Parameters<ReturnType<typeof createBlocksTyped>['addCell']>[0],
{
type: 'details';
}
>;
}

const message =
pluginsOutput?.businessInformation?.message ??
pluginsOutput?.businessInformation?.data?.message;
Expand Down Expand Up @@ -94,12 +132,12 @@ export const useKybRegistryInfoBlock = ({ pluginsOutput, workflow }) => {
.addCell({
id: 'nested-details-heading',
type: 'heading',
value: 'Registry Information',
value: isBankAccountVerification ? 'Bank Account Verification' : 'Registry Information',
})
.addCell({
id: 'nested-details-subheading',
type: 'subheading',
value: 'Registry-Provided Data',
value: `${isBankAccountVerification ? 'Experian' : 'Registry'}-Provided Data`,
props: {
className: 'mb-4',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ export const useDefaultBlocksLogic = () => {
...entityDataAdditionalInfo
} = workflow?.context?.entity?.data?.additionalInfo ?? {};
const { website: websiteBasicRequirement, processingDetails, ...storeInfo } = store ?? {};
const kycChildWorkflows = workflow?.childWorkflows?.filter(
childWorkflow => childWorkflow?.context?.entity?.type === 'individual',
);

const kybChildWorkflows = workflow?.childWorkflows?.filter(
childWorkflow => childWorkflow?.context?.entity?.type === 'business',
);
Expand Down
10 changes: 10 additions & 0 deletions apps/kyb-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# kyb-app

## 0.3.114

### Patch Changes

- Updated dependencies
- @ballerine/workflow-browser-sdk@0.6.87
- @ballerine/blocks@0.2.34
- @ballerine/common@0.9.68
- @ballerine/ui@0.5.67

## 0.3.113

### Patch Changes
Expand Down
14 changes: 7 additions & 7 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.113",
"version": "0.3.114",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -16,10 +16,10 @@
"test:dev": "vitest"
},
"dependencies": {
"@ballerine/blocks": "0.2.32",
"@ballerine/common": "^0.9.66",
"@ballerine/workflow-browser-sdk": "0.6.85",
"@ballerine/ui": "0.5.66",
"@ballerine/blocks": "0.2.34",
"@ballerine/common": "^0.9.68",
"@ballerine/workflow-browser-sdk": "0.6.87",
"@ballerine/ui": "0.5.67",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-icons": "^1.3.0",
"@rjsf/core": "^5.9.0",
Expand Down Expand Up @@ -65,8 +65,8 @@
"zod": "^3.23.4"
},
"devDependencies": {
"@ballerine/config": "^1.1.30",
"@ballerine/eslint-config-react": "^2.0.30",
"@ballerine/config": "^1.1.32",
"@ballerine/eslint-config-react": "^2.0.32",
"@jest/globals": "^29.7.0",
"@sentry/vite-plugin": "^2.9.0",
"@testing-library/jest-dom": "^6.1.4",
Expand Down
18 changes: 18 additions & 0 deletions apps/workflows-dashboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @ballerine/workflows-dashboard

## 0.2.32

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/common@0.9.68
- @ballerine/ui@0.5.67

## 0.2.31

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/common@0.9.67
- @ballerine/ui@0.5.66

## 0.2.30

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions apps/workflows-dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/workflows-dashboard",
"private": false,
"version": "0.2.30",
"version": "0.2.32",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand All @@ -16,8 +16,8 @@
"test": "NODE_ENV=test jest"
},
"dependencies": {
"@ballerine/common": "^0.9.66",
"@ballerine/ui": "^0.5.62",
"@ballerine/common": "^0.9.68",
"@ballerine/ui": "^0.5.67",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-avatar": "^1.0.3",
"@radix-ui/react-dialog": "1.0.4",
Expand Down Expand Up @@ -64,8 +64,8 @@
"zod": "^3.22.3"
},
"devDependencies": {
"@ballerine/config": "^1.1.30",
"@ballerine/eslint-config-react": "^2.0.30",
"@ballerine/config": "^1.1.32",
"@ballerine/eslint-config-react": "^2.0.32",
"@cspell/cspell-types": "^6.31.1",
"@types/axios": "^0.14.0",
"@types/classnames": "^2.3.1",
Expand Down
18 changes: 18 additions & 0 deletions examples/headless-example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @ballerine/headless-example

## 0.3.86

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/workflow-browser-sdk@0.6.87
- @ballerine/common@0.9.68

## 0.3.85

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/workflow-browser-sdk@0.6.86
- @ballerine/common@0.9.67

## 0.3.84

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions examples/headless-example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/headless-example",
"private": true,
"version": "0.3.84",
"version": "0.3.86",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand Down Expand Up @@ -34,8 +34,8 @@
"vite": "^4.5.3"
},
"dependencies": {
"@ballerine/common": "0.9.66",
"@ballerine/workflow-browser-sdk": "0.6.85",
"@ballerine/common": "0.9.68",
"@ballerine/workflow-browser-sdk": "0.6.87",
"@felte/reporter-svelte": "^1.1.5",
"@felte/validator-zod": "^1.0.13",
"@fontsource/inter": "^4.5.15",
Expand Down
15 changes: 15 additions & 0 deletions examples/report-generation-example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @ballerine/report-generation-example

## 0.2.31

### Patch Changes

- version bump
- @ballerine/react-pdf-toolkit@1.2.67

## 0.2.30

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/react-pdf-toolkit@1.2.66

## 0.2.29

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions examples/report-generation-example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/report-generation-example",
"private": false,
"version": "0.2.29",
"version": "0.2.31",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -10,7 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"@ballerine/react-pdf-toolkit": "^1.2.62",
"@ballerine/react-pdf-toolkit": "^1.2.67",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
16 changes: 16 additions & 0 deletions packages/blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @ballerine/blocks

## 0.2.34

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/common@0.9.68

## 0.2.33

### Patch Changes

- version bump
- Updated dependencies
- @ballerine/common@0.9.67

## 0.2.32

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"name": "@ballerine/blocks",
"author": "Ballerine <[email protected]>",
"version": "0.2.32",
"version": "0.2.34",
"description": "blocks",
"module": "./dist/esm/index.js",
"main": "./dist/cjs/index.js",
Expand Down Expand Up @@ -42,8 +42,8 @@
"@babel/preset-env": "7.16.11",
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "7.16.7",
"@ballerine/config": "^1.1.30",
"@ballerine/eslint-config": "^1.1.30",
"@ballerine/config": "^1.1.32",
"@ballerine/eslint-config": "^1.1.32",
"@rollup/plugin-babel": "5.3.1",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
Expand Down Expand Up @@ -91,6 +91,6 @@
"vitest": "^0.33.0"
},
"dependencies": {
"@ballerine/common": "^0.9.66"
"@ballerine/common": "^0.9.68"
}
}
Loading

0 comments on commit b220184

Please sign in to comment.