Skip to content

Commit 3bb9c87

Browse files
authored
Omri levy/fix/match state (#2817)
* fix(workflow-core): updated merchant screening plugin * chore(*): version bump * chore(*): added missing package * feat(*): trigger ci
1 parent c7ff5f9 commit 3bb9c87

File tree

18 files changed

+565
-274
lines changed

18 files changed

+565
-274
lines changed

apps/backoffice-v2/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @ballerine/backoffice-v2
22

3+
## 0.7.64
4+
5+
### Patch Changes
6+
7+
- @ballerine/workflow-browser-sdk@0.6.61
8+
- @ballerine/workflow-node-sdk@0.6.61
9+
310
## 0.7.63
411

512
### Patch Changes

apps/backoffice-v2/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ballerine/backoffice-v2",
3-
"version": "0.7.63",
3+
"version": "0.7.64",
44
"description": "Ballerine - Backoffice",
55
"homepage": "https://github.com/ballerine-io/ballerine",
66
"repository": {
@@ -54,8 +54,8 @@
5454
"@ballerine/common": "0.9.48",
5555
"@ballerine/react-pdf-toolkit": "^1.2.42",
5656
"@ballerine/ui": "^0.5.42",
57-
"@ballerine/workflow-browser-sdk": "0.6.60",
58-
"@ballerine/workflow-node-sdk": "0.6.60",
57+
"@ballerine/workflow-browser-sdk": "0.6.61",
58+
"@ballerine/workflow-node-sdk": "0.6.61",
5959
"@botpress/webchat": "^2.1.10",
6060
"@botpress/webchat-generator": "^0.2.9",
6161
"@fontsource/inter": "^4.5.15",

apps/kyb-app/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# kyb-app
22

3+
## 0.3.75
4+
5+
### Patch Changes
6+
7+
- @ballerine/workflow-browser-sdk@0.6.61
8+
39
## 0.3.74
410

511
### Patch Changes

apps/kyb-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/kyb-app",
33
"private": true,
4-
"version": "0.3.74",
4+
"version": "0.3.75",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -18,7 +18,7 @@
1818
"@ballerine/blocks": "0.2.25",
1919
"@ballerine/ui": "0.5.42",
2020
"@ballerine/common": "^0.9.48",
21-
"@ballerine/workflow-browser-sdk": "0.6.60",
21+
"@ballerine/workflow-browser-sdk": "0.6.61",
2222
"@lukemorales/query-key-factory": "^1.0.3",
2323
"@radix-ui/react-icons": "^1.3.0",
2424
"@rjsf/core": "^5.9.0",

examples/headless-example/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @ballerine/headless-example
22

3+
## 0.3.60
4+
5+
### Patch Changes
6+
7+
- @ballerine/workflow-browser-sdk@0.6.61
8+
39
## 0.3.59
410

511
### Patch Changes

examples/headless-example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/headless-example",
33
"private": true,
4-
"version": "0.3.59",
4+
"version": "0.3.60",
55
"type": "module",
66
"scripts": {
77
"spellcheck": "cspell \"*\"",
@@ -35,7 +35,7 @@
3535
},
3636
"dependencies": {
3737
"@ballerine/common": "0.9.48",
38-
"@ballerine/workflow-browser-sdk": "0.6.60",
38+
"@ballerine/workflow-browser-sdk": "0.6.61",
3939
"@felte/reporter-svelte": "^1.1.5",
4040
"@felte/validator-zod": "^1.0.13",
4141
"@fontsource/inter": "^4.5.15",

packages/workflow-core/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @ballerine/workflow-core
22

3+
## 0.6.61
4+
5+
### Patch Changes
6+
7+
- updated MATCH plugin
8+
39
## 0.6.60
410

511
### Patch Changes

packages/workflow-core/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/workflow-core",
33
"author": "Ballerine <[email protected]>",
4-
"version": "0.6.60",
4+
"version": "0.6.61",
55
"description": "workflow-core",
66
"module": "./dist/esm/index.js",
77
"main": "./dist/cjs/index.js",
@@ -33,6 +33,7 @@
3333
"dependencies": {
3434
"@ballerine/common": "0.9.48",
3535
"ajv": "^8.12.0",
36+
"country-state-city": "^3.1.4",
3637
"i18n-iso-countries": "^7.6.0",
3738
"jmespath": "^0.16.0",
3839
"json-logic-js": "^2.0.2",
@@ -56,9 +57,9 @@
5657
"@types/babel__core": "^7.20.0",
5758
"@types/fs-extra": "^11.0.1",
5859
"@types/jmespath": "^0.15.0",
60+
"@types/json-logic-js": "^2.0.1",
5961
"@types/lodash.groupby": "^4.6.9",
6062
"@types/lodash.maxby": "^4.6.9",
61-
"@types/json-logic-js": "^2.0.1",
6263
"@types/lodash.merge": "^4.6.9",
6364
"@types/node": "^18.14.0",
6465
"@typescript-eslint/eslint-plugin": "^5.48.1",

packages/workflow-core/src/lib/plugins/external-plugin/mastercard-merchant-screening-plugin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { logger } from '../../logger';
44
import { TContext } from '../../utils/types';
55
import { ApiPlugin } from './api-plugin';
66
import { IApiPluginParams } from './types';
7+
import { State } from 'country-state-city';
78

89
export class MastercardMerchantScreeningPlugin extends ApiPlugin {
910
public static pluginType = 'http';
@@ -37,6 +38,7 @@ export class MastercardMerchantScreeningPlugin extends ApiPlugin {
3738
const url = `${process.env.UNIFIED_API_URL}/merchant-screening/mastercard`;
3839
const entity = isObject(context.entity) ? context.entity : {};
3940
const countrySubdivisionSupportedCountries = ['US', 'CA'] as const;
41+
const statesOfCountry = State.getStatesOfCountry(entity?.data?.address?.country);
4042
const address = {
4143
line1: [entity?.data?.address?.street, entity?.data?.address?.streetNumber]
4244
.filter(Boolean)
@@ -47,7 +49,9 @@ export class MastercardMerchantScreeningPlugin extends ApiPlugin {
4749
countrySubdivision: countrySubdivisionSupportedCountries.includes(
4850
entity?.data?.address?.country,
4951
)
50-
? requestPayload?.countrySubdivision
52+
? statesOfCountry.find(
53+
state => state.name.toLowerCase() === entity?.data?.address?.state?.toLowerCase(),
54+
)?.isoCode
5155
: undefined,
5256
};
5357

packages/workflow-core/src/lib/plugins/external-plugin/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export interface ValidatableTransformer {
1010
transformers?: Transformers;
1111
schemaValidator?: Validator;
1212
}
13+
1314
export interface IApiPluginParams {
1415
name: string;
1516
pluginKind?: string;

0 commit comments

Comments
 (0)