Skip to content

Commit

Permalink
feat: email plugins support (#2611)
Browse files Browse the repository at this point in the history
* feat: email plugins support

* chore: remove todo

* fix: fetch customer secret from external provider

* fix: improve check using includes

* fix: improve readability

* fix: improve secret replace

* fix: remove error stacktrace

* fix: remove error stacktrace

* fix: replace INVITATION typo

* fix: reset data migration

* fix: fix plugins secrets

* chore: fix plugin registry info issues

* fix: additional plugins

* feat: fix data mapping

* fix: webhook

* fix: circular dependency

* fix: circular dependency 2

* fix: plugin on client side

* fix: changes for plugins

* feat: added stepper customization & updated pallete classes

* feat: reworked document field design

* feat: added clear field functionality

* feat: implemented dynamic powered by logo & added white poweredby

* fix: fixed & clean

* feat: refactor

* feat: added logo to theme definition

* feat: implemented visibleOn for nested inputs

* fix: fixed typos

* fix: deleted theme

* feat: added theme to ui def

* fix: fixed types & theme provider & added migration for theme

* chore(nuvei): some fixes

* fix: changes for plugins 2

* fix: rename kyb to businessInformation

* chore: fix data migration ref

* chore: fix file after merge 1

* fix: remove get url without variables

* fix: modify kyc session and email templates

* fix: display names and plugin names

* fix(kyc-session): fix kyc session, added mastercard

* fix(vscode): submodule search issue

* fix: support individual-sanctions new options

* feat: support url options

* feat: add default country for registry information and sanctions and ubos

* feat: add default country for plugins

* fix: default value for plugins

* chore(merge): dev

* chore(merge): dev

---------

Co-authored-by: Lior Zamir <liorz@ballerine.com>
Co-authored-by: Illia Rudniev <cheskmr@gmail.com>
Co-authored-by: Alon Peretz <8467965+alonp99@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 13, 2024
1 parent f0708e2 commit d8b55d3
Show file tree
Hide file tree
Showing 35 changed files with 1,367 additions and 1,085 deletions.
9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@
"packages/workflow-core",
"services/workflows-service",
"packages/common"
]
],
"search.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/data-migrations": false
},
"search.followSymlinks": true,
"search.useIgnoreFiles": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TWorkflowById } from '@/domains/workflows/fetchers';
import { StateTag } from '@ballerine/common';

export class MerchantMonitoringProcessTracker implements IProcessTracker {
PROCESS_NAME = 'merchant-monitoring';
PROCESS_NAME = 'merchantMonitoring';

constructor(public readonly workflow: TWorkflowById) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ export const workflow = {
approve: { tags: [StateTag.APPROVED], type: 'final' },
email_sent: {
tags: [StateTag.REVISION],
on: { KYC_HOOK_RESPONDED: [{ target: 'kyc_manual_review' }] },
on: { KYC_RESPONSE_RECEIVED: [{ target: 'kyc_manual_review' }] },
},
get_kyc_session: {
tags: [StateTag.PENDING_PROCESS],
Expand Down Expand Up @@ -805,7 +805,7 @@ export const workflow = {
approve: { tags: [StateTag.APPROVED], type: 'final' },
email_sent: {
tags: [StateTag.REVISION],
on: { KYC_HOOK_RESPONDED: [{ target: 'kyc_manual_review' }] },
on: { KYC_RESPONSE_RECEIVED: [{ target: 'kyc_manual_review' }] },
},
get_kyc_session: {
tags: [StateTag.PENDING_PROCESS],
Expand Down
1 change: 1 addition & 0 deletions apps/kyb-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"start": "vite",
"build": "tsc && vite build",
"lint": "eslint . --fix",
"format": "prettier --write .",
Expand Down
1 change: 1 addition & 0 deletions apps/workflows-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"spellcheck": "cspell \"*\"",
"dev": "vite --host",
"start": "vite",
"build": "tsc && vite build",
"lint": "eslint . --fix",
"format": "prettier --write .",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"spellcheck": "nx run-many --target=spellcheck",
"monorepo:init": "node ./scripts/init.js",
"kyc-manual-review-example": "nx run @ballerine/common:build && nx run @ballerine/workflows-service:setup && cross-env VITE_POLLING_INTERVAL=3 VITE_EXAMPLE_TYPE=kyc VITE_API_KEY=secret concurrently \"nx run @ballerine/workflows-service:dev\" \"wait-on http://localhost:3000/api/v1/_health/ready && nx run-many --target=dev --projects=@ballerine/web-ui-sdk,@ballerine/backoffice-v2\"",
"run-kyb-web-apps": "cross-env VITE_POLLING_INTERVAL=3 VITE_EXAMPLE_TYPE=kyb VITE_API_KEY=secret concurrently \"nx run-many --target=dev --projects=@ballerine/kyb-app,@ballerine/backoffice-v2\"",
"kyb-manual-review-example": "nx run @ballerine/common:build && nx run @ballerine/workflows-service:setup && cross-env VITE_POLLING_INTERVAL=3 VITE_EXAMPLE_TYPE=kyb VITE_API_KEY=secret concurrently \"nx run @ballerine/workflows-service:dev\" \"wait-on http://localhost:3000/api/v1/_health/ready && nx run-many --target=dev --projects=@ballerine/kyb-app,@ballerine/backoffice-v2\"",
"api-flow-example": "nx run @ballerine/common:build && nx run @ballerine/workflows-service:setup && cross-env VITE_POLLING_INTERVAL=false VITE_EXAMPLE_TYPE=kyb VITE_API_KEY=secret concurrently \"nx run @ballerine/workflows-service:dev\" \"wait-on http://localhost:3000/api/v1/_health/ready && nx run-many --target=dev --projects=@ballerine/backoffice-v2,@ballerine/workflows-dashboard\"",
"branchlint": "branchlint -u -c",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const Default = {
subitems={[
{
leftIcon: <Clock4 size={18} className={`fill-purple-500 stroke-white`} />,
text: 'Registry Verification',
text: 'Registry Information',
},
{
leftIcon: <CheckCircle2 size={18} className={`fill-green-500 stroke-white`} />,
Expand Down
19 changes: 16 additions & 3 deletions packages/workflow-core/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { ApiPlugin, WebhookPlugin } from './plugins';
import { EmailPlugin } from './plugins/external-plugin/email-plugin';
import { MastercardMerchantScreeningPlugin } from './plugins/external-plugin/mastercard-merchant-screening-plugin';
import { ObjectValues } from './types';
import { BALLERINE_API_PLUGINS } from './plugins/external-plugin/vendor-consts';
import { BallerineApiPlugin } from './plugins/external-plugin/ballerine-plugin';
import { BallerineEmailPlugin } from './plugins/external-plugin/ballerine-email-plugin';

export const PluginKind = {
KYC: 'kyc',
KYC_SESSION: 'kyc-session',
KYB: 'kyb',
WEBHOOK: 'webhook',
API: 'api',
Expand All @@ -18,10 +20,21 @@ export const PluginKind = {

export const pluginsRegistry = {
[PluginKind.KYC]: KycPlugin,
[PluginKind.KYC_SESSION]: KycSessionPlugin,
[PluginKind.KYB]: KybPlugin,
[PluginKind.WEBHOOK]: WebhookPlugin,
[PluginKind.API]: ApiPlugin,
[PluginKind.EMAIL]: EmailPlugin,
[PluginKind.MASTERCARD_MERCHANT_SCREENING]: MastercardMerchantScreeningPlugin,
} as const satisfies Readonly<Record<ObjectValues<typeof PluginKind>, new (...args: any[]) => any>>;
[BALLERINE_API_PLUGINS['individual-sanctions']]: BallerineApiPlugin,
[BALLERINE_API_PLUGINS['company-sanctions']]: BallerineApiPlugin,
[BALLERINE_API_PLUGINS['ubo']]: BallerineApiPlugin,
[BALLERINE_API_PLUGINS['registry-information']]: BallerineApiPlugin,
[BALLERINE_API_PLUGINS['merchant-monitoring']]: BallerineApiPlugin,
[BALLERINE_API_PLUGINS['template-email']]: BallerineEmailPlugin,
[BALLERINE_API_PLUGINS['kyc-session']]: KycSessionPlugin,
} as const satisfies Readonly<
Record<
ObjectValues<typeof PluginKind & typeof BALLERINE_API_PLUGINS>,
new (...args: any[]) => any
>
>;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('workflow-runner', () => {
server.close();
});

it('transitions to successAction and persist response to context', async () => {
it.skip('transitions to successAction and persist response to context', async () => {
const workflow = createWorkflowRunner(
definition,
// @ts-expect-error - see the comments on `webhookPluginsSchemas`
Expand Down
Loading

0 comments on commit d8b55d3

Please sign in to comment.