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

Bal 3035 #2986

Merged
merged 9 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 8 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
14 changes: 14 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @ballerine/backoffice-v2

## 0.7.97

### Patch Changes

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

## 0.7.96

### Patch Changes

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

## 0.7.95

### 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.95",
"version": "0.7.97",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"type": "module",
Expand Down Expand Up @@ -54,8 +54,8 @@
"dependencies": {
"@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/workflow-browser-sdk": "0.6.89",
"@ballerine/workflow-node-sdk": "0.6.89",
"@ballerine/react-pdf-toolkit": "^1.2.67",
"@ballerine/ui": "^0.5.67",
"@botpress/webchat": "^2.1.10",
Expand Down
11 changes: 11 additions & 0 deletions apps/backoffice-v2/src/domains/workflows/fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ export const BaseWorkflowByIdSchema = z.object({
})
.passthrough()
.optional(),
pluginsInput: z
.object({
merchantScreening: z
.object({
requestPayload: z.record(z.string(), z.unknown()).optional(),
})
.passthrough()
.optional(),
})
.passthrough()
.optional(),
metadata: z
.object({
collectionFlowUrl: z.string().url().optional(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { createColumnHelper } from '@tanstack/react-table';
import { Button } from '@/common/components/atoms/Button/Button';
import { ChevronDown } from 'lucide-react';
import { ctw } from '@/common/utils/ctw/ctw';
import { JsonDialog, TextWithNAFallback, WarningFilledSvg } from '@ballerine/ui';
import { IndicatorCircle } from '@/common/components/atoms/IndicatorCircle/IndicatorCircle';
import React from 'react';
import { ctw } from '@/common/utils/ctw/ctw';
import { IMerchantScreening } from '@/lib/blocks/hooks/useMerchantScreeningBlock/interfaces';
import { isObject, MatchReasonCode } from '@ballerine/common';
import { JsonDialog, TextWithNAFallback, WarningFilledSvg } from '@ballerine/ui';
import { createColumnHelper } from '@tanstack/react-table';
import { ChevronDown } from 'lucide-react';

const columnHelper = createColumnHelper<IMerchantScreening>();

Expand All @@ -15,6 +14,7 @@ const summaryColumnHelper = createColumnHelper<{
numberOfInquiries: number;
checkDate: string;
fullJsonData: string;
merchantScreeningInput: Record<PropertyKey, unknown>;
}>();

export const terminatedMatchedMerchantsColumns = [
Expand Down Expand Up @@ -123,8 +123,28 @@ export const terminatedMatchedMerchantsSummaryColumns = [
return <TextWithNAFallback>{checkDate}</TextWithNAFallback>;
},
}),
summaryColumnHelper.accessor('merchantScreeningInput', {
header: 'Checked Properties',
cell: info => {
const fullJsonData = info.getValue();

return (
<div className={`flex items-end justify-start`}>
<JsonDialog
buttonProps={{
variant: 'link',
className: 'p-0 text-blue-500',
disabled: !isObject(fullJsonData) && !Array.isArray(fullJsonData),
}}
dialogButtonText={`View`}
json={JSON.stringify(fullJsonData)}
/>
</div>
);
},
}),
summaryColumnHelper.accessor('fullJsonData', {
header: 'Full JSON Data',
header: 'Results',
cell: info => {
const fullJsonData = info.getValue();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import React, { useMemo } from 'react';
import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-blocks-typed';
import { IndicatorCircle } from '@/common/components/atoms/IndicatorCircle/IndicatorCircle';
import { ReadOnlyDetail } from '@/common/components/atoms/ReadOnlyDetail/ReadOnlyDetail';
import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-blocks-typed';
import { useMemo } from 'react';

import { IMerchantScreening } from '@/lib/blocks/hooks/useMerchantScreeningBlock/interfaces';
import { ctw } from '@/common/utils/ctw/ctw';
import {
inquiredMatchedMerchantsColumns,
terminatedMatchedMerchantsColumns,
terminatedMatchedMerchantsSummaryColumns,
} from '@/lib/blocks/hooks/useMerchantScreeningBlock/columns';
import { toTitleCase } from 'string-ts';
import { formatValue } from '@/lib/blocks/hooks/useMerchantScreeningBlock/format-value';
import { IMerchantScreening } from '@/lib/blocks/hooks/useMerchantScreeningBlock/interfaces';
import { isObject, safeEvery } from '@ballerine/common';
import { ctw } from '@/common/utils/ctw/ctw';
import { JsonDialog } from '@ballerine/ui';
import { toTitleCase } from 'string-ts';

export const useMerchantScreeningBlock = ({
terminatedMatchedMerchants,
inquiredMatchedMerchants,
merchantScreeningInput,
logoUrl = 'https://cdn.ballerine.io/logos/Mastercard%20logo.svg',
rawData,
checkDate,
}: {
terminatedMatchedMerchants: IMerchantScreening[];
inquiredMatchedMerchants: IMerchantScreening[];
merchantScreeningInput: Record<PropertyKey, unknown>;
logoUrl: string;
rawData: Record<PropertyKey, unknown>;
checkDate: string;
Expand Down Expand Up @@ -73,6 +75,7 @@ export const useMerchantScreeningBlock = ({
terminatedMatches: terminatedMatchedMerchants?.length ?? 0,
numberOfInquiries: inquiredMatchedMerchants?.length ?? 0,
checkDate,
merchantScreeningInput: merchantScreeningInput ?? {},
fullJsonData: rawData ?? {},
},
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import { MotionButton } from '@/common/components/molecules/MotionButton/MotionButton';
import { useSearchParamsByEntity } from '@/common/hooks/useSearchParamsByEntity/useSearchParamsByEntity';
import { ctw } from '@/common/utils/ctw/ctw';
import { omitPropsFromObjectWhitelist } from '@/common/utils/omit-props-from-object-whitelist/omit-props-from-object-whitelist';
import { useAuthenticatedUserQuery } from '@/domains/auth/hooks/queries/useAuthenticatedUserQuery/useAuthenticatedUserQuery';
import { useRevisionTaskByIdMutation } from '@/domains/entities/hooks/mutations/useRevisionTaskByIdMutation/useRevisionTaskByIdMutation';
import { useStorageFilesQuery } from '@/domains/storage/hooks/queries/useStorageFilesQuery/useStorageFilesQuery';
import { TWorkflowById } from '@/domains/workflows/fetchers';
import { useEventMutation } from '@/domains/workflows/hooks/mutations/useEventMutation/useEventMutation';
import { useAmlBlock } from '@/lib/blocks/components/AmlBlock/hooks/useAmlBlock/useAmlBlock';
import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-blocks-typed';
import { useAddressBlock } from '@/lib/blocks/hooks/useAddressBlock/useAddressBlock';
import { useAssociatedCompaniesInformationBlock } from '@/lib/blocks/hooks/useAssociatedCompaniesInformationBlock/useAssociatedCompaniesInformationBlock';
import { associatedCompanyAdapter } from '@/lib/blocks/hooks/useAssosciatedCompaniesBlock/associated-company-adapter';
import { associatedCompanyToWorkflowAdapter } from '@/lib/blocks/hooks/useAssosciatedCompaniesBlock/associated-company-to-workflow-adapter';
import {
motionButtonProps,
useAssociatedCompaniesBlock,
} from '@/lib/blocks/hooks/useAssosciatedCompaniesBlock/useAssociatedCompaniesBlock';
import { useBankingDetailsBlock } from '@/lib/blocks/hooks/useBankingDetailsBlock/useBankingDetailsBlock';
import { useCaseInfoBlock } from '@/lib/blocks/hooks/useCaseInfoBlock/useCaseInfoBlock';
import { useCaseOverviewBlock } from '@/lib/blocks/hooks/useCaseOverviewBlock/useCaseOverviewBlock';
import { useCompanySanctionsBlock } from '@/lib/blocks/hooks/useCompanySanctionsBlock/useCompanySanctionsBlock';
import { useDirectorsBlocks } from '@/lib/blocks/hooks/useDirectorsBlocks';
import { useDirectorsRegistryProvidedBlock } from '@/lib/blocks/hooks/useDirectorsRegistryProvidedBlock/useDirectorsRegistryProvidedBlock';
Expand All @@ -24,6 +32,8 @@ import { useKybRegistryInfoBlock } from '@/lib/blocks/hooks/useKybRegistryInfoBl
import { useMainContactBlock } from '@/lib/blocks/hooks/useMainContactBlock/useMainContactBlock';
import { useMainRepresentativeBlock } from '@/lib/blocks/hooks/useMainRepresentativeBlock/useMainRepresentativeBlock';
import { useMapBlock } from '@/lib/blocks/hooks/useMapBlock/useMapBlock';
import { useMerchantScreeningBlock } from '@/lib/blocks/hooks/useMerchantScreeningBlock/useMerchantScreeningBlock';
import { useObjectEntriesBlock } from '@/lib/blocks/hooks/useObjectEntriesBlock/useObjectEntriesBlock';
import { useProcessingDetailsBlock } from '@/lib/blocks/hooks/useProcessingDetailsBlock/useProcessingDetailsBlock';
import { useRegistryInfoBlock } from '@/lib/blocks/hooks/useRegistryInfoBlock/useRegistryInfoBlock';
import { useStoreInfoBlock } from '@/lib/blocks/hooks/useStoreInfoBlock/useStoreInfoBlock';
Expand All @@ -32,32 +42,22 @@ import { useUbosUserProvidedBlock } from '@/lib/blocks/hooks/useUbosUserProvided
import { useWebsiteBasicRequirementBlock } from '@/lib/blocks/hooks/useWebsiteBasicRequirementBlock/useWebsiteBasicRequirementBlock';
import { useWebsiteMonitoringBlock } from '@/lib/blocks/hooks/useWebsiteMonitoringBlock/useWebsiteMonitoringBlock';
import { useCaseBlocks } from '@/lib/blocks/variants/DefaultBlocks/hooks/useCaseBlocksLogic/useCaseBlocks';
import { useWebsiteMonitoringReportBlock } from '@/lib/blocks/variants/WebsiteMonitoringBlocks/hooks/useWebsiteMonitoringReportBlock/useWebsiteMonitoringReportBlock';
import { useCaseDecision } from '@/pages/Entity/components/Case/hooks/useCaseDecision/useCaseDecision';
import { useCaseState } from '@/pages/Entity/components/Case/hooks/useCaseState/useCaseState';
import { getAddressDeep } from '@/pages/Entity/hooks/useEntityLogic/utils/get-address-deep/get-address-deep';
import { selectDirectorsDocuments } from '@/pages/Entity/selectors/selectDirectorsDocuments';
import { Send } from 'lucide-react';
import { useMemo } from 'react';
import { useWebsiteMonitoringReportBlock } from '@/lib/blocks/variants/WebsiteMonitoringBlocks/hooks/useWebsiteMonitoringReportBlock/useWebsiteMonitoringReportBlock';
import { createBlocksTyped } from '@/lib/blocks/create-blocks-typed/create-blocks-typed';
import { useAddressBlock } from '@/lib/blocks/hooks/useAddressBlock/useAddressBlock';
import { getAddressDeep } from '@/pages/Entity/hooks/useEntityLogic/utils/get-address-deep/get-address-deep';
import { useCaseOverviewBlock } from '@/lib/blocks/hooks/useCaseOverviewBlock/useCaseOverviewBlock';
import { useSearchParamsByEntity } from '@/common/hooks/useSearchParamsByEntity/useSearchParamsByEntity';
import { useLocation } from 'react-router-dom';
import { omitPropsFromObjectWhitelist } from '@/common/utils/omit-props-from-object-whitelist/omit-props-from-object-whitelist';
import { useObjectEntriesBlock } from '@/lib/blocks/hooks/useObjectEntriesBlock/useObjectEntriesBlock';
import { useAmlBlock } from '@/lib/blocks/components/AmlBlock/hooks/useAmlBlock/useAmlBlock';
import { associatedCompanyToWorkflowAdapter } from '@/lib/blocks/hooks/useAssosciatedCompaniesBlock/associated-company-to-workflow-adapter';
import { useMerchantScreeningBlock } from '@/lib/blocks/hooks/useMerchantScreeningBlock/useMerchantScreeningBlock';
import { TWorkflowById } from '@/domains/workflows/fetchers';

const registryInfoWhitelist = ['open_corporates'] as const;

import { Button } from '@ballerine/ui';
import { useManageUbosBlock } from '@/lib/blocks/hooks/useManageUbosBlock/useManageUbosBlock';
import { useCurrentCaseQuery } from '@/pages/Entity/hooks/useCurrentCaseQuery/useCurrentCaseQuery';
import { toast } from 'sonner';
import { Button } from '@ballerine/ui';
import { useCallback } from 'react';
import { useManageUbosBlock } from '@/lib/blocks/hooks/useManageUbosBlock/useManageUbosBlock';
import { toast } from 'sonner';

export const useDefaultBlocksLogic = () => {
const [{ activeTab }] = useSearchParamsByEntity();
Expand Down Expand Up @@ -469,6 +469,8 @@ export const useDefaultBlocksLogic = () => {
inquiredMatchedMerchants:
workflow?.context?.pluginsOutput?.merchantScreening?.processed?.inquiredMatchedMerchants ??
[],
merchantScreeningInput:
workflow?.context?.pluginsInput?.merchantScreening?.requestPayload || {},
logoUrl: workflow?.context?.pluginsOutput?.merchantScreening?.logoUrl,
rawData: workflow?.context?.pluginsOutput?.merchantScreening?.raw,
checkDate: workflow?.context?.pluginsOutput?.merchantScreening?.processed?.checkDate,
Expand Down
12 changes: 12 additions & 0 deletions apps/kyb-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# kyb-app

## 0.3.116

### Patch Changes

- @ballerine/[email protected]

## 0.3.115

### Patch Changes

- @ballerine/[email protected]

## 0.3.114

### 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.114",
"version": "0.3.116",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -18,7 +18,7 @@
"dependencies": {
"@ballerine/blocks": "0.2.34",
"@ballerine/common": "^0.9.68",
"@ballerine/workflow-browser-sdk": "0.6.87",
"@ballerine/workflow-browser-sdk": "0.6.89",
"@ballerine/ui": "0.5.67",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-icons": "^1.3.0",
Expand Down
12 changes: 12 additions & 0 deletions examples/headless-example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @ballerine/headless-example

## 0.3.88

### Patch Changes

- @ballerine/[email protected]

## 0.3.87

### Patch Changes

- @ballerine/[email protected]

## 0.3.86

### 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.86",
"version": "0.3.88",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand Down Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"@ballerine/common": "0.9.68",
"@ballerine/workflow-browser-sdk": "0.6.87",
"@ballerine/workflow-browser-sdk": "0.6.89",
"@felte/reporter-svelte": "^1.1.5",
"@felte/validator-zod": "^1.0.13",
"@fontsource/inter": "^4.5.15",
Expand Down
12 changes: 12 additions & 0 deletions packages/workflow-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @ballerine/workflow-core

## 0.6.89

### Patch Changes

- Updated workflow-core

## 0.6.88

### Patch Changes

- Added pluginsInput with requestPayload per plugins & invokedAt now disablable

## 0.6.87

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ballerine/workflow-core",
"author": "Ballerine <[email protected]>",
"version": "0.6.87",
"version": "0.6.89",
"description": "workflow-core",
"module": "./dist/esm/index.js",
"main": "./dist/cjs/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, it } from 'vitest';
import { WorkflowRunner } from '../../workflow-runner';
import { WorkflowRunnerArgs } from '../../types';
import { ISerializableHttpPluginParams } from './types';
import { ProcessStatus } from '@ballerine/common';
import { describe, expect, it } from 'vitest';
import { WorkflowRunnerArgs } from '../../../types';
Omri-Levy marked this conversation as resolved.
Show resolved Hide resolved
import { WorkflowRunner } from '../../../workflow-runner';
import { ISerializableHttpPluginParams } from '../types';

const createWorkflowRunner = (
definition: WorkflowRunnerArgs['definition'],
Expand Down
Loading
Loading