Skip to content

Commit 125ca12

Browse files
Omri-Levychesterkmralonp99
authored
dev -> sb (#3424)
* BAL-3932: Create directors with entity.variant of director (#3399) * feat: added variant to end user & updated entity creation & updated endpoints * feat: updated context schema & dto fix * chore: lock fix * chore: bump * Bal 4297 documents tracker mapping (#3402) * feat: added variant to end user & updated entity creation & updated endpoints * feat: reworked documents mapping & fixed state computation * fix: post merge fix * fix: added assert valid project ids * chore: bump kyb & ui (#3415) * fix: fixed edit buttons (#3417) * fix: added handling for pattern errors & schema fixes (#3416) * fix: added handling for pattern errors & schema fixes * feat: added flags support to pattern validator * chore: bump * fix: fixed schema * chore: cleaned logs * feat: reorganized schemas * refactor(workflow): remove duplicate variant field in repository - Eliminate redundant 'variant' field from the workflow data mapping - Streamline the workflow runtime data structure for improved clarity * fix(workflows-service): fixed bad merge (#3422) * Bal 4361 prevent writing of unsupported company types to context (#3421) * feat: added company types to common & added company type validation to plugin * chore: bump * chore: deleted file * fix: fixed tests --------- Co-authored-by: Illia Rudniev <[email protected]> Co-authored-by: Alon Peretz <[email protected]>
1 parent 44cf4d8 commit 125ca12

File tree

27 files changed

+170
-39
lines changed

27 files changed

+170
-39
lines changed

apps/backoffice-v2/CHANGELOG.md

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

3+
## 0.7.170
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/[email protected]
9+
- @ballerine/[email protected]
10+
- @ballerine/[email protected]
11+
312
## 0.7.169
413

514
### Patch Changes

apps/backoffice-v2/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ballerine/backoffice-v2",
3-
"version": "0.7.169",
3+
"version": "0.7.170",
44
"description": "Ballerine - Backoffice",
55
"homepage": "https://github.com/ballerine-io/ballerine",
66
"type": "module",
@@ -55,9 +55,9 @@
5555
"@ballerine/react-pdf-toolkit": "^1.2.130",
5656
"@ballerine/ui": "0.7.169",
5757
"@ballerine/blocks": "0.2.47",
58-
"@ballerine/common": "0.9.117",
59-
"@ballerine/workflow-browser-sdk": "0.6.141",
60-
"@ballerine/workflow-node-sdk": "0.6.141",
58+
"@ballerine/common": "0.9.118",
59+
"@ballerine/workflow-browser-sdk": "0.6.142",
60+
"@ballerine/workflow-node-sdk": "0.6.142",
6161
"@fontsource/inter": "^4.5.15",
6262
"@formkit/auto-animate": "0.8.2",
6363
"@hookform/resolvers": "^3.1.0",

apps/kyb-app/CHANGELOG.md

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

3+
## 0.3.199
4+
5+
### Patch Changes
6+
7+
- Bump
8+
- Updated dependencies
9+
- @ballerine/[email protected]
10+
- @ballerine/[email protected]
11+
312
## 0.3.198
413

514
### Patch Changes

apps/kyb-app/package.json

Lines changed: 3 additions & 3 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.198",
4+
"version": "0.3.199",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -17,9 +17,9 @@
1717
},
1818
"dependencies": {
1919
"@ballerine/blocks": "0.2.47",
20-
"@ballerine/common": "^0.9.117",
20+
"@ballerine/common": "^0.9.118",
2121
"@ballerine/ui": "0.7.169",
22-
"@ballerine/workflow-browser-sdk": "0.6.141",
22+
"@ballerine/workflow-browser-sdk": "0.6.142",
2323
"@lukemorales/query-key-factory": "^1.0.3",
2424
"@radix-ui/react-icons": "^1.3.0",
2525
"@rjsf/core": "^5.9.0",

apps/kyb-app/src/domains/collection-flow/types/index.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import { RJSFSchema, UiSchema } from '@rjsf/utils';
1212
import { z } from 'zod';
1313
import { CollectionFlowConfig, CollectionFlowContext } from './flow-context.types';
14+
import { BusinessTypeSchema } from '@ballerine/common';
1415

1516
export * from './ui-schema.types';
1617

@@ -193,13 +194,19 @@ export const FetchCompanyInformationResultSchema = z
193194
jurisdictionCode: z.string(),
194195
incorporationDate: z.string(),
195196
})
196-
.transform(data => ({
197-
companyName: data.name,
198-
taxIdentificationNumber: data.vat,
199-
businessType: data.companyType,
200-
additionalInfo: {
201-
status: data.currentStatus,
202-
incorporationDate: data.incorporationDate,
203-
openCorporate: data,
204-
},
205-
}));
197+
.transform(data => {
198+
const companyType = BusinessTypeSchema.safeParse(data.companyType);
199+
200+
const result = {
201+
companyName: data.name,
202+
taxIdentificationNumber: data.vat,
203+
businessType: companyType.success ? companyType.data : undefined,
204+
additionalInfo: {
205+
status: data.currentStatus,
206+
incorporationDate: data.incorporationDate,
207+
openCorporate: data,
208+
},
209+
};
210+
211+
return result;
212+
});

apps/kyb-app/src/pages/CollectionFlow/versions/v2/components/organisms/CollectionFlowUI/components/utility/PluginsRunner/plugins.repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import {
1111
FETCH_COMPANY_INFORMATION_PLUGIN_NAME,
1212
fetchCompanyInformationPlugin,
13-
} from '@/pages/CollectionFlow/versions/v2/components/organisms/CollectionFlowUI/components/utility/PluginsRunner/plugins/fetch-company-information.plugin';
13+
} from '@/pages/CollectionFlow/versions/v2/components/organisms/CollectionFlowUI/components/utility/PluginsRunner/plugins/fetch-company-information/fetch-company-information.plugin';
1414

1515
export const pluginsRepository = {
1616
[EVENT_PLUGIN_NAME]: eventPlugin,
Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ describe('Fetch Company Information Plugin', () => {
1919
let mockedEntity: any;
2020
let mockedContext: CollectionFlowContext;
2121
let mockedTransformedData: any;
22+
let mockedIncorrectCompanyInformationData: any;
23+
let mockedIncorrectTransformedData: any;
2224

2325
beforeEach(() => {
2426
mockedCompanyInformationData = {
2527
name: 'Test Company Ltd',
2628
companyNumber: '12345678',
2729
vat: 'GB123456789',
2830
numberOfEmployees: 42,
29-
companyType: 'Private Limited Company',
31+
companyType: 'Limited',
3032
currentStatus: 'Active',
3133
jurisdictionCode: 'gb',
3234
incorporationDate: '2020-01-01',
@@ -35,7 +37,7 @@ describe('Fetch Company Information Plugin', () => {
3537
mockedTransformedData = {
3638
companyName: 'Test Company Ltd',
3739
taxIdentificationNumber: 'GB123456789',
38-
businessType: 'Private Limited Company',
40+
businessType: mockedCompanyInformationData.companyType,
3941
additionalInfo: {
4042
status: 'Active',
4143
incorporationDate: '2020-01-01',
@@ -53,6 +55,28 @@ describe('Fetch Company Information Plugin', () => {
5355
},
5456
};
5557

58+
mockedIncorrectTransformedData = {
59+
name: 'Test Company Ltd',
60+
companyNumber: '12345678',
61+
vat: 'GB123456789',
62+
numberOfEmployees: 42,
63+
companyType: 'Whatever',
64+
currentStatus: 'Active',
65+
jurisdictionCode: 'gb',
66+
incorporationDate: '2020-01-01',
67+
};
68+
69+
mockedIncorrectCompanyInformationData = {
70+
name: 'Test Company Ltd',
71+
companyNumber: '12345678',
72+
vat: 'GB123456789',
73+
numberOfEmployees: 42,
74+
companyType: mockedIncorrectTransformedData.companyType,
75+
currentStatus: 'Active',
76+
jurisdictionCode: 'gb',
77+
incorporationDate: '2020-01-01',
78+
};
79+
5680
mockedContext = {
5781
entity: mockedEntity,
5882
} as CollectionFlowContext;
@@ -114,4 +138,20 @@ describe('Fetch Company Information Plugin', () => {
114138
});
115139
});
116140
});
141+
142+
describe('when company type is not valid', () => {
143+
beforeEach(() => {
144+
(fetchCompanyInformation as jest.Mock).mockResolvedValue(
145+
mockedIncorrectCompanyInformationData,
146+
);
147+
});
148+
149+
it('should not provide company type', async () => {
150+
const result = (await fetchCompanyInformationPlugin(mockedContext, {} as any, {
151+
output: 'some.other.place',
152+
})) as AnyObject;
153+
154+
expect(result.some.other.place.businessType).toBeUndefined();
155+
});
156+
});
117157
});

examples/headless-example/CHANGELOG.md

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

3+
## 0.3.141
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/[email protected]
9+
- @ballerine/[email protected]
10+
311
## 0.3.140
412

513
### Patch Changes

examples/headless-example/package.json

Lines changed: 3 additions & 3 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.140",
4+
"version": "0.3.141",
55
"type": "module",
66
"scripts": {
77
"spellcheck": "cspell \"*\"",
@@ -34,8 +34,8 @@
3434
"vite": "^4.5.3"
3535
},
3636
"dependencies": {
37-
"@ballerine/common": "0.9.117",
38-
"@ballerine/workflow-browser-sdk": "0.6.141",
37+
"@ballerine/common": "0.9.118",
38+
"@ballerine/workflow-browser-sdk": "0.6.142",
3939
"@felte/reporter-svelte": "^1.1.5",
4040
"@felte/validator-zod": "^1.0.13",
4141
"@fontsource/inter": "^4.5.15",

0 commit comments

Comments
 (0)