diff --git a/openapi.json b/openapi.json index ca8a023..114daf8 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#/patch_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..aa01439 --- /dev/null +++ b/schemas/beneficial_owner.json @@ -0,0 +1,64 @@ +{ + "title": "Beneficial Owner Resource", + "type": "object", + "properties": { + "id": { + "$ref": "types.json#/definitions/identifier" + }, + "type": { + "type": "string", + "default": "beneficialOwner" + }, + "attributes": { + "type": "object", + "properties": { + "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" + }, + "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" + } + } + } + } + } + } + } + } +} 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" }