Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bank account verification plugin #2931

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
11 changes: 11 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @ballerine/backoffice-v2

## 0.7.91

### Patch Changes

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

## 0.7.90

### Patch Changes
Expand Down
10 changes: 5 additions & 5 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.90",
"version": "0.7.91",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -54,10 +54,10 @@
"dependencies": {
"@ballerine/blocks": "0.2.30",
"@ballerine/common": "0.9.63",
"@ballerine/workflow-browser-sdk": "0.6.82",
"@ballerine/workflow-node-sdk": "0.6.82",
"@ballerine/react-pdf-toolkit": "^1.2.59",
"@ballerine/ui": "^0.5.59",
"@ballerine/workflow-browser-sdk": "0.6.83",
"@ballerine/workflow-node-sdk": "0.6.83",
"@ballerine/react-pdf-toolkit": "^1.2.60",
"@ballerine/ui": "^0.5.60",
"@botpress/webchat": "^2.1.10",
"@botpress/webchat-generator": "^0.2.9",
"@fontsource/inter": "^4.5.15",
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
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.106

### Patch Changes

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

## 0.3.105

### Patch Changes
Expand Down
6 changes: 3 additions & 3 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.105",
"version": "0.3.106",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -18,8 +18,8 @@
"dependencies": {
"@ballerine/blocks": "0.2.30",
"@ballerine/common": "^0.9.63",
"@ballerine/workflow-browser-sdk": "0.6.82",
"@ballerine/ui": "0.5.59",
"@ballerine/workflow-browser-sdk": "0.6.83",
"@ballerine/ui": "0.5.60",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-icons": "^1.3.0",
"@rjsf/core": "^5.9.0",
Expand Down
6 changes: 6 additions & 0 deletions examples/headless-example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ballerine/headless-example

## 0.3.82

### Patch Changes

- @ballerine/[email protected]

## 0.3.81

### Patch Changes
Expand Down
4 changes: 2 additions & 2 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.81",
"version": "0.3.82",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand Down Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"@ballerine/common": "0.9.63",
"@ballerine/workflow-browser-sdk": "0.6.82",
"@ballerine/workflow-browser-sdk": "0.6.83",
"@felte/reporter-svelte": "^1.1.5",
"@felte/validator-zod": "^1.0.13",
"@fontsource/inter": "^4.5.15",
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.60

### Patch Changes

- Updated dependencies
- @ballerine/[email protected]

## 1.2.59

### 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.59",
"version": "1.2.60",
"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.28",
"@ballerine/ui": "0.5.59",
"@ballerine/ui": "0.5.60",
tomer-shvadron marked this conversation as resolved.
Show resolved Hide resolved
"@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.5.60

### Patch Changes

- version bump

## 0.5.59

### 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.5.59",
"version": "0.5.60",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/atoms/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const TooltipContent = React.forwardRef<
ref={ref}
sideOffset={sideOffset}
className={ctw(
'z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
'bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs',
className,
)}
{...props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const AdsAndSocialMedia: FunctionComponent<AdsAndSocialMediaProps> = ({

{page ? (
<div className="flex justify-between gap-4">
<div className="min-w-0 grow-0 w-2/3">
<div className="w-2/3 min-w-0 grow-0">
<div className="flex items-center">
<LinkIcon className="h-5 w-5 text-gray-400" />
<a
Expand All @@ -140,7 +140,7 @@ export const AdsAndSocialMedia: FunctionComponent<AdsAndSocialMediaProps> = ({
</span>
)}

<div className="flex gap-6 mt-8">
<div className="mt-8 flex gap-6">
<div className="flex flex-col gap-4">
{Object.entries(socialMediaMapper[provider].fields).map(
([, { icon, label }]) => (
Expand All @@ -152,7 +152,7 @@ export const AdsAndSocialMedia: FunctionComponent<AdsAndSocialMediaProps> = ({
)}
</div>

<div className="flex flex-col gap-4 min-w-0">
<div className="flex min-w-0 flex-col gap-4">
{Object.entries(socialMediaMapper[provider].fields).map(
([field, { label }]) => {
const value = rest[field as keyof typeof rest];
Expand All @@ -161,7 +161,7 @@ export const AdsAndSocialMedia: FunctionComponent<AdsAndSocialMediaProps> = ({
<TextWithNAFallback
key={label}
className={ctw(
'overflow-hidden text-ellipsis max-w-full',
'max-w-full overflow-hidden text-ellipsis',
!value && 'text-gray-400',
label !== 'Biography' && 'whitespace-nowrap',
)}
Expand All @@ -179,7 +179,7 @@ export const AdsAndSocialMedia: FunctionComponent<AdsAndSocialMediaProps> = ({
className={buttonVariants({
variant: 'link',
className:
'h-[unset] cursor-pointer !p-0 !text-[#14203D] underline decoration-[1.5px] w-1/3',
'h-[unset] w-1/3 cursor-pointer !p-0 !text-[#14203D] underline decoration-[1.5px]',
})}
href={link}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const BusinessReportSummary: FunctionComponent<{

{homepageScreenshotUrl && (
<Card className={'col-span-2 overflow-hidden'}>
<div className={'flex flex-col h-full relative'}>
<div className={'relative flex h-full flex-col'}>
<a
href={homepageScreenshotUrl}
target={'_blank'}
Expand Down
Loading
Loading