Skip to content

Commit

Permalink
refactor(common): updated document schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri-Levy committed Apr 22, 2024
1 parent 89e49fd commit ca4d26e
Show file tree
Hide file tree
Showing 23 changed files with 388 additions and 42 deletions.
9 changes: 9 additions & 0 deletions apps/backoffice-v2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @ballerine/backoffice-v2

## 0.7.6

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.4
- @ballerine/workflow-browser-sdk@0.6.7
- @ballerine/workflow-node-sdk@0.6.7

## 0.7.5

### Patch Changes
Expand Down
8 changes: 4 additions & 4 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.5",
"version": "0.7.6",
"description": "Ballerine - Backoffice",
"homepage": "https://github.com/ballerine-io/ballerine",
"repository": {
Expand Down Expand Up @@ -51,10 +51,10 @@
},
"dependencies": {
"@ballerine/blocks": "0.2.2",
"@ballerine/common": "0.9.3",
"@ballerine/common": "0.9.4",
"@ballerine/ui": "^0.5.1",
"@ballerine/workflow-browser-sdk": "0.6.6",
"@ballerine/workflow-node-sdk": "0.6.6",
"@ballerine/workflow-browser-sdk": "0.6.7",
"@ballerine/workflow-node-sdk": "0.6.7",
"@fontsource/inter": "^4.5.15",
"@formkit/auto-animate": "1.0.0-beta.5",
"@hookform/resolvers": "^3.1.0",
Expand Down
8 changes: 8 additions & 0 deletions apps/kyb-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# kyb-app

## 0.3.7

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.4
- @ballerine/workflow-browser-sdk@0.6.7

## 0.3.6

### Patch Changes
Expand Down
6 changes: 3 additions & 3 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.6",
"version": "0.3.7",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -15,9 +15,9 @@
},
"dependencies": {
"@ballerine/blocks": "0.2.2",
"@ballerine/common": "^0.9.3",
"@ballerine/common": "^0.9.4",
"@ballerine/ui": "0.5.2",
"@ballerine/workflow-browser-sdk": "0.6.6",
"@ballerine/workflow-browser-sdk": "0.6.7",
"@lukemorales/query-key-factory": "^1.0.3",
"@radix-ui/react-icons": "^1.3.0",
"@rjsf/core": "^5.9.0",
Expand Down
8 changes: 8 additions & 0 deletions examples/headless-example/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @ballerine/headless-example

## 0.3.6

### Patch Changes

- Updated dependencies
- @ballerine/common@0.9.4
- @ballerine/workflow-browser-sdk@0.6.7

## 0.3.5

### Patch Changes
Expand Down
6 changes: 3 additions & 3 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.5",
"version": "0.3.6",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
Expand Down Expand Up @@ -34,8 +34,8 @@
"vite": "^4.5.3"
},
"dependencies": {
"@ballerine/common": "0.9.3",
"@ballerine/workflow-browser-sdk": "0.6.6",
"@ballerine/common": "0.9.4",
"@ballerine/workflow-browser-sdk": "0.6.7",
"@felte/reporter-svelte": "^1.1.5",
"@felte/validator-zod": "^1.0.13",
"@fontsource/inter": "^4.5.15",
Expand Down
6 changes: 6 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @ballerine/common

## 0.9.4

### Patch Changes

- updated document schemas

## 0.9.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"name": "@ballerine/common",
"author": "Ballerine <dev@ballerine.com>",
"version": "0.9.3",
"version": "0.9.4",
"description": "common",
"module": "./dist/esm/index.js",
"main": "./dist/cjs/index.js",
Expand Down
131 changes: 131 additions & 0 deletions packages/common/src/schemas/documents/workflow/documents/schemas/GH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ export const getGhanaDocuments = (): TDocument[] => {

return [
// Financial Information
{
category: 'financial_information',
type: 'mtn_statement',
issuer: { country: 'GH' },
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
msisdn: Type.String({ pattern: '^233[0-9]{9}$' }),
accountHolderName: Type.String(),
from: Type.Optional(Type.String({ format: 'date' })),
to: Type.Optional(Type.String({ format: 'date' })),
timeRun: Type.Optional(Type.String()),
}),
},
{
category: 'business_document',
type: 'mtn_statement',
Expand Down Expand Up @@ -94,6 +108,44 @@ export const getGhanaDocuments = (): TDocument[] => {
accountNumber: Type.Optional(Type.String()),
}),
},
{
category: 'financial_information',
type: 'bank_statement',
issuer: { country: 'GH' },
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
issuer: TypeStringEnum([
'Absa Bank Ghana Limited',
'Access Bank Ghana Plc',
'Agricultural Development Bank of Ghana',
'Bank of Africa Ghana Limited',
'CalBank Limited',
'Consolidated Bank Ghana Limited',
'Ecobank Ghana Limited',
'FBN Bank Ghana Limited',
'Fidelity Bank Ghana Limited',
'First Atlantic Bank Limited',
'First National Bank Ghana',
'GCB Bank Limited',
'Guaranty Trust Bank Ghana Limited',
'National Investment Bank Limited',
'OmniBSIC Bank Ghana Limited',
'Prudential Bank Limited',
'Republic Bank Ghana',
'Societe Generale Ghana Limited',
'Stanbic Bank Ghana Limited',
'Standard Chartered Bank Ghana Limited',
'United Bank for Africa Ghana Limited',
'Zenith Bank Ghana Limited',
]),
printDate: Type.String({ format: 'date-time' }),
accountHolderName: TypeNonEmptyString,
from: Type.String({ format: 'date' }),
to: Type.String({ format: 'date' }),
accountNumber: Type.Optional(Type.String()),
}),
},
// Proof of Address
{
category: 'proof_of_address',
Expand Down Expand Up @@ -669,6 +721,19 @@ export const getGhanaDocuments = (): TDocument[] => {
issueDate: TypePastDate,
}),
},
{
category: 'proof_of_registration',
type: 'certificate_of_registration',
issuer: { country: 'GH' },
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
taxIdNumber: TypeAlphanumericString,
registrationNumber: TypeAlphanumericString,
issueDate: TypePastDate,
}),
},
{
category: 'business_document',
type: 'operating_permit',
Expand All @@ -682,6 +747,19 @@ export const getGhanaDocuments = (): TDocument[] => {
expirationDate: TypeFutureDate,
}),
},
{
category: 'proof_of_registration',
type: 'operating_permit',
issuer: { country: 'GH' },
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
registrationNumber: Type.Optional(TypeAlphanumericString),
issueDate: TypePastDate,
expirationDate: TypeFutureDate,
}),
},
{
category: 'business_document',
type: 'district_assembly_certificate',
Expand All @@ -695,6 +773,19 @@ export const getGhanaDocuments = (): TDocument[] => {
issueDate: TypePastDate,
}),
},
{
category: 'proof_of_registration',
type: 'district_assembly_certificate',
issuer: { country: 'GH' },
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
certificateNumber: TypeAlphanumericString,
businessName: TypeAlphanumericWithSpacesString,
registrationNumber: Type.Optional(TypeAlphanumericString),
issueDate: TypePastDate,
}),
},
// Proof of Ownership
{
category: 'business_document',
Expand All @@ -713,6 +804,23 @@ export const getGhanaDocuments = (): TDocument[] => {
dateOfBirth: TypePastDate,
}),
},
{
category: 'proof_of_ownership',
type: 'form_a',
issuer: { country: 'GH' },
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
registrationNumber: TypeNonEmptyAlphanumericString,
taxIdNumber: TypeAlphanumericString,
issueDate: TypePastDate,
firstName: Type.String(),
middleName: Type.Optional(Type.String()),
lastName: Type.String(),
dateOfBirth: TypePastDate,
}),
},
{
category: 'business_document',
type: 'receipt_for_permit',
Expand All @@ -724,6 +832,17 @@ export const getGhanaDocuments = (): TDocument[] => {
issueDate: TypePastDate,
}),
},
{
category: 'proof_of_ownership',
type: 'receipt_for_permit',
issuer: { country: 'GH' },
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
issueDate: TypePastDate,
}),
},
{
category: 'business_document',
type: 'property_rate',
Expand All @@ -736,6 +855,18 @@ export const getGhanaDocuments = (): TDocument[] => {
issueDate: TypePastDate,
}),
},
{
category: 'proof_of_ownership',
type: 'property_rate',
issuer: { country: 'GH' },
issuingVersion: 1,
version: 1,
propertiesSchema: Type.Object({
businessName: Type.String(),
payerName: Type.String(),
issueDate: TypePastDate,
}),
},
{
category: 'proof_of_ownership',
type: 'business_utility_bill',
Expand Down

0 comments on commit ca4d26e

Please sign in to comment.