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

Adding sequence diagrams for bulk Quotes #266

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
* [Quoting Service Overview](mojaloop-technical-overview/quoting-service/README.md)
* [GET Quote](mojaloop-technical-overview/quoting-service/qs-get-quotes.md)
* [POST Quote](mojaloop-technical-overview/quoting-service/qs-post-quotes.md)
* [GET Bulk Quote](mojaloop-technical-overview/quoting-service/qs-get-bulk-quotes.md)
* [POST Bulk Quote](mojaloop-technical-overview/quoting-service/qs-post-bulk-quotes.md)
* [Central-Ledger Services](mojaloop-technical-overview/central-ledger/README.md)
* [Admin Operations](mojaloop-technical-overview/central-ledger/admin-operations/README.md)
* [POST Participant Limit](mojaloop-technical-overview/central-ledger/admin-operations/1.0.0-post-participant-position-limit.md)
Expand Down
5 changes: 2 additions & 3 deletions mojaloop-technical-overview/quoting-service/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Quoting Service Overview
The **Quoting Service** (**QS**) _(refer to section `5.1`)_ as per the [Mojaloop {{ book.importedVars.mojaloop.spec.version }} Specification]({{ book.importedVars.mojaloop.spec.uri.doc }}) implements the following use-cases:
* P2P Transfers
The **Quoting Service** (**QS**) _(refer to section `5.1`)_ as per the [Mojaloop {{ book.importedVars.mojaloop.spec.version }} Specification]({{ book.importedVars.mojaloop.spec.uri.doc }}) implements the quoting phase of the various use-cases.

_Note: other use-cases as per [Mojaloop {{ book.importedVars.mojaloop.spec.version }} Specification]({{ book.importedVars.mojaloop.spec.uri.doc }}) are yet to be verified_
_Note: In addition to individual quotes, the quoting service supports bulk quotes as well._

## Sequence Diagram

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/'*****
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>

* Sam Kummary <sam@modusbox.com>
--------------
******'/

@startuml
Title Retrieve Bulk Quote Information
participant "Payer FSP" as PayerFSP
participant "Switch\n[Quoting Service]" as Switch
participant "Payee FSP" as PayeeFSP

autonumber
note right of PayerFSP: Payer FSP sends request to get bulk quote details \nto Payee FSP via the Switch
PayerFSP -\ Switch: GET /bulkQuotes/{ID}
note right of Switch #aaa
Validate request against
Mojaloop interface specification
**<color #red>Error code: 300x, 310x</color>**
**<color #red>HTTP error response code: 4xx</color>**
end note
Switch -> Switch: Schema validation
PayerFSP \-- Switch: 202 Accepted
Switch -> Switch: Retrieve bulk quotes endpoint for Payee FSP
alt Payee FSP quotes endpoint is found
note right of Switch: Switch forwards request to Payee FSP (pass-through mode)
Switch -\ PayeeFSP: GET /bulkQuotes/{ID}
PayeeFSP --/ Switch: 202 Accepted
PayeeFSP -> PayeeFSP: Payee FSP retireves bulk quote
alt Payee FSP successfully retieves quote
note left of PayeeFSP: Payee FSP responds to quote request
PayeeFSP -\ Switch: PUT /quotes/{ID}
note right of Switch #aaa
Validate request against
Mojaloop interface specification
**<color #red>Error code: 300x, 310x</color>**
**<color #red>HTTP error response code: 4xx</color>**
end note
Switch --/ PayeeFSP: 200 Ok
alt Response is ok
Switch -> Switch: Retrieve bulk quotes endpoint for the Payer FSP
alt Bulk Quotes callback endpoint found
note left of Switch: Switch forwards bulk quote response to Payer FSP
Switch -\ PayerFSP: PUT /bulkQuotes/{ID}
PayerFSP --/ Switch: 200 Ok
else Bulk Quotes callback endpoint not found
note right of Switch: Switch returns error to Payee FSP
Switch -\ PayeeFSP: PUT /bulkQuotes/{ID}/error
PayeeFSP --/ Switch : 200 Ok
end
else Response is invalid
note right of Switch: Switch returns error to Payee FSP
Switch -\ PayeeFSP: PUT /bulkQuotes/{ID}/error
PayeeFSP --/ Switch : 200 Ok
note over Switch, PayeeFSP #ec7063: Note that under this\nscenario the Payer FSP\nmay not receive a response
end

else bulkQuote not found
note left of PayeeFSP: Payee FSP returns error to Switch\n <color #red>**Error code: 3205**</color>
PayeeFSP -\ Switch: PUT /bulkQuotes/{ID}/error
Switch --/ PayeeFSP: 200 OK
note left of Switch: Switch returns error to Payer FSP\n <color #red>**Error code: 3205**</color>
Switch -\ PayerFSP: PUT /bulkQuotes/{ID}/error
PayerFSP --/ Switch: 200 OK
end
else Payee FSP Bulk quotes endpoint is not found
note left of Switch
Switch returns error to Payer FSP
**<color #red>Error code: 3201</color>**
end note
PayerFSP /- Switch: PUT /bulkQuotes/{ID}error
PayerFSP --/ Switch: 200 OK
end
@enduml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
@startuml
Title Retrieve Quote Information
participant "Payer DFSP" as PayerDFSP
participant "Payer FSP" as PayerFSP
participant "Switch\n[Quoting\nService]" as Switch
database "Central Store" as DB
participant "Payee DFSP" as PayeeDFSP
participant "Payee FSP" as PayeeFSP
autonumber
note right of PayerDFSP: Payer DFSP sends request to get quote details \nto Payee DFSP via the Switch
PayerDFSP -\ Switch: GET /quotes/{ID}
note right of PayerFSP: Payer FSP sends request to get quote details \nto Payee FSP via the Switch
PayerFSP -\ Switch: GET /quotes/{ID}
note right of Switch #aaa
Validate request against
Mojaloop interface specification
**<color #red>Error code: 300x, 310x</color>**
**<color #red>HTTP error response code: 4xx</color>**
end note
Switch -> Switch: Schema validation
PayerDFSP \-- Switch: 202 Accepted
Switch -> Switch: Retrieve quotes endpoint for Payee DFSP
alt Payee DFSP quotes endpoint is found
note right of Switch: Switch forwards request to Payee DFSP (pass-through mode)\n<Payer based Rules>
Switch -\ PayeeDFSP: GET /quotes/{ID}
PayeeDFSP --/ Switch: 202 Accepted
PayeeDFSP -> PayeeDFSP: Payee DFSP retireves quote
alt Payee DFSP successfully retieves quote
note left of PayeeDFSP: Payee DFSP responds to quote request
PayeeDFSP -\ Switch: PUT /quotes/{ID}
Switch --/ PayeeDFSP: 200 Ok
PayerFSP \-- Switch: 202 Accepted
Switch -> Switch: Retrieve quotes endpoint for Payee FSP
alt Payee FSP quotes endpoint is found
note right of Switch: Switch forwards request to Payee FSP (pass-through mode)\n<Payer based Rules>
Switch -\ PayeeFSP: GET /quotes/{ID}
PayeeFSP --/ Switch: 202 Accepted
PayeeFSP -> PayeeFSP: Payee FSP retireves quote
alt Payee FSP successfully retieves quote
note left of PayeeFSP: Payee FSP responds to quote request
PayeeFSP -\ Switch: PUT /quotes/{ID}
Switch --/ PayeeFSP: 200 Ok
Switch -> Switch: Validate response (schema, headers (<color #red>**Error code: 3100**</color>))
alt Response is ok
alt SimpleRoutingMode is FALSE
Expand All @@ -49,38 +49,38 @@ alt Payee DFSP quotes endpoint is found
Switch -> Switch: Retrieve quote party endpoint (PAYER)
end
alt Quotes callback endpoint found
note left of Switch: Switch forwards quote response to Payer DFSP\n<Payee \ whole request Rule>
Switch -\ PayerDFSP: PUT /quotes/{ID}
PayerDFSP --/ Switch: 200 Ok
note left of Switch: Switch forwards quote response to Payer FSP\n<Payee \ whole request Rule>
Switch -\ PayerFSP: PUT /quotes/{ID}
PayerFSP --/ Switch: 200 Ok
else Quotes callback endpoint not found
note right of Switch: Switch returns error to Payee DFSP
Switch -\ PayeeDFSP: PUT /quotes/{ID}/error
PayeeDFSP --/ Switch : 200 Ok
note right of Switch: Switch returns error to Payee FSP
Switch -\ PayeeFSP: PUT /quotes/{ID}/error
PayeeFSP --/ Switch : 200 Ok
end
else Response is invalid
note right of Switch: Switch returns error to Payee DFSP
Switch -\ PayeeDFSP: PUT /quotes/{ID}/error
PayeeDFSP --/ Switch : 200 Ok
note over Switch, PayeeDFSP #ec7063: Note that under this\nscenario the Payer DFSP\nmay not receive a response
note right of Switch: Switch returns error to Payee FSP
Switch -\ PayeeFSP: PUT /quotes/{ID}/error
PayeeFSP --/ Switch : 200 Ok
note over Switch, PayeeFSP #ec7063: Note that under this\nscenario the Payer FSP\nmay not receive a response
end

else Quote not found
note left of PayeeDFSP: Payee DFSP returns error to Switch\n <color #red>**Error code: 3205**</color>
PayeeDFSP -\ Switch: PUT quotes/{ID}/error
Switch --/ PayeeDFSP: 200 OK
note left of PayeeFSP: Payee FSP returns error to Switch\n <color #red>**Error code: 3205**</color>
PayeeFSP -\ Switch: PUT quotes/{ID}/error
Switch --/ PayeeFSP: 200 OK
alt SimpleRoutingMode is FALSE
Switch -> Switch: Persist error data
end
note left of Switch: Switch returns error to Payer DFSP\n <color #red>**Error code: 3205**</color>
Switch -\ PayerDFSP: PUT quotes/{ID}/error
PayerDFSP --/ Switch: 200 OK
note left of Switch: Switch returns error to Payer FSP\n <color #red>**Error code: 3205**</color>
Switch -\ PayerFSP: PUT quotes/{ID}/error
PayerFSP --/ Switch: 200 OK
end
else Payee DFSP quotes endpoint is not found
else Payee FSP quotes endpoint is not found
note left of Switch
Switch returns error to Payer DFSP
Switch returns error to Payer FSP
**<color #red>Error code: 3201</color>**
end note
PayerDFSP /- Switch: PUT quotes/{ID}error
PayerDFSP --/ Switch: 200 OK
PayerFSP /- Switch: PUT quotes/{ID}error
PayerFSP --/ Switch: 200 OK
end
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/'*****
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>

* Sam Kummary <sam@modusbox.com>
--------------
******'/

@startuml
Title Request Bulk Quote Creation
participant "Payer FSP" as PayerFSP
participant "Switch\n[Quoting Service]" as Switch
participant "Payee FSP" as PayeeFSP
autonumber

note over PayerFSP, Switch: Payer FSP sends bulk quote request\nto Payee FSP via the Switch
PayerFSP -\ Switch: POST /bulkQuotes
note right of Switch #aaa
Validate request against
Mojaloop interface specification
**<color #red>Error code: 300x, 310x</color>**
**<color #red>HTTP error response code: 4xx</color>**
end note
Switch -> Switch: Schema validation
PayerFSP \-- Switch: 202 Accepted
|||
Switch -> Switch: Bulk Quote request validation (rules engine etc.)
|||
Switch -> Switch: Duplicate check
|||
alt Request is a duplicate but not a resend
|||
note left of Switch
Switch returns error back to Payer FSP
<color #red>**Error code: 3106**</color>
end note
PayerFSP /- Switch: PUT /bulkQuotes/{ID}/error
PayerFSP --/ Switch: 200 OK
|||
else Request is a duplicate and a resend
Switch -> Switch: Switch handles resend scenario
end
|||
Switch -> Switch: Use fspiop-destination header to retrieve\n bulk quotes endpoint for Payee DFSP
alt Payee bulkQuotes endpoint found
elnyry-sam-k marked this conversation as resolved.
Show resolved Hide resolved
note right of Switch: Switch forwards bulk quote request to Payee FSP
Switch -\ PayeeFSP: POST /bulkQuotes
Switch \-- PayeeFSP: 202 OK

PayeeFSP -> PayeeFSP: Payee FSP calculates individual quotes\nand responds with a bulk Quote result
elnyry-sam-k marked this conversation as resolved.
Show resolved Hide resolved
alt Payee bulkQuotes processing successful
elnyry-sam-k marked this conversation as resolved.
Show resolved Hide resolved
note over PayeeFSP, Switch: Payee FSP sends bulk quote response back to Payer FSP via the Switch
Switch /- PayeeFSP: PUT /bulkQuotes/{ID}
Switch --/ PayeeFSP: 200 OK

Switch -> Switch: Validate bulk quote response
Switch -> Switch: Duplicate check
alt Response is duplicate but not a resend
Switch -\ PayeeFSP: PUT /bulkQuotes/{ID}/error
Switch \-- PayeeFSP: 200 OK
end
alt Response is a duplicate and a resend
Switch -> Switch: Switch handles resend scenario
end

note left of Switch: Switch forwards quote response to Payer FSP
PayerFSP /- Switch: PUT /bulkQuotes/{ID}
PayerFSP --/ Switch: 200 OK
else Payee rejects bulk quote or encounters and error
elnyry-sam-k marked this conversation as resolved.
Show resolved Hide resolved
note left of PayeeFSP: Payee FSP sends error callback to Payer FSP via the Switch
Switch /- PayeeFSP: PUT /bulkQuotes/{ID}/error
Switch --/ PayeeFSP: 200 OK
note left of Switch: Switch forwards error callback to Payer FSP
PayerFSP /- Switch: PUT /bulkQuotes/{ID}/error
PayerFSP --/ Switch: 200 OK
end
else Payee FSP quotes endpoint not found
note left of Switch: Switch sends an error callback to Payer FSP \n <color #red>**Error code: 3201**</color>
PayerFSP /- Switch: PUT /bulkQuotes/{ID}/error
PayerFSP --\ Switch: 200 OK
end

@enduml
Loading