From 8278fc1c509e6404f049c2c647b85964a943955b Mon Sep 17 00:00:00 2001 From: axshani Date: Thu, 14 Mar 2024 19:19:27 +0200 Subject: [PATCH 1/4] Beneficial Owner Resource --- schemas/update_application.json | 36 --------------------------------- 1 file changed, 36 deletions(-) diff --git a/schemas/update_application.json b/schemas/update_application.json index e10d981..4467dfb 100644 --- a/schemas/update_application.json +++ b/schemas/update_application.json @@ -155,41 +155,6 @@ "attributes" ] }, - "patchBusinessApplicationBeneficialOwner": { - "title": "Patch Business Application", - "type": "object", - "properties": { - "type": { "type": "string", "default": "beneficialOwner" }, - "attributes": { - "type": "object", - "properties": { - "occupation": { - "$ref": "types.json#/definitions/occupation" - }, - "annualIncome": { - "$ref": "types.json#/definitions/annualIncome" - }, - "sourceOfIncome": { - "$ref": "types.json#/definitions/sourceOfIncome" - } - }, - "relationships": { - "type": "object", - "properties": { - "application": { - "$ref": "types.json#/definitions/Relationship" - } - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false, - "required": [ - "type", - "attributes" - ] - }, "patchTrustApplication": { "title": "Patch Trust Application", "type": "object", @@ -250,7 +215,6 @@ "oneOf": [ { "$ref": "#/definitions/patchBusinessApplication" }, { "$ref": "#/definitions/patchBusinessApplicationOfficer" }, - { "$ref": "#/definitions/patchBusinessApplicationBeneficialOwner" }, { "$ref": "#/definitions/patchSoleProprietorApplication" }, { "$ref": "#/definitions/patchIndividualApplication" }, { "$ref": "#/definitions/patchTrustApplication" } From b14e11af3553700a56083bad8b9dd3db4c048388 Mon Sep 17 00:00:00 2001 From: axshani Date: Sun, 17 Mar 2024 21:07:13 +0200 Subject: [PATCH 2/4] update schemas --- openapi.json | 3 + schemas/beneficial_owner.json | 37 +++++++++++ schemas/beneficial_owner_paths.json | 98 +++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 schemas/beneficial_owner.json create mode 100644 schemas/beneficial_owner_paths.json diff --git a/openapi.json b/openapi.json index ca8a023..d8bf344 100644 --- a/openapi.json +++ b/openapi.json @@ -53,6 +53,9 @@ "/applications/{applicationId}/documents/{documentId}/download/back": { "$ref": "./schemas/application_paths.json#/download_back_side_document" }, + "/beneficial-owner/{beneficialOwnerId}": { + "$ref": "./schemas/beneficial_owner_paths.json#/beneficial_owners" + }, "/application-forms/{applicationFormId}": { "$ref": "./schemas/application_paths.json#/application_form" }, diff --git a/schemas/beneficial_owner.json b/schemas/beneficial_owner.json new file mode 100644 index 0000000..c23e249 --- /dev/null +++ b/schemas/beneficial_owner.json @@ -0,0 +1,37 @@ +{ + "title": "Beneficial Owner Resource", + "type": "object", + "properties": { + "id": { + "$ref": "types.json#/definitions/identifier" + }, + "type": { + "type": "string", + "default": "beneficialOwner" + }, + "attributes": { + "type": "object", + "properties": { + "tags": { + "$ref": "tags.json#/definitions/tagsPatch" + }, + "occupation": { + "$ref": "types.json#/definitions/occupation" + }, + "annualIncome": { + "$ref": "types.json#/definitions/annualIncome" + }, + "sourceOfIncome": { + "$ref": "types.json#/definitions/sourceOfIncome" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "required": [ + "id", + "type", + "attributes" + ] +} \ No newline at end of file diff --git a/schemas/beneficial_owner_paths.json b/schemas/beneficial_owner_paths.json new file mode 100644 index 0000000..3c156d7 --- /dev/null +++ b/schemas/beneficial_owner_paths.json @@ -0,0 +1,98 @@ +{ + "updateBeneficialOwnerRequest": { + "title": "Update Beneficial Owner", + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "beneficialOwner" + }, + "attributes": { + "type": "object", + "properties": { + "occupation": { + "$ref": "types.json#/definitions/occupation" + }, + "annualIncome": { + "$ref": "types.json#/definitions/annualIncome" + }, + "sourceOfIncome": { + "$ref": "types.json#/definitions/sourceOfIncome" + } + }, + "relationships": { + "type": "object", + "properties": { + "application": { + "$ref": "types.json#/definitions/Relationship" + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "required": [ + "type", + "attributes" + ] + }, + "UnitBeneficialOwnerResponse": { + "type": "object", + "title": "UnitBeneficialOwnerResponse", + "properties": { + "data": { + "$ref": "beneficial_owner.json" + } + } + }, + "patch_beneficial_owners": { + "patch": { + "tags": [ + "Update Beneficial Owner" + ], + "operationId": "execute", + "summary": "Update Beneficial Owner", + "description": "Update an Beneficial Owner via API ", + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "beneficialOwnerId", + "in": "path", + "required": true, + "description": "ID of the Beneficial Owner to update" + } + ], + "requestBody": { + "description": "Update Beneficial Owner Request", + "required": true, + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/updateBeneficialOwnerRequest" + } + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/vnd.api+json; charset=utf-8": { + "schema": { + "$ref": "#/UnitBeneficialOwnerResponse" + } + } + } + } + } + } + } + } +} From 2e56def63a53b554f2bb3625086fdb48211a37ff Mon Sep 17 00:00:00 2001 From: axshani Date: Sun, 17 Mar 2024 21:18:31 +0200 Subject: [PATCH 3/4] fix Beneficial Owner attributes --- schemas/beneficial_owner.json | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/schemas/beneficial_owner.json b/schemas/beneficial_owner.json index c23e249..aa01439 100644 --- a/schemas/beneficial_owner.json +++ b/schemas/beneficial_owner.json @@ -12,8 +12,35 @@ "attributes": { "type": "object", "properties": { - "tags": { - "$ref": "tags.json#/definitions/tagsPatch" + "status": { + "type": "string", + "enum": ["Approved", "Denied", "PendingReview"] + }, + "fullName": { + "$ref": "types.json#/definitions/fullName" + }, + "email": { + "$ref": "types.json#/definitions/email" + }, + "phone": { + "$ref": "types.json#/definitions/phone" + }, + "ssn": { + "type": "string", + "pattern": "^\\d{9}$" + }, + "passport": { + "type": "string" + }, + "nationality": { + "$ref": "types.json#/definitions/country" + }, + "address": { + "type": "object" + }, + "dateOfBirth": { + "type": "string", + "format": "date" }, "occupation": { "$ref": "types.json#/definitions/occupation" From b89477b45b9d74f88346350a57b0768aaa755c7b Mon Sep 17 00:00:00 2001 From: axshani Date: Tue, 19 Mar 2024 12:49:20 +0200 Subject: [PATCH 4/4] patch_beneficial_owners --- openapi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.json b/openapi.json index d8bf344..114daf8 100644 --- a/openapi.json +++ b/openapi.json @@ -54,7 +54,7 @@ "$ref": "./schemas/application_paths.json#/download_back_side_document" }, "/beneficial-owner/{beneficialOwnerId}": { - "$ref": "./schemas/beneficial_owner_paths.json#/beneficial_owners" + "$ref": "./schemas/beneficial_owner_paths.json#/patch_beneficial_owners" }, "/application-forms/{applicationFormId}": { "$ref": "./schemas/application_paths.json#/application_form"