Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1423: Add page and sequence diagram for bulk-abort scenario #231

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
* [Notification to Participant (b)](mojaloop-technical-overview/central-ledger/transfers/1.1.4.b-send-notification-to-participant.md)
* [Timeout Overview](mojaloop-technical-overview/central-bulk-transfers/transfers/3.1.0-transfer-timeout-overview-for-bulk.md)
* [Timeout Handler Consume](mojaloop-technical-overview/central-bulk-transfers/transfers/3.1.1-transfer-timeout-handler-consume.md)
* [Bulk Abort Overview](mojaloop-technical-overview/central-bulk-transfers/transfers/4.1.0-transfer-abort-overview-for-bulk.md)
* [Central-Settlements Service](mojaloop-technical-overview/central-settlements/README.md)
* [Settlement Process](mojaloop-technical-overview/central-settlements/settlement-process/README.md)
* [Settlement Windows By Params](mojaloop-technical-overview/central-settlements/settlement-process/get-settlement-windows-by-params.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
/'*****
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
- Name Surname <name.surname@gatesfoundation.com>

* Steven Oderayi <steven.oderayi@modusbox.com>
--------------
******'/

@startuml
' declare title
title 4.1.0. Bulk Transfer Abort

autonumber

' Actor Keys:
' boundary - APIs/Interfaces, etc
' collections - Kafka Topics
' control - Kafka Consumers
' entity - Database Access Objects
' database - Database Persistance Store

' declare actors
actor "DFSP1\nPayer" as DFSP1
actor "DFSP2\nPayee" as DFSP2
boundary "Bulk API Adapter" as BULKAPI
control "Bulk API Notification Event Handler" as NOTIFY_HANDLER
boundary "Central Service API" as CSAPI
collections "Bulk-Fulfil-Topic" as TOPIC_BULK_FULFIL
collections "Fulfil-Topic" as TOPIC_FULFIL
control "Bulk Fulfil Event Handler" as BULK_FULFIL_HANDLER
control "Fulfil Event Handler" as FULFIL_HANDLER
collections "topic-transfer-position" as TOPIC_POSITION
control "Position Event Handler" as POS_HANDLER
collections "topic-bulk-processing" as TOPIC_BULK_PROCESSING
control "Bulk Processing Event Handler" as BULK_PROCESSING_HANDLER
collections "Event-Topic" as TOPIC_EVENTS
collections "Notification-Topic" as TOPIC_NOTIFICATIONS
database "Cache" as CACHE
database "Central Services DB" as DB

box "Financial Service Providers" #lightGray
participant DFSP1
participant DFSP2
end box

box "Bulk API Adapter Service" #LightBlue
participant BULKAPI
participant NOTIFY_HANDLER
end box

box "Central Service" #LightYellow
participant CSAPI
participant TOPIC_BULK_FULFIL
participant TOPIC_FULFIL
participant BULK_FULFIL_HANDLER
participant FULFIL_HANDLER
participant TOPIC_POSITION
participant TOPIC_EVENTS
participant POS_HANDLER
participant TOPIC_BULK_PROCESSING
participant BULK_PROCESSING_HANDLER
participant TOPIC_NOTIFICATIONS
participant CACHE
participant DB
end box

' start flow
activate NOTIFY_HANDLER
activate BULK_FULFIL_HANDLER
activate FULFIL_HANDLER
activate FULFIL_HANDLER
activate BULK_PROCESSING_HANDLER
activate POS_HANDLER

group DFSP2 sends a Fulfil Abort Transfer request
note right of DFSP2 #lightblue
**Note**: In the payload for PUT /bulkTransfers/<ID>/error
only the **errorInformation** field is **required**
end note
note right of DFSP2 #yellow
Headers - transferHeaders: {
Content-Length: <Content-Length>,
Content-Type: <Content-Type>,
Date: <Date>,
X-Forwarded-For: <X-Forwarded-For>,
FSPIOP-Source: <FSPIOP-Source>,
FSPIOP-Destination: <FSPIOP-Destination>,
FSPIOP-Encryption: <FSPIOP-Encryption>,
FSPIOP-Signature: <FSPIOP-Signature>,
FSPIOP-URI: <FSPIOP-URI>,
FSPIOP-HTTP-Method: <FSPIOP-HTTP-Method>
}
Payload - errorMessage:
{
"errorInformation": {
"errorCode": <string>,
"errorDescription": <string>,
"extensionList": {
"extension": [
{
"key": <string>,
"value": <string>
}
]
}
}
}
end note
DFSP2 ->> BULKAPI: **PUT - /bulkTransfers/<ID>/error**
activate BULKAPI
note right of BULKAPI #yellow
Message:
{
id: <ID>,
from: <transferHeaders.FSPIOP-Source>,
to: <transferHeaders.FSPIOP-Destination>,
type: application/json,
content: {
headers: <transferHeaders>,
payload: <transferMessage>
},
metadata: {
event: {
id: <uuid>,
type: fulfil,
action: reject,
createdAt: <timestamp>,
state: {
status: "success",
code: 0
}
}
}
}
end note
BULKAPI -> CACHE: Persist request payload with messageId in cache
activate CACHE
note right of BULKAPI #yellow
Message: {
messageId: <string>,
bulkTransferId: <string>,
payload: <object>
}
end note
hnote over CACHE #lightyellow
individualTransferFulfils
end hnote
deactivate CACHE
BULKAPI -> TOPIC_BULK_FULFIL: Produce bulk-fulfil message
BULKAPI -->> DFSP2: Respond HTTP - 200 (OK)
TOPIC_BULK_FULFIL <- BULK_FULFIL_HANDLER: Consume bulk-fulfil message
BULK_FULFIL_HANDLER -> BULK_FULFIL_HANDLER: Perform duplicate check
BULK_FULFIL_HANDLER -> BULK_FULFIL_HANDLER: Validate request
loop n times, n = number of individual transfers
note right of BULK_FULFIL_HANDLER
Message: {
transferId: <string>,
bulkTransferId< <string>,
bulkTransferAssociationRecord: {
transferId: <string>,
bulkTransferId: <string>,
bulkProcessingStateId: <string>,
errorCode: <string>,
errorDescription: <string>
}
}
end note
BULK_FULFIL_HANDLER -> DB: Update bulkTransferAssociation table
activate DB
hnote over DB #lightyellow
bulkTransferAssociation
end hnote
deactivate DB
BULK_FULFIL_HANDLER -> TOPIC_FULFIL: Produce fulfil message with action bulk-abort for each individual transfer
end
|||
loop n times, n = number of individual transfers
TOPIC_FULFIL <- FULFIL_HANDLER: Consume message
ref over TOPIC_FULFIL, TOPIC_EVENTS: Fulfil Handler Consume (bulk-abort)\n
FULFIL_HANDLER -> TOPIC_POSITION: Produce message
end
|||
loop n times, n = number of individual transfers
TOPIC_POSITION <- POS_HANDLER: Consume message
ref over TOPIC_POSITION, BULK_PROCESSING_HANDLER: Position Handler Consume (bulk-abort)\n
POS_HANDLER -> TOPIC_BULK_PROCESSING: Produce message
end
|||
loop n times, n = number of individual transfers
TOPIC_BULK_PROCESSING <- BULK_PROCESSING_HANDLER: Consume individual transfer message
ref over TOPIC_BULK_PROCESSING, TOPIC_NOTIFICATIONS: Bulk Processing Handler Consume (bulk-abort)\n
end
BULK_PROCESSING_HANDLER -> TOPIC_NOTIFICATIONS: Produce message (Payer)
BULK_PROCESSING_HANDLER -> TOPIC_NOTIFICATIONS: Produce message (Payee)
TOPIC_NOTIFICATIONS <- NOTIFY_HANDLER: Consume message (Payer)
TOPIC_NOTIFICATIONS <- NOTIFY_HANDLER: Consume message (Payee)
opt action == 'bulk-abort'
|||
ref over DFSP1, TOPIC_NOTIFICATIONS: Notification Handler (Payer)\n
NOTIFY_HANDLER -> DFSP1: Send callback notification
end
|||
opt action == 'bulk-abort'
|||
ref over DFSP2, TOPIC_NOTIFICATIONS: Notification Handler (Payee)\n
NOTIFY_HANDLER -> DFSP2: Send callback notification
end
|||
end
activate POS_HANDLER
activate FULFIL_HANDLER
activate FULFIL_HANDLER
activate NOTIFY_HANDLER
@enduml

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Bulk Transfer Abort Overview [includes individual transfers in a Bulk]

Sequence design diagram for the Bulk Transfer Abort process.

## Sequence Diagram

{% uml src="mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml" %}
{% enduml %}
Loading