Skip to content

Commit e13147d

Browse files
authoredFeb 21, 2024··
Update document schemas (#2110)
* refactor(schemas): updated document schemas * feat(*): updated common package * fix(toast.json): fixed typo

File tree

26 files changed

+138
-71
lines changed

26 files changed

+138
-71
lines changed
 

‎apps/backoffice-v2/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @ballerine/backoffice-v2
22

3+
## 0.5.48
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/common@0.7.42
9+
- @ballerine/workflow-browser-sdk@0.5.42
10+
- @ballerine/workflow-node-sdk@0.5.42
11+
312
## 0.5.47
413

514
### Patch Changes

‎apps/backoffice-v2/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ballerine/backoffice-v2",
3-
"version": "0.5.47",
3+
"version": "0.5.48",
44
"description": "Ballerine - Backoffice",
55
"homepage": "https://github.com/ballerine-io/ballerine",
66
"repository": {
@@ -51,10 +51,10 @@
5151
},
5252
"dependencies": {
5353
"@ballerine/blocks": "0.1.26",
54-
"@ballerine/common": "0.7.41",
54+
"@ballerine/common": "0.7.42",
5555
"@ballerine/ui": "^0.3.28",
56-
"@ballerine/workflow-browser-sdk": "0.5.41",
57-
"@ballerine/workflow-node-sdk": "0.5.41",
56+
"@ballerine/workflow-browser-sdk": "0.5.42",
57+
"@ballerine/workflow-node-sdk": "0.5.42",
5858
"@fontsource/inter": "^4.5.15",
5959
"@formkit/auto-animate": "1.0.0-beta.5",
6060
"@hookform/resolvers": "^3.1.0",

‎apps/backoffice-v2/public/locales/en/toast.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
},
1414
"approve_document": {
1515
"success": "The document has been approved successfully.",
16-
"error": "Error occurred while approving the document. {{errorMessage}}"
16+
"error": "Error occurred while approving the document.\n\n{{errorMessage}}"
1717
},
1818
"reject_document": {
1919
"success": "The document has been rejected successfully.",
20-
"error": "Error occurred while rejecting the document. {{errorMessage}}"
20+
"error": "Error occurred while rejecting the document.\n\n{{errorMessage}}"
2121
},
2222
"ask_revision_document": {
2323
"success": "The document has been asked for revision successfully.",
24-
"error": "Error occurred while asking for revision of the document. {{errorMessage}}"
24+
"error": "Error occurred while asking for revision of the document.\n\n{{errorMessage}}"
2525
},
2626
"revert_revision": {
2727
"success": "Asking for document revision has been cancelled successfully.",
28-
"error": "Error occurred while reverting the document revision. {{errorMessage}}"
28+
"error": "Error occurred while reverting the document revision.\n\n{{errorMessage}}"
2929
},
3030
"update_document_properties": {
3131
"success": "The document has been updated successfully.",

‎apps/kyb-app/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# kyb-app
22

3+
## 0.1.43
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/common@0.7.42
9+
- @ballerine/workflow-browser-sdk@0.5.42
10+
311
## 0.1.42
412

513
### Patch Changes

‎apps/kyb-app/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/kyb-app",
33
"private": true,
4-
"version": "0.1.42",
4+
"version": "0.1.43",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
@@ -15,9 +15,9 @@
1515
},
1616
"dependencies": {
1717
"@ballerine/blocks": "0.1.26",
18-
"@ballerine/common": "^0.7.41",
18+
"@ballerine/common": "^0.7.42",
1919
"@ballerine/ui": "0.3.28",
20-
"@ballerine/workflow-browser-sdk": "0.5.41",
20+
"@ballerine/workflow-browser-sdk": "0.5.42",
2121
"@lukemorales/query-key-factory": "^1.0.3",
2222
"@radix-ui/react-icons": "^1.3.0",
2323
"@rjsf/core": "^5.9.0",

‎examples/headless-example/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @ballerine/headless-example
22

3+
## 0.1.42
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/common@0.7.42
9+
- @ballerine/workflow-browser-sdk@0.5.42
10+
311
## 0.1.41
412

513
### Patch Changes

‎examples/headless-example/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/headless-example",
33
"private": true,
4-
"version": "0.1.41",
4+
"version": "0.1.42",
55
"type": "module",
66
"scripts": {
77
"spellcheck": "cspell \"*\"",
@@ -34,8 +34,8 @@
3434
"vite": "^4.1.0"
3535
},
3636
"dependencies": {
37-
"@ballerine/common": "0.7.41",
38-
"@ballerine/workflow-browser-sdk": "0.5.41",
37+
"@ballerine/common": "0.7.42",
38+
"@ballerine/workflow-browser-sdk": "0.5.42",
3939
"@felte/reporter-svelte": "^1.1.5",
4040
"@felte/validator-zod": "^1.0.13",
4141
"@fontsource/inter": "^4.5.15",

‎packages/common/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @ballerine/common
22

3+
## 0.7.42
4+
5+
### Patch Changes
6+
7+
- updated document schema validation and text
8+
39
## 0.7.41
410

511
### Patch Changes

‎packages/common/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": false,
33
"name": "@ballerine/common",
44
"author": "Ballerine <dev@ballerine.com>",
5-
"version": "0.7.41",
5+
"version": "0.7.42",
66
"description": "common",
77
"module": "./dist/esm/index.js",
88
"main": "./dist/cjs/index.js",

‎packages/common/src/schemas/documents/default-context-schema.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,19 @@ export const defaultContextSchema = Type.Object({
7575
Type.String(),
7676
Type.String({
7777
enum: [
78-
'Wrong document',
79-
'Fake document',
78+
'Wrong category',
8079
'Spam',
8180
'Ownership mismatch - Name',
8281
'Ownership mismatch - National ID',
83-
'Unknown document type',
8482
'Bad image quality',
8583
'Missing page',
8684
'Invalid document',
8785
'Expired document',
88-
'Unreadable document',
86+
'Password protected',
8987
'Blurry image',
88+
'Short statement period',
89+
'Statement out of range',
90+
'Outside restricted area',
9091
'Other',
9192
],
9293
}),

‎packages/common/src/schemas/documents/workflow/documents/schemas/GH.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const alphaNumeric = '^[a-zA-Z0-9]*$';
66

77
export const getGhanaDocuments = (): TDocument[] => {
88
const TypeAlphanumericString = Type.String({ pattern: '^[a-zA-Z0-9]*$' });
9+
const TypeNonEmptyAlphanumericString = Type.String({ pattern: '^[a-zA-Z0-9]*$', minLength: 1 });
910
const TypeAlphanumericWithSpacesString = Type.String({ pattern: '^[\\sa-zA-Z0-9]*$' });
1011
const TypePastDate = Type.String({
1112
format: 'date',
@@ -16,7 +17,7 @@ export const getGhanaDocuments = (): TDocument[] => {
1617
formatMinimum: new Date().toISOString().split('T')[0],
1718
});
1819
const TypeNationalIdNumber = Type.String({ pattern: ghNationalIdNumber });
19-
const TypeStringAtLeastOneWord = Type.String({ minLength: 1 });
20+
const TypeNonEmptyString = Type.String({ minLength: 1 });
2021
const TypeStringEnum = <T extends string[]>(values: [...T]) =>
2122
Type.Unsafe<T[number]>({
2223
type: 'string',
@@ -48,7 +49,7 @@ export const getGhanaDocuments = (): TDocument[] => {
4849
// version: 1,
4950
// propertiesSchema: Type.Object({
5051
// msisdn: Type.String({ pattern: '^233[0-9]{9}$' }),
51-
// accountHolderName: TypeStringAtLeastOneWord,
52+
// accountHolderName: TypeNonEmptyString,
5253
// from: Type.String({ format: 'date' }),
5354
// to: Type.String({ format: 'date' }),
5455
// timeRun: Type.String(),
@@ -87,7 +88,7 @@ export const getGhanaDocuments = (): TDocument[] => {
8788
'Zenith Bank Ghana Limited',
8889
]),
8990
printDate: Type.String({ format: 'date-time' }),
90-
accountHolderName: TypeStringAtLeastOneWord,
91+
accountHolderName: TypeNonEmptyString,
9192
from: Type.String({ format: 'date' }),
9293
to: Type.String({ format: 'date' }),
9394
accountNumber: Type.Optional(Type.String()),
@@ -703,14 +704,13 @@ export const getGhanaDocuments = (): TDocument[] => {
703704
version: 1,
704705
propertiesSchema: Type.Object({
705706
businessName: Type.String(),
706-
registrationNumber: TypeAlphanumericString,
707+
registrationNumber: TypeNonEmptyAlphanumericString,
707708
taxIdNumber: TypeAlphanumericString,
708709
issueDate: TypePastDate,
709710
firstName: Type.String(),
710711
middleName: Type.Optional(Type.String()),
711712
lastName: Type.String(),
712713
dateOfBirth: TypePastDate,
713-
nationalIdNumber: TypeNationalIdNumber,
714714
}),
715715
},
716716
{

‎packages/common/src/schemas/documents/workflow/documents/schemas/UG.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import { TypeStringEnum } from './utils';
44

55
export const getUgandaDocuments = (): TDocument[] => {
66
const TypeAlphanumericString = Type.String({ pattern: '^[a-zA-Z0-9]*$' });
7+
const TypeNonEmptyAlphanumericString = Type.String({ pattern: '^[a-zA-Z0-9]*$', minLength: 1 });
78
const TypePastDate = Type.String({
89
format: 'date',
910
formatMaximum: new Date().toISOString().split('T')[0],
1011
});
1112

12-
const TypeStringAtLeastOneWord = Type.String({ minLength: 1 });
13+
const TypeNonEmptyString = Type.String({ minLength: 1 });
1314
const TypeUgandaMobileNumber = Type.String({ pattern: '^256[0-9]{9}$' });
1415

1516
return [
@@ -34,7 +35,7 @@ export const getUgandaDocuments = (): TDocument[] => {
3435
version: 1,
3536
propertiesSchema: Type.Object({
3637
businessName: Type.String(),
37-
registrationNumber: TypeAlphanumericString,
38+
prnNumber: TypeAlphanumericString,
3839
issuer: TypeStringEnum(['KCCA', 'Other']),
3940
expirationDate: Type.String({ format: 'date' }),
4041
}),
@@ -95,7 +96,7 @@ export const getUgandaDocuments = (): TDocument[] => {
9596
from: Type.String({ format: 'date' }),
9697
to: Type.String({ format: 'date' }),
9798
msisdn: TypeUgandaMobileNumber,
98-
accountHolderName: TypeStringAtLeastOneWord,
99+
accountHolderName: TypeNonEmptyString,
99100
}),
100101
},
101102
{
@@ -108,7 +109,7 @@ export const getUgandaDocuments = (): TDocument[] => {
108109
from: Type.String({ format: 'date' }),
109110
to: Type.String({ format: 'date' }),
110111
msisdn: TypeUgandaMobileNumber,
111-
accountHolderName: TypeStringAtLeastOneWord,
112+
accountHolderName: TypeNonEmptyString,
112113
}),
113114
},
114115
{
@@ -149,7 +150,7 @@ export const getUgandaDocuments = (): TDocument[] => {
149150
printDate: Type.Optional(Type.String({ format: 'date' })),
150151
from: Type.String({ format: 'date' }),
151152
to: Type.String({ format: 'date' }),
152-
accountHolderName: TypeStringAtLeastOneWord,
153+
accountHolderName: TypeNonEmptyString,
153154
accountNumber: Type.Optional(Type.String()),
154155
}),
155156
},
@@ -162,7 +163,7 @@ export const getUgandaDocuments = (): TDocument[] => {
162163
issuingVersion: 1,
163164
version: 1,
164165
propertiesSchema: Type.Object({
165-
name: TypeStringAtLeastOneWord,
166+
name: TypeNonEmptyString,
166167
nationalIdNumber: Type.String(),
167168
userAddress: Type.String(),
168169
physicalAddress: Type.String(),
@@ -176,7 +177,7 @@ export const getUgandaDocuments = (): TDocument[] => {
176177
issuingVersion: 1,
177178
version: 1,
178179
propertiesSchema: Type.Object({
179-
name: TypeStringAtLeastOneWord,
180+
name: TypeNonEmptyString,
180181
nationalIdNumber: Type.Optional(Type.String()),
181182
userAddress: Type.String(),
182183
physicalAddress: Type.String(),
@@ -194,7 +195,7 @@ export const getUgandaDocuments = (): TDocument[] => {
194195
version: 1,
195196
propertiesSchema: Type.Object({
196197
salaryAmount: Type.Number({ minimum: 1 }),
197-
employerName: TypeStringAtLeastOneWord,
198+
employerName: TypeNonEmptyString,
198199
employeeId: Type.String(),
199200
position: Type.String(),
200201
issueDate: TypePastDate,
@@ -209,7 +210,7 @@ export const getUgandaDocuments = (): TDocument[] => {
209210
version: 1,
210211
propertiesSchema: Type.Object({
211212
salaryAmount: Type.Optional(Type.Number({ minimum: 1 })),
212-
employerName: TypeStringAtLeastOneWord,
213+
employerName: TypeNonEmptyString,
213214
nationalIdNumber: Type.String(),
214215
position: Type.String(),
215216
issueDate: TypePastDate,

‎packages/workflow-core/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @ballerine/workflow-core
22

3+
## 0.5.42
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @ballerine/common@0.7.42
9+
310
## 0.5.41
411

512
### Patch Changes

‎packages/workflow-core/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ballerine/workflow-core",
33
"author": "Ballerine <dev@ballerine.com>",
4-
"version": "0.5.41",
4+
"version": "0.5.42",
55
"description": "workflow-core",
66
"module": "./dist/esm/index.js",
77
"main": "./dist/cjs/index.js",
@@ -31,7 +31,7 @@
3131
"node": ">=12"
3232
},
3333
"dependencies": {
34-
"@ballerine/common": "0.7.41",
34+
"@ballerine/common": "0.7.42",
3535
"ajv": "^8.12.0",
3636
"i18n-iso-countries": "^7.6.0",
3737
"jmespath": "^0.16.0",

0 commit comments

Comments
 (0)
Please sign in to comment.