From 2d4313d65a9d7351d3d0b0ebad32c8e2a4286025 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Thu, 2 Jul 2020 11:28:57 +0100 Subject: [PATCH 01/15] Update bulk transfers prepare sequence diagram. Fix error with abort sequence diagram --- ...-bulk-1.1.0-bulk-prepare-overview.plantuml | 42 +-- ...q-bulk-1.1.1-bulk-prepare-handler.plantuml | 251 ++++++++---------- .../seq-bulk-4.1.0-abort-overview.plantuml | 28 +- 3 files changed, 149 insertions(+), 172 deletions(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.0-bulk-prepare-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.0-bulk-prepare-overview.plantuml index c3f3bf96f..013867edf 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.0-bulk-prepare-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.0-bulk-prepare-overview.plantuml @@ -38,8 +38,8 @@ autonumber ' declare actors actor "DFSP1\nPayer" as DFSP1 actor "DFSP2\nPayee" as DFSP2 -boundary "ML API Adapter" as MLAPI -control "ML API Notification \nHandler" as NOTIFY_HANDLER +boundary "Bulk API Adapter" as BULK_API +control "Bulk API Notification \nHandler" as NOTIFY_HANDLER collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE boundary "Central Service API" as CSAPI collections "topic-\nbulk-prepare" as TOPIC_BULK_PREPARE @@ -57,8 +57,8 @@ box "Financial Service Providers" #lightGray participant DFSP2 end box -box "ML API Adapter Service" #LightBlue - participant MLAPI +box "Bulk API Adapter Service" #LightBlue + participant BULK_API participant NOTIFY_HANDLER end box @@ -123,14 +123,16 @@ group DFSP1 sends a Bulk Prepare Transfer request to DFSP2 expiration: <string> } end note - DFSP1 ->> MLAPI: POST - /bulkTransfers - activate MLAPI - MLAPI -> MLAPI: Validate incoming message\n<color #FF0000><b>Error codes:</b> 3000-3002, 3100-3107</color> - MLAPI -> OBJECT_STORE: Persist incoming bulk message to\nobject store: **MLOS.individualTransfers** - activate OBJECT_STORE - OBJECT_STORE --> MLAPI: Return messageId reference to the stored object(s) - deactivate OBJECT_STORE - note right of MLAPI #yellow + DFSP1 ->> BULK_API: POST - /bulkTransfers + activate BULK_API + BULK_API -> BULK_API: Validate incoming message\n<color #FF0000><b>Error codes:</b> 3000-3002, 3100-3107</color> + loop + BULK_API -> OBJECT_STORE: Persist individual transfers in the bulk to\nobject store: **MLOS.individualTransfers** + activate OBJECT_STORE + OBJECT_STORE --> BULK_API: Return messageId reference to the stored object(s) + deactivate OBJECT_STORE + end + note right of BULK_API #yellow Message: { id: <messageId> @@ -162,19 +164,19 @@ group DFSP1 sends a Bulk Prepare Transfer request to DFSP2 } } end note - MLAPI -> TOPIC_BULK_PREPARE: Route & Publish Bulk Prepare event \nfor Payer\n<color #FF0000><b>Error code:</b> 2003</color> + BULK_API -> TOPIC_BULK_PREPARE: Route & Publish Bulk Prepare event \nfor Payer\n<color #FF0000><b>Error code:</b> 2003</color> activate TOPIC_BULK_PREPARE TOPIC_BULK_PREPARE <-> TOPIC_BULK_PREPARE: Ensure event is replicated \nas configured (ACKS=all)\n<color #FF0000><b>Error code:</b> 2003</color> - TOPIC_BULK_PREPARE --> MLAPI: Respond replication acknowledgements \nhave been received + TOPIC_BULK_PREPARE --> BULK_API: Respond replication acknowledgements \nhave been received deactivate TOPIC_BULK_PREPARE - MLAPI -->> DFSP1: Respond HTTP - 202 (Accepted) - deactivate MLAPI + BULK_API -->> DFSP1: Respond HTTP - 202 (Accepted) + deactivate BULK_API ||| TOPIC_BULK_PREPARE <- BULK_PREP_HANDLER: Consume message - BULK_PREP_HANDLER -> OBJECT_STORE: Retrieve individual transfers by key:\n**MLOS.individualTransfers.messageId** - activate OBJECT_STORE - OBJECT_STORE --> BULK_PREP_HANDLER: Stream bulk's individual transfers - deactivate OBJECT_STORE + ' BULK_PREP_HANDLER -> OBJECT_STORE: Retrieve individual transfers by key:\n**MLOS.individualTransfers.messageId** + ' activate OBJECT_STORE + ' OBJECT_STORE --> BULK_PREP_HANDLER: Stream bulk's individual transfers + ' deactivate OBJECT_STORE ref over TOPIC_BULK_PREPARE, BULK_PREP_HANDLER, TOPIC_TRANSFER_PREPARE: Bulk Prepare Handler Consume \n alt Success BULK_PREP_HANDLER -> TOPIC_TRANSFER_PREPARE: Produce (stream) single transfer message\nfor each individual transfer [loop] diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.1-bulk-prepare-handler.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.1-bulk-prepare-handler.plantuml index 8cd357671..f62863067 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.1-bulk-prepare-handler.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.1-bulk-prepare-handler.plantuml @@ -67,29 +67,29 @@ group Bulk Prepare Handler Consume activate TOPIC_BULK_PREPARE deactivate TOPIC_BULK_PREPARE - break - group Validate Event - BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Validate event - Rule: type == 'bulk-prepare' && action == 'bulk-prepare'\n<color #FF0000><b>Error codes:</b> 2001</color> - end - end + ' break + ' group Validate Event + ' BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Validate event - Rule: type == 'bulk-prepare' && action == 'bulk-prepare'\n<color #FF0000><b>Error codes:</b> 2001</color> + ' end + ' end - group Persist Event Information - ||| - BULK_PREP_HANDLER -> TOPIC_EVENTS: Publish event information - ref over BULK_PREP_HANDLER, TOPIC_EVENTS : Event Handler Consume\n - ||| - end + ' group Persist Event Information + ' ||| + ' BULK_PREP_HANDLER -> TOPIC_EVENTS: Publish event information + ' ref over BULK_PREP_HANDLER, TOPIC_EVENTS : Event Handler Consume\n + ' ||| + ' end group Validate Bulk Prepare Transfer - BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: <color #gray>Schema validation of the incoming message</color> - BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: <color #gray>Verify the message's signature (to be confirmed in future requirement)</color> - note right of BULK_PREP_HANDLER #lightgrey - The above validation steps are already handled by the - Bulk-API-Adapter for the open source implementation. - It may need to be added in future for custom adapters. - end note + ' BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: <color #gray>Schema validation of the incoming message</color> + ' BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: <color #gray>Verify the message's signature (to be confirmed in future requirement)</color> + ' note right of BULK_PREP_HANDLER #lightgrey + ' The above validation steps are already handled by the + ' Bulk-API-Adapter for the open source implementation. + ' It may need to be added in future for custom adapters. + ' end note - group Validate Duplicate Check + group Duplicate Check note right of BULK_PREP_HANDLER #cyan The Specification doesn't touch on the duplicate handling of bulk transfers, so the current design mostly follows the @@ -104,58 +104,12 @@ group Bulk Prepare Handler Consume end note ||| BULK_PREP_HANDLER -> DB: Request Duplicate Check - ref over BULK_PREP_HANDLER, DB: Request Duplicate Check (using message.content.payload.hash)\n + ref over BULK_PREP_HANDLER, DB: Request Duplicate Check (using message.content.payload)\n DB --> BULK_PREP_HANDLER: Return { hasDuplicateId: Boolean, hasDuplicateHash: Boolean } end alt hasDuplicateId == TRUE && hasDuplicateHash == TRUE - break - BULK_PREP_HANDLER -> BULK_DAO: Request to retrieve Bulk Transfer state & completedTimestamp\n<color #FF0000><b>Error code:</b> 2003</color> - activate BULK_DAO - BULK_DAO -> DB: Query database - hnote over DB #lightyellow - bulkTransfer - bulkTransferFulfilment - bulkTransferStateChange - end note - activate DB - BULK_DAO <-- DB: Return resultset - deactivate DB - BULK_DAO --> BULK_PREP_HANDLER: Return **bulkTransferStateId** & **completedTimestamp** (not null when completed) - deactivate BULK_DAO - - note right of BULK_PREP_HANDLER #yellow - Message: - { - id: <messageId> - from: <ledgerName>, - to: <payerFspName>, - type: application/json - content: { - headers: <bulkTransferHeaders>, - payload: { - bulkTransferState: <string>, - completedTimestamp: <optional> - } - }, - metadata: { - event: { - id: <uuid>, - responseTo: <previous.uuid>, - type: "notification", - action: "bulk-prepare-duplicate", - createdAt: <timestamp>, - state: { - status: "success", - code: 0 - } - } - } - } - end note - BULK_PREP_HANDLER -> TOPIC_NOTIFICATIONS: Publish Notification event for Payer - activate TOPIC_NOTIFICATIONS - deactivate TOPIC_NOTIFICATIONS + break Return TRUE & Log ('Not implemented') end else hasDuplicateId == TRUE && hasDuplicateHash == FALSE note right of BULK_PREP_HANDLER #yellow @@ -205,39 +159,43 @@ group Bulk Prepare Handler Consume activate TOPIC_NOTIFICATIONS deactivate TOPIC_NOTIFICATIONS else hasDuplicateId == FALSE - group Validate Payer - BULK_PREP_HANDLER -> PARTICIPANT_DAO: Request to retrieve Payer Participant details (if it exists) - activate PARTICIPANT_DAO - PARTICIPANT_DAO -> DB: Request Participant details - hnote over DB #lightyellow - participant - participantCurrency - end note - activate DB - PARTICIPANT_DAO <-- DB: Return Participant details if it exists - deactivate DB - PARTICIPANT_DAO --> BULK_PREP_HANDLER: Return Participant details if it exists - deactivate PARTICIPANT_DAO - BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Validate Payer\n<color #FF0000><b>Error codes:</b> 3202</color> - end - group Validate Payee - BULK_PREP_HANDLER -> PARTICIPANT_DAO: Request to retrieve Payee Participant details (if it exists) - activate PARTICIPANT_DAO - PARTICIPANT_DAO -> DB: Request Participant details - hnote over DB #lightyellow - participant - participantCurrency - end note - activate DB - PARTICIPANT_DAO <-- DB: Return Participant details if it exists - deactivate DB - PARTICIPANT_DAO --> BULK_PREP_HANDLER: Return Participant details if it exists - deactivate PARTICIPANT_DAO - BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Validate Payee\n<color #FF0000><b>Error codes:</b> 3203</color> + group Validate Bulk Transfer Prepare Request + BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: FSPIOP Source matches Payer + BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Check expiration + BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Payer and Payee FSP's are different + group Validate Payer + BULK_PREP_HANDLER -> PARTICIPANT_DAO: Request to retrieve Payer Participant details (if it exists) + activate PARTICIPANT_DAO + PARTICIPANT_DAO -> DB: Request Participant details + hnote over DB #lightyellow + participant + participantCurrency + end note + activate DB + PARTICIPANT_DAO <-- DB: Return Participant details if it exists + deactivate DB + PARTICIPANT_DAO --> BULK_PREP_HANDLER: Return Participant details if it exists + deactivate PARTICIPANT_DAO + BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Validate Payer\n<color #FF0000><b>Error codes:</b> 3202</color> + end + group Validate Payee + BULK_PREP_HANDLER -> PARTICIPANT_DAO: Request to retrieve Payee Participant details (if it exists) + activate PARTICIPANT_DAO + PARTICIPANT_DAO -> DB: Request Participant details + hnote over DB #lightyellow + participant + participantCurrency + end note + activate DB + PARTICIPANT_DAO <-- DB: Return Participant details if it exists + deactivate DB + PARTICIPANT_DAO --> BULK_PREP_HANDLER: Return Participant details if it exists + deactivate PARTICIPANT_DAO + BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Validate Payee\n<color #FF0000><b>Error codes:</b> 3203</color> + end end - BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Validate crypto-condition\n<color #FF0000><b>Error codes:</b> 3100</color> - - alt Validate Bulk Prepare Transfer (success) + ||| + alt Validate Bulk Transfer Prepare Request (success) group Persist Bulk Transfer State (with bulkTransferState='RECEIVED') BULK_PREP_HANDLER -> BULK_DAO: Request to persist bulk transfer\n<color #FF0000><b>Error codes:</b> 2003</color> activate BULK_DAO @@ -249,10 +207,10 @@ group Bulk Prepare Handler Consume end note activate DB deactivate DB - BULK_DAO --> BULK_PREP_HANDLER: Return success + BULK_DAO --> BULK_PREP_HANDLER: Return state deactivate BULK_DAO end - else Validate Bulk Prepare Transfer (failure) + else Validate Bulk Transfer Prepare Request (failure) group Persist Bulk Transfer State (with bulkTransferState='INVALID') (Introducing a new status INVALID to mark these entries) BULK_PREP_HANDLER -> BULK_DAO: Request to persist bulk transfer\n(when Payee/Payer/crypto-condition validation fails)\n<color #FF0000><b>Error codes:</b> 2003</color> activate BULK_DAO @@ -265,7 +223,7 @@ group Bulk Prepare Handler Consume end note activate DB deactivate DB - BULK_DAO --> BULK_PREP_HANDLER: Return success + BULK_DAO --> BULK_PREP_HANDLER: Return state deactivate BULK_DAO end end @@ -288,10 +246,11 @@ group Bulk Prepare Handler Consume BULK_DAO -> DB: Insert bulkTransferAssociation hnote over DB #lightyellow bulkTransferAssociation + bulkTransferStateChange end note activate DB deactivate DB - BULK_DAO --> BULK_PREP_HANDLER: Return success + BULK_DAO --> BULK_PREP_HANDLER: Return state deactivate BULK_DAO end @@ -322,46 +281,60 @@ group Bulk Prepare Handler Consume } } end note - BULK_PREP_HANDLER -> TOPIC_TRANSFER_PREPARE: Route & Publish Prepare event to the Payer for the Individual Transfer\n<color #FF0000><b>Error codes:</b> 2003</color> + BULK_PREP_HANDLER -> TOPIC_TRANSFER_PREPARE: Route & Publish Prepare event to the Payee for the Individual Transfer\n<color #FF0000><b>Error codes:</b> 2003</color> activate TOPIC_TRANSFER_PREPARE deactivate TOPIC_TRANSFER_PREPARE end else Validate Bulk Prepare Transfer (failure) - note right of BULK_PREP_HANDLER #yellow - Message: - { - id: <messageId> - from: <ledgerName>, - to: <bulkTransferMessage.payerFsp>, - type: "application/json", - content: { - headers: <bulkTransferHeaders>, - payload: { - "errorInformation": { - "errorCode": <possible codes: [2003, 3100, 3105, 3106, 3202, 3203, 3300, 3301]> - "errorDescription": "<refer to section 7.6 for description>", - "extensionList": <transferMessage.extensionList> - } - }, - metadata: { - event: { - id: <uuid>, - responseTo: <previous.uuid>, - type: "bulk-processing", - action: "bulk-abort", - createdAt: <timestamp>, - state: { - status: "error", - code: <errorInformation.errorCode> - description: <errorInformation.errorDescription> - } - } - } - } - end note - BULK_PREP_HANDLER -> TOPIC_BULK_PROCESSING: Publish Processing (failure) event for Payer\n<color #FF0000><b>Error codes:</b> 2003</color> - activate TOPIC_BULK_PROCESSING - deactivate TOPIC_BULK_PROCESSING + ' note right of BULK_PREP_HANDLER #yellow + ' Message: + ' { + ' id: <messageId> + ' from: <ledgerName>, + ' to: <bulkTransferMessage.payerFsp>, + ' type: "application/json", + ' content: { + ' headers: <bulkTransferHeaders>, + ' payload: { + ' "errorInformation": { + ' "errorCode": <possible codes: [2003, 3100, 3105, 3106, 3202, 3203, 3300, 3301]> + ' "errorDescription": "<refer to section 7.6 for description>", + ' "extensionList": <transferMessage.extensionList> + ' } + ' }, + ' metadata: { + ' event: { + ' id: <uuid>, + ' responseTo: <previous.uuid>, + ' type: "bulk-processing", + ' action: "bulk-abort", + ' createdAt: <timestamp>, + ' state: { + ' status: "error", + ' code: <errorInformation.errorCode> + ' description: <errorInformation.errorDescription> + ' } + ' } + ' } + ' } + ' end note + ' BULK_PREP_HANDLER -> TOPIC_BULK_PROCESSING: Publish Processing (failure) event for Payer\n<color #FF0000><b>Error codes:</b> 2003</color> + ' activate TOPIC_BULK_PROCESSING + ' deactivate TOPIC_BULK_PROCESSING + group Insert Bulk Transfer Association (with bulkProcessingState='INVALID') + BULK_PREP_HANDLER -> BULK_DAO: Request to persist bulk transfer association\n<color #FF0000><b>Error codes:</b> 2003</color> + activate BULK_DAO + BULK_DAO -> DB: Insert bulkTransferAssociation + hnote over DB #lightyellow + bulkTransferAssociation + bulkTransferStateChange + end note + activate DB + deactivate DB + BULK_DAO --> BULK_PREP_HANDLER: Return state + deactivate BULK_DAO + end + end end deactivate BULK_PREP_HANDLER diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml index 960998af2..48febb96b 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml @@ -124,6 +124,21 @@ group DFSP2 sends a Fulfil Abort Transfer request end note DFSP2 ->> BULKAPI: **PUT - /bulkTransfers/<ID>/error** activate BULKAPI + + 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 + BULKAPI <- CACHE: Response of save operation + deactivate CACHE note right of BULKAPI #yellow Message: { @@ -149,19 +164,6 @@ group DFSP2 sends a Fulfil Abort Transfer request } } 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 From a1c58fbc54f81b86a9cdfa439442beae79fff7a5 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Thu, 2 Jul 2020 11:34:22 +0100 Subject: [PATCH 02/15] Remove commented lines --- ...-bulk-1.1.0-bulk-prepare-overview.plantuml | 4 - ...q-bulk-1.1.1-bulk-prepare-handler.plantuml | 92 +++++++------------ 2 files changed, 35 insertions(+), 61 deletions(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.0-bulk-prepare-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.0-bulk-prepare-overview.plantuml index 013867edf..5bdd8119f 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.0-bulk-prepare-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.0-bulk-prepare-overview.plantuml @@ -173,10 +173,6 @@ group DFSP1 sends a Bulk Prepare Transfer request to DFSP2 deactivate BULK_API ||| TOPIC_BULK_PREPARE <- BULK_PREP_HANDLER: Consume message - ' BULK_PREP_HANDLER -> OBJECT_STORE: Retrieve individual transfers by key:\n**MLOS.individualTransfers.messageId** - ' activate OBJECT_STORE - ' OBJECT_STORE --> BULK_PREP_HANDLER: Stream bulk's individual transfers - ' deactivate OBJECT_STORE ref over TOPIC_BULK_PREPARE, BULK_PREP_HANDLER, TOPIC_TRANSFER_PREPARE: Bulk Prepare Handler Consume \n alt Success BULK_PREP_HANDLER -> TOPIC_TRANSFER_PREPARE: Produce (stream) single transfer message\nfor each individual transfer [loop] diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.1-bulk-prepare-handler.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.1-bulk-prepare-handler.plantuml index f62863067..a9c53292f 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.1-bulk-prepare-handler.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-1.1.1-bulk-prepare-handler.plantuml @@ -66,29 +66,7 @@ group Bulk Prepare Handler Consume TOPIC_BULK_PREPARE <- BULK_PREP_HANDLER: Consume Bulk Prepare message activate TOPIC_BULK_PREPARE deactivate TOPIC_BULK_PREPARE - - ' break - ' group Validate Event - ' BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: Validate event - Rule: type == 'bulk-prepare' && action == 'bulk-prepare'\n<color #FF0000><b>Error codes:</b> 2001</color> - ' end - ' end - - ' group Persist Event Information - ' ||| - ' BULK_PREP_HANDLER -> TOPIC_EVENTS: Publish event information - ' ref over BULK_PREP_HANDLER, TOPIC_EVENTS : Event Handler Consume\n - ' ||| - ' end - group Validate Bulk Prepare Transfer - ' BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: <color #gray>Schema validation of the incoming message</color> - ' BULK_PREP_HANDLER <-> BULK_PREP_HANDLER: <color #gray>Verify the message's signature (to be confirmed in future requirement)</color> - ' note right of BULK_PREP_HANDLER #lightgrey - ' The above validation steps are already handled by the - ' Bulk-API-Adapter for the open source implementation. - ' It may need to be added in future for custom adapters. - ' end note - group Duplicate Check note right of BULK_PREP_HANDLER #cyan The Specification doesn't touch on the duplicate handling @@ -286,41 +264,41 @@ group Bulk Prepare Handler Consume deactivate TOPIC_TRANSFER_PREPARE end else Validate Bulk Prepare Transfer (failure) - ' note right of BULK_PREP_HANDLER #yellow - ' Message: - ' { - ' id: <messageId> - ' from: <ledgerName>, - ' to: <bulkTransferMessage.payerFsp>, - ' type: "application/json", - ' content: { - ' headers: <bulkTransferHeaders>, - ' payload: { - ' "errorInformation": { - ' "errorCode": <possible codes: [2003, 3100, 3105, 3106, 3202, 3203, 3300, 3301]> - ' "errorDescription": "<refer to section 7.6 for description>", - ' "extensionList": <transferMessage.extensionList> - ' } - ' }, - ' metadata: { - ' event: { - ' id: <uuid>, - ' responseTo: <previous.uuid>, - ' type: "bulk-processing", - ' action: "bulk-abort", - ' createdAt: <timestamp>, - ' state: { - ' status: "error", - ' code: <errorInformation.errorCode> - ' description: <errorInformation.errorDescription> - ' } - ' } - ' } - ' } - ' end note - ' BULK_PREP_HANDLER -> TOPIC_BULK_PROCESSING: Publish Processing (failure) event for Payer\n<color #FF0000><b>Error codes:</b> 2003</color> - ' activate TOPIC_BULK_PROCESSING - ' deactivate TOPIC_BULK_PROCESSING + note right of BULK_PREP_HANDLER #yellow + Message: + { + id: <messageId> + from: <ledgerName>, + to: <bulkTransferMessage.payerFsp>, + type: "application/json", + content: { + headers: <bulkTransferHeaders>, + payload: { + "errorInformation": { + "errorCode": <possible codes: [2003, 3100, 3105, 3106, 3202, 3203, 3300, 3301]> + "errorDescription": "<refer to section 7.6 for description>", + "extensionList": <transferMessage.extensionList> + } + }, + metadata: { + event: { + id: <uuid>, + responseTo: <previous.uuid>, + type: "bulk-processing", + action: "bulk-abort", + createdAt: <timestamp>, + state: { + status: "error", + code: <errorInformation.errorCode> + description: <errorInformation.errorDescription> + } + } + } + } + end note + BULK_PREP_HANDLER -> TOPIC_BULK_PROCESSING: Publish Processing (failure) event for Payer\n<color #FF0000><b>Error codes:</b> 2003</color> + activate TOPIC_BULK_PROCESSING + deactivate TOPIC_BULK_PROCESSING group Insert Bulk Transfer Association (with bulkProcessingState='INVALID') BULK_PREP_HANDLER -> BULK_DAO: Request to persist bulk transfer association\n<color #FF0000><b>Error codes:</b> 2003</color> activate BULK_DAO From fcd00367e502536e2d209c6b1c4ceb467eb5855b Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Thu, 2 Jul 2020 11:35:31 +0100 Subject: [PATCH 03/15] Bump version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1965ea805..b3ea44477 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "documentation", - "version": "10.5.0", + "version": "10.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a4d6df96c..c662ecc1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "documentation", - "version": "10.5.0", + "version": "10.5.1", "description": "Mojaloop Documentation GitBook Project", "dependencies": { "express": "4.17.1", From 067e966fcfef4d0345681082cc2c71f1181cbd31 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Mon, 6 Jul 2020 12:07:05 +0100 Subject: [PATCH 04/15] Add page and sequence diagram for GET bulk transfer operation --- SUMMARY.md | 1 + .../seq-bulk-5.1.0-lookup-overview.plantuml | 191 ++++++++++++++++++ ...5.1.0-transfer-lookup-overview-for-bulk.md | 8 + 3 files changed, 200 insertions(+) create mode 100644 mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-lookup-overview.plantuml create mode 100644 mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md diff --git a/SUMMARY.md b/SUMMARY.md index 394d2e454..a00e55b47 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -95,6 +95,7 @@ * [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) + * [Bulk Lookup Overview](mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-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) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-lookup-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-lookup-overview.plantuml new file mode 100644 index 000000000..9695627e1 --- /dev/null +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-lookup-overview.plantuml @@ -0,0 +1,191 @@ +/'***** + 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 +' declate title +title 5.1.0. Request Bulk Transfer Status + +autonumber + +' declare actors +actor "DFSP(n)\nParticipant" as DFSP +control "Bulk API Notification Event Handler" as NOTIFY_HANDLER +boundary "Bulk API Adapter" as BULKAPI +collections "Topic-Transfer-Get" as TOPIC_GET +control "GET Event Handler" as GET_HANDLER +entity "Bulk Transfer DAO" as TRANSFER_DAO +database "Central Store" as DB + +box "Financial Service Provider" #lightGray + participant DFSP +end box + +box "Bulk API Adapter Service" #LightBlue + participant BULKAPI + participant NOTIFY_HANDLER +end box + +box "Central Ledger" #LightYellow + participant TOPIC_GET + participant GET_HANDLER + participant TRANSFER_DAO + participant DB +end box + +' start flow +group Request transfer status + activate DFSP + DFSP -> BULKAPI: Request bulk transfer status - GET - /bulkTransfers/{ID} + ||| + BULKAPI -> TOPIC_GET: Publish event information + activate TOPIC_GET + ||| + ref over TOPIC_GET, GET_HANDLER : GET Handler Consume\n + ||| + BULKAPI <-- TOPIC_GET: Return success + deactivate TOPIC_GET + + DFSP <-- BULKAPI: Respond HTTP - 200 (OK) + GET_HANDLER -> TOPIC_GET: Consume message + + activate GET_HANDLER + GET_HANDLER -> TRANSFER_DAO: Request transfer status + + activate TRANSFER_DAO + TRANSFER_DAO -> DB: Fetch transfer status + activate DB + hnote over DB #lightyellow + bulkTransferStateChange + bulkTransferState + bulkTransferError + bulkTransferExtension + transferStateChange + transferState + transferFulfilment + transferError + transferExtension + ilpPacket + end hnote + TRANSFER_DAO <-- DB: Return query result + deactivate DB + GET_HANDLER <-- TRANSFER_DAO: Return transfer status + deactivate TRANSFER_DAO + + alt Is there a bulk transfer with the given ID recorded in the system? + alt Request is from Payee FSP? + GET_HANDLER <-> GET_HANDLER: Filter out transfers not included in original request to Payee FSP, if any\n (e.g. in partial fulfilment scenario). + end + alt Yes AND transferState for all indvidual transfers is COMMITTED \nThis implies that a succesful transfer with the given ID is recorded in the system + note left of GET_HANDLER #yellow + { + "bulkTransferState": "COMMITTED", + "individualTransferResults": [ + { + "fulfilment": "WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8", + "transferState": "COMMITTED", + "extensionList": { + "extension": + [ + { + "key": "Description", + "value": "This is a more detailed description" + } + ] + } + } + ] + "completedTimestamp": "2018-09-24T08:38:08.699-04:00", + "extensionList": + { + "extension": + [ + { + "key": "Description", + "value": "This is a more detailed description" + } + ] + } + } + end note + NOTIFY_HANDLER <- GET_HANDLER: Publish notification event + DFSP <- NOTIFY_HANDLER: callback PUT on /bulkTransfers/{ID} + else transferState for individual transfers in [ABORTED_REJECTED, EXPIRED_RESERVED] + note left of GET_HANDLER #yellow + { + "bulkTransferState": <bulk-state>, + "individualTransferResults": [ + { + "transferState": <state>, + "errorInformation": { + "errorCode": <error-code>, + "errorDescription": <error-description> + } + "extensionList": { + "extension": + [ + { + "key": "Description", + "value": "This is a more detailed description" + } + ] + } + } + ] + "completedTimestamp": "2018-09-24T08:38:08.699-04:00", + "extensionList": + { + "extension": + [ + { + "key": "Description", + "value": "This is a more detailed description" + } + ] + } + } + end note + NOTIFY_HANDLER <- GET_HANDLER: Publish notification event + deactivate GET_HANDLER + DFSP <- NOTIFY_HANDLER: callback PUT on /bulkTransfers/{ID} + end + note right of NOTIFY_HANDLER #lightgray + Log ERROR event + end note + else A bulk transfer with the given ID is not present in the System or this is an invalid request + note left of NOTIFY_HANDLER #yellow + { + "errorInformation": { + "errorCode": <integer>, + "errorDescription": "Client error description" + } + } + end note + DFSP <- NOTIFY_HANDLER: callback PUT on /bulkTransfers/{ID}/error + end + + deactivate GET_HANDLER + deactivate NOTIFY_HANDLER +deactivate DFSP +end +@enduml diff --git a/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md b/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md new file mode 100644 index 000000000..38f0d0675 --- /dev/null +++ b/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md @@ -0,0 +1,8 @@ +## Bulk Transfer Lookup Overview + +Sequence design diagram for the Bulk Transfer Lookup process. + +## Sequence Diagram + +{% uml src="mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-lookup-overview.plantuml" %} +{% enduml %} \ No newline at end of file From 291e2e2a3cf28441c09ad533d835829c7e73abd3 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Mon, 6 Jul 2020 12:11:47 +0100 Subject: [PATCH 05/15] Bump version to 10.6.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3ea44477..40e941f50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "documentation", - "version": "10.5.1", + "version": "10.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c662ecc1e..c4d074b26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "documentation", - "version": "10.5.1", + "version": "10.6.0", "description": "Mojaloop Documentation GitBook Project", "dependencies": { "express": "4.17.1", From 69f32a4da3ab576c970fb56b7f5eb332abf91894 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Mon, 6 Jul 2020 12:24:38 +0100 Subject: [PATCH 06/15] PR review updates --- SUMMARY.md | 2 +- ...erview.plantuml => seq-bulk-5.1.0-get-overview.plantuml} | 0 .../transfers/5.1.0-transfer-lookup-overview-for-bulk.md | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/{seq-bulk-5.1.0-lookup-overview.plantuml => seq-bulk-5.1.0-get-overview.plantuml} (100%) diff --git a/SUMMARY.md b/SUMMARY.md index e1ea519b7..bea08a0a9 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -100,7 +100,7 @@ * [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) - * [Bulk Lookup Overview](mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md) + * [Get Bulk Transfer Overview](mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-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) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-lookup-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml similarity index 100% rename from mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-lookup-overview.plantuml rename to mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml diff --git a/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md b/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md index 38f0d0675..e6a92bbf8 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md +++ b/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md @@ -1,8 +1,8 @@ -## Bulk Transfer Lookup Overview +## Get Bulk Transfer Overview -Sequence design diagram for the Bulk Transfer Lookup process. +Sequence design diagram for the Get Bulk Transfer process. ## Sequence Diagram -{% uml src="mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-lookup-overview.plantuml" %} +{% uml src="mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml" %} {% enduml %} \ No newline at end of file From c653446e240fe4367f1ac7ef6ac0cc6591e9ae6b Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Mon, 6 Jul 2020 12:58:58 +0100 Subject: [PATCH 07/15] PR review updates --- SUMMARY.md | 2 +- ...view-for-bulk.md => 5.1.0-transfer-get-overview-for-bulk.md} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename mojaloop-technical-overview/central-bulk-transfers/transfers/{5.1.0-transfer-lookup-overview-for-bulk.md => 5.1.0-transfer-get-overview-for-bulk.md} (100%) diff --git a/SUMMARY.md b/SUMMARY.md index bea08a0a9..62b0f8ce8 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -100,7 +100,7 @@ * [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) - * [Get Bulk Transfer Overview](mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md) + * [Get Bulk Transfer Overview](mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-get-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) diff --git a/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md b/mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-get-overview-for-bulk.md similarity index 100% rename from mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-lookup-overview-for-bulk.md rename to mojaloop-technical-overview/central-bulk-transfers/transfers/5.1.0-transfer-get-overview-for-bulk.md From 5f601425794755f977e7df4c9bb192c3b59ed05e Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Tue, 7 Jul 2020 13:08:59 +0100 Subject: [PATCH 08/15] PR review updates --- .../seq-bulk-5.1.0-get-overview.plantuml | 135 ++++++++---------- 1 file changed, 62 insertions(+), 73 deletions(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml index 9695627e1..18f9b651b 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml @@ -40,12 +40,10 @@ database "Central Store" as DB box "Financial Service Provider" #lightGray participant DFSP end box - box "Bulk API Adapter Service" #LightBlue participant BULKAPI participant NOTIFY_HANDLER end box - box "Central Ledger" #LightYellow participant TOPIC_GET participant GET_HANDLER @@ -57,23 +55,27 @@ end box group Request transfer status activate DFSP DFSP -> BULKAPI: Request bulk transfer status - GET - /bulkTransfers/{ID} + activate BULKAPI ||| BULKAPI -> TOPIC_GET: Publish event information + deactivate BULKAPI activate TOPIC_GET ||| ref over TOPIC_GET, GET_HANDLER : GET Handler Consume\n ||| BULKAPI <-- TOPIC_GET: Return success + deactivate GET_HANDLER + activate BULKAPI deactivate TOPIC_GET - DFSP <-- BULKAPI: Respond HTTP - 200 (OK) + deactivate DFSP + deactivate BULKAPI GET_HANDLER -> TOPIC_GET: Consume message - activate GET_HANDLER GET_HANDLER -> TRANSFER_DAO: Request transfer status - activate TRANSFER_DAO TRANSFER_DAO -> DB: Fetch transfer status + activate DB hnote over DB #lightyellow bulkTransferStateChange @@ -89,86 +91,70 @@ group Request transfer status end hnote TRANSFER_DAO <-- DB: Return query result deactivate DB + GET_HANDLER <-- TRANSFER_DAO: Return transfer status deactivate TRANSFER_DAO alt Is there a bulk transfer with the given ID recorded in the system? - alt Request is from Payee FSP? - GET_HANDLER <-> GET_HANDLER: Filter out transfers not included in original request to Payee FSP, if any\n (e.g. in partial fulfilment scenario). - end - alt Yes AND transferState for all indvidual transfers is COMMITTED \nThis implies that a succesful transfer with the given ID is recorded in the system + alt Bulk Transfer state is **"PROCESSING"** note left of GET_HANDLER #yellow { - "bulkTransferState": "COMMITTED", - "individualTransferResults": [ - { - "fulfilment": "WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8", - "transferState": "COMMITTED", - "extensionList": { - "extension": - [ - { - "key": "Description", - "value": "This is a more detailed description" - } - ] - } - } - ] - "completedTimestamp": "2018-09-24T08:38:08.699-04:00", - "extensionList": - { - "extension": - [ - { - "key": "Description", - "value": "This is a more detailed description" - } - ] - } + "bulkTransferState": "PROCESSING" } end note NOTIFY_HANDLER <- GET_HANDLER: Publish notification event - DFSP <- NOTIFY_HANDLER: callback PUT on /bulkTransfers/{ID} - else transferState for individual transfers in [ABORTED_REJECTED, EXPIRED_RESERVED] - note left of GET_HANDLER #yellow - { - "bulkTransferState": <bulk-state>, - "individualTransferResults": [ - { - "transferState": <state>, - "errorInformation": { - "errorCode": <error-code>, - "errorDescription": <error-description> - } - "extensionList": { - "extension": - [ - { - "key": "Description", - "value": "This is a more detailed description" - } - ] - } + deactivate GET_HANDLER + activate NOTIFY_HANDLER + NOTIFY_HANDLER -> DFSP: Send callback - PUT /bulkTransfers/{ID} + deactivate NOTIFY_HANDLER + end + ||| + alt Request is from Payee FSP? + GET_HANDLER <-> GET_HANDLER: Exclude transfers with **transferStateId** not in \n [ **COMMITTED**, **ABORTED_REJECTED**, **EXPIRED_RESERVED** ] + activate GET_HANDLER + end + + note left of GET_HANDLER #yellow + { + "bulkTransferState": "<BulkTransferState>", + "individualTransferResults": [ + { + "transferId": "<TransferId>", + "fulfilment": "WLctttbu2HvTsa1XWvUoGRcQozHsqeu9Ahl2JW9Bsu8", + "errorInformation": <ErrorInformationObject>, + "extensionList": { + "extension": + [ + { + "key": "Description", + "value": "This is a more detailed description" + } + ] } - ] - "completedTimestamp": "2018-09-24T08:38:08.699-04:00", - "extensionList": - { - "extension": - [ - { - "key": "Description", - "value": "This is a more detailed description" - } - ] } + ], + "completedTimestamp": "2018-09-24T08:38:08.699-04:00", + "extensionList": + { + "extension": + [ + { + "key": "Description", + "value": "This is a more detailed description" + } + ] } - end note - NOTIFY_HANDLER <- GET_HANDLER: Publish notification event - deactivate GET_HANDLER - DFSP <- NOTIFY_HANDLER: callback PUT on /bulkTransfers/{ID} - end + } + end note + note left of GET_HANDLER #lightGray + NOTE: If transfer is REJECTED, error information may be provided. + Either fulfilment or errorInformation should be set, not both. + end note + NOTIFY_HANDLER <- GET_HANDLER: Publish notification event + deactivate GET_HANDLER + activate NOTIFY_HANDLER + DFSP <- NOTIFY_HANDLER: callback PUT on /bulkTransfers/{ID} + deactivate NOTIFY_HANDLER note right of NOTIFY_HANDLER #lightgray Log ERROR event end note @@ -181,7 +167,10 @@ group Request transfer status } } end note + GET_HANDLER -> NOTIFY_HANDLER: Publish notification event (404) + activate NOTIFY_HANDLER DFSP <- NOTIFY_HANDLER: callback PUT on /bulkTransfers/{ID}/error + deactivate NOTIFY_HANDLER end deactivate GET_HANDLER From 7fa7e504459f249afb87092885ceba96f323fd24 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Tue, 7 Jul 2020 13:15:24 +0100 Subject: [PATCH 09/15] Minor tweak to SD --- .../sequence/seq-bulk-5.1.0-get-overview.plantuml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml index 18f9b651b..1217200f5 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml @@ -61,16 +61,16 @@ group Request transfer status deactivate BULKAPI activate TOPIC_GET ||| - ref over TOPIC_GET, GET_HANDLER : GET Handler Consume\n - ||| - BULKAPI <-- TOPIC_GET: Return success deactivate GET_HANDLER - activate BULKAPI - deactivate TOPIC_GET + DFSP <-- BULKAPI: Respond HTTP - 200 (OK) deactivate DFSP deactivate BULKAPI GET_HANDLER -> TOPIC_GET: Consume message + ||| + ref over TOPIC_GET, GET_HANDLER : GET Handler Consume\n + ||| + deactivate TOPIC_GET activate GET_HANDLER GET_HANDLER -> TRANSFER_DAO: Request transfer status activate TRANSFER_DAO From f0a4e84e50d5c3f62f208928ff4e1740ca261a57 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Wed, 8 Jul 2020 13:03:24 +0100 Subject: [PATCH 10/15] Update mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml Co-authored-by: Sam <10507686+elnyry-sam-k@users.noreply.github.com> --- .../diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml index 1217200f5..fc49b70f3 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml @@ -52,7 +52,7 @@ box "Central Ledger" #LightYellow end box ' start flow -group Request transfer status +group Request Bulk transfer status activate DFSP DFSP -> BULKAPI: Request bulk transfer status - GET - /bulkTransfers/{ID} activate BULKAPI From e9f5c993045f7b58c06e36aaddc39d66acd0a2aa Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Wed, 8 Jul 2020 13:03:53 +0100 Subject: [PATCH 11/15] Update mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml Co-authored-by: Sam <10507686+elnyry-sam-k@users.noreply.github.com> --- .../diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml index fc49b70f3..287e7c84d 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml @@ -162,7 +162,7 @@ group Request Bulk transfer status note left of NOTIFY_HANDLER #yellow { "errorInformation": { - "errorCode": <integer>, + "errorCode": 3210, "errorDescription": "Client error description" } } From 44518a77ec773980bb1209f92b583c6f52e33356 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Wed, 8 Jul 2020 14:07:49 +0100 Subject: [PATCH 12/15] GET Bulk Transfers diagram: add participants validation step --- .../seq-bulk-5.1.0-get-overview.plantuml | 47 +++++++++++++++---- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml index 287e7c84d..e219f2465 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-5.1.0-get-overview.plantuml @@ -34,7 +34,7 @@ control "Bulk API Notification Event Handler" as NOTIFY_HANDLER boundary "Bulk API Adapter" as BULKAPI collections "Topic-Transfer-Get" as TOPIC_GET control "GET Event Handler" as GET_HANDLER -entity "Bulk Transfer DAO" as TRANSFER_DAO +entity "Bulk Transfer DAO" as BULK_TRANSFER_DAO database "Central Store" as DB box "Financial Service Provider" #lightGray @@ -47,7 +47,7 @@ end box box "Central Ledger" #LightYellow participant TOPIC_GET participant GET_HANDLER - participant TRANSFER_DAO + participant BULK_TRANSFER_DAO participant DB end box @@ -71,10 +71,39 @@ group Request Bulk transfer status ref over TOPIC_GET, GET_HANDLER : GET Handler Consume\n ||| deactivate TOPIC_GET + + GET_HANDLER -> BULK_TRANSFER_DAO: Request bulk transfer participants + activate GET_HANDLER + activate BULK_TRANSFER_DAO + BULK_TRANSFER_DAO -> DB: Fetch bulk transfer participants + activate DB + hnote over DB #lightYellow + bulkTransfer + participant + end hnote + BULK_TRANSFER_DAO <-- DB: Return query result + deactivate DB + GET_HANDLER <-- BULK_TRANSFER_DAO: Return bulk transfer participants + deactivate BULK_TRANSFER_DAO + alt Is request not from bulk transfer Payer or Payee FSP? + note left of NOTIFY_HANDLER #yellow + { + "errorInformation": { + "errorCode": 3210, + "errorDescription": "Bulk transfer ID not found" + } + } + end note + GET_HANDLER -> NOTIFY_HANDLER: Publish notification event (404) + deactivate GET_HANDLER + activate NOTIFY_HANDLER + DFSP <- NOTIFY_HANDLER: callback PUT on /bulkTransfers/{ID}/error + deactivate NOTIFY_HANDLER + end + GET_HANDLER -> BULK_TRANSFER_DAO: Request bulk transfer status activate GET_HANDLER - GET_HANDLER -> TRANSFER_DAO: Request transfer status - activate TRANSFER_DAO - TRANSFER_DAO -> DB: Fetch transfer status + activate BULK_TRANSFER_DAO + BULK_TRANSFER_DAO -> DB: Fetch bulk transfer status activate DB hnote over DB #lightyellow @@ -89,11 +118,11 @@ group Request Bulk transfer status transferExtension ilpPacket end hnote - TRANSFER_DAO <-- DB: Return query result + BULK_TRANSFER_DAO <-- DB: Return query result deactivate DB - GET_HANDLER <-- TRANSFER_DAO: Return transfer status - deactivate TRANSFER_DAO + GET_HANDLER <-- BULK_TRANSFER_DAO: Return bulk transfer status + deactivate BULK_TRANSFER_DAO alt Is there a bulk transfer with the given ID recorded in the system? alt Bulk Transfer state is **"PROCESSING"** @@ -163,7 +192,7 @@ group Request Bulk transfer status { "errorInformation": { "errorCode": 3210, - "errorDescription": "Client error description" + "errorDescription": "Bulk transfer ID not found" } } end note From 217fb0996ff176ba9aacc2939b3bc6134f09d7d8 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Wed, 8 Jul 2020 14:22:41 +0100 Subject: [PATCH 13/15] Rename CACHE to MLOS --- .../seq-bulk-4.1.0-abort-overview.plantuml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml index 48febb96b..52d67e44e 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml @@ -51,7 +51,7 @@ 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 "Object Store" as MLOS database "Central Services DB" as DB box "Financial Service Providers" #lightGray @@ -76,7 +76,7 @@ box "Central Service" #LightYellow participant TOPIC_BULK_PROCESSING participant BULK_PROCESSING_HANDLER participant TOPIC_NOTIFICATIONS - participant CACHE + participant MLOS participant DB end box @@ -125,8 +125,8 @@ group DFSP2 sends a Fulfil Abort Transfer request DFSP2 ->> BULKAPI: **PUT - /bulkTransfers/<ID>/error** activate BULKAPI - BULKAPI -> CACHE: Persist request payload with messageId in cache - activate CACHE + BULKAPI -> MLOS: Persist request payload with messageId in cache + activate MLOS note right of BULKAPI #yellow Message: { messageId: <string>, @@ -134,11 +134,11 @@ group DFSP2 sends a Fulfil Abort Transfer request payload: <object> } end note - hnote over CACHE #lightyellow + hnote over MLOS #lightyellow individualTransferFulfils end hnote - BULKAPI <- CACHE: Response of save operation - deactivate CACHE + BULKAPI <- MLOS: Response of save operation + deactivate MLOS note right of BULKAPI #yellow Message: { From 28e677055a3aba576576995311e0daa5727379bf Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Wed, 8 Jul 2020 14:51:24 +0100 Subject: [PATCH 14/15] Make MLOS a collection --- .../seq-bulk-4.1.0-abort-overview.plantuml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml index 52d67e44e..f7801d9d7 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml @@ -51,7 +51,7 @@ 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 "Object Store" as MLOS +collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE database "Central Services DB" as DB box "Financial Service Providers" #lightGray @@ -76,7 +76,7 @@ box "Central Service" #LightYellow participant TOPIC_BULK_PROCESSING participant BULK_PROCESSING_HANDLER participant TOPIC_NOTIFICATIONS - participant MLOS + collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE participant DB end box @@ -125,8 +125,8 @@ group DFSP2 sends a Fulfil Abort Transfer request DFSP2 ->> BULKAPI: **PUT - /bulkTransfers/<ID>/error** activate BULKAPI - BULKAPI -> MLOS: Persist request payload with messageId in cache - activate MLOS + collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE: Persist request payload with messageId in cache + collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE note right of BULKAPI #yellow Message: { messageId: <string>, @@ -134,11 +134,11 @@ group DFSP2 sends a Fulfil Abort Transfer request payload: <object> } end note - hnote over MLOS #lightyellow + collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE #lightyellow individualTransferFulfils end hnote - BULKAPI <- MLOS: Response of save operation - deactivate MLOS + collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE: Response of save operation + collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE note right of BULKAPI #yellow Message: { From 582879ef6be933f5a47cb1981cb9f7fc36210ef3 Mon Sep 17 00:00:00 2001 From: Steven Oderayi <oderayi@gmail.com> Date: Wed, 8 Jul 2020 14:52:36 +0100 Subject: [PATCH 15/15] Make MLOS a collection --- .../sequence/seq-bulk-4.1.0-abort-overview.plantuml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml index f7801d9d7..e02a15142 100644 --- a/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml +++ b/mojaloop-technical-overview/central-bulk-transfers/assets/diagrams/sequence/seq-bulk-4.1.0-abort-overview.plantuml @@ -76,7 +76,7 @@ box "Central Service" #LightYellow participant TOPIC_BULK_PROCESSING participant BULK_PROCESSING_HANDLER participant TOPIC_NOTIFICATIONS - collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE + participant OBJECT_STORE participant DB end box @@ -125,8 +125,8 @@ group DFSP2 sends a Fulfil Abort Transfer request DFSP2 ->> BULKAPI: **PUT - /bulkTransfers/<ID>/error** activate BULKAPI - collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE: Persist request payload with messageId in cache - collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE + BULKAPI -> OBJECT_STORE: Persist request payload with messageId in cache + activate OBJECT_STORE note right of BULKAPI #yellow Message: { messageId: <string>, @@ -134,11 +134,11 @@ group DFSP2 sends a Fulfil Abort Transfer request payload: <object> } end note - collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE #lightyellow + hnote over OBJECT_STORE #lightyellow individualTransferFulfils end hnote - collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE: Response of save operation - collections "mojaloop-\nobject-store\n(**MLOS**)" as OBJECT_STORE + BULKAPI <- OBJECT_STORE: Response of save operation + deactivate OBJECT_STORE note right of BULKAPI #yellow Message: {