Assign Document Credit To Document

The Customer Sales Representative or Finance Department User wants to via CRM / Finance system GUI assign available amount from credit document to debt document in the OCS.io. This operation is available in the CRM / Finance system GUI for users with correct privileges.

The CRM / Finance system via the RESTful API requests for assignment in the OCS.io. The request body contains the Account details and identification of the source and target documents which are part of the transaction.

The OCS.io performs the transaction, then returns result of the operation as a payload of the response.

The CRM / Finance system presents the result of the operation to the User in the GUI.

Primary Actor

Customer Sales Representative or Finance Department User.

Basic Flow

Assign Document Credit To Document Basic Flow
Step Actor Action Description

1.

CSR / FIN User

Search Documents

Customer Sales Representative or Finance Department User via CRM / Finance GUI searches for a Document with outstanding open balance and document to which balance will be transferred.

2.

CRM / Finance

Display Search Documents

CRM / Finance System displays result of Search Documents to the User.

3.

CSR / FIN User

Request for Operation

Customer Sales Representative or Finance Department User via CRM / Finance GUI requests for Operation.

4.

CRM / Finance

Call assignDocumentCredit API

CRM / Finance System calls Assign Document Credit To Document API exposed by OCS.io.

5.

OCS.io

Request Validations

OCS.io validates Request whether all mandatory attributes are populated, all data types are valid, ENUMs match with definition, etc.

Additionally, OCS.io validates Request against Business Logic. This typically includes, that referenced entity exists in the system, entity has proper state, etc.

6.

OCS.io

Perform Business Logic

OCS.io performs Business Logic implemented for the Use-Case.

7.

OCS.io

Publish Business Transaction

OCS.io publishes zero to many messages to Streaming Platform that impacted entities have been changed.

8.

OCS.io

Return assignDocumentCredit Response

OCS.io returns Response to the CRM / Finance System.

Response codes are as follows:

  • 200 = OK

  • 400 = Request Validation failed

  • 500 = Internal error

9.

CRM / Finance

Result of Operation

CRM / Finance system displays result of the operation to the User.

10.

Finance System

Subscribe for Business Transactions

Finance System subscribes for Business Transactions to be delivered by Streaming Platform.

11.

Finance System

Process Business Transactions

Finance System process Business Transactions internally. This typically includes storing of changed entities, update indexes, update metrics, etc.

12.

DWH

Subscribe for Business Transactions

DWH subscribes for Business Transactions to be delivered by Streaming Platform.

13.

DWH

Process Business Transactions

DWH process Business Transactions internally. This typically includes storing of changed entities, update indexes, update metrics, etc.

Request Validations

The following validations are performed when assigning document credit to a document:

  • Account must be provided in the request, it must be already created in the system and must not be in Deactivated State.

  • Payer must be already created in the system.

  • Currency must be configured in the system.

  • Document Credit (Source Document) provided in the request, must exist in the system.

  • Document Credit (Source Document) provided in the request, must not be Cancelled.

  • Document (Target Document) provided in the request, must exist in the system.

  • Document (Target Document) provided in the request, must not be Cancelled.

  • Currency of the Document Credit must be identical with Currency of the Document.

  • Transaction Amount must not exceed Remaining Amount of the Document Credit.

  • Transaction Amount must not exceed Due Amount of the Document.

Perform Business Logic

  1. System creates Document Credit to Document Monetary Transaction.

  2. System decreases Remaining Amount on referenced Document Credit by Amount provided in the request.

  3. System decreases Due Amount on referenced Document by Amount provided in the request.

Publish Notification

Following Notifications will be published to Streaming Platform:

Publish Business Transaction

Following entities will be published to Streaming Platform as part of Business Transaction: