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

Feature/#1602 add missing sequence diagrams for quoting service #260

Merged
Merged
4 changes: 3 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
* [POST Participants (batch)](mojaloop-technical-overview/account-lookup-service/als-post-participants-batch.md)
* [DEL Participants](mojaloop-technical-overview/account-lookup-service/als-del-participants.md)
* [GET Parties](mojaloop-technical-overview/account-lookup-service/als-get-parties.md)
* [Quoting Service](mojaloop-technical-overview/quoting-service/README.md)
* [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)
* [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
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
@startuml
Title Retrieve Quote Information
participant "Payer DFSP" as PayerDFSP
participant "Switch\n[Quoting\nService]" as Switch
database "Central Store" as DB
participant "Payee DFSP" as PayeeDFSP
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 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
Switch -> Switch: Validate response (schema, headers (<color #red>**Error code: 3100**</color>))
alt Response is ok
alt SimpleRoutingMode is FALSE
Switch -> Switch: Validate response (duplicate response check, handle resend scenario (<color #red>**Error code: 3106**</color>))
alt Validation passed
Switch -\ DB: Persist quote response
activate DB
hnote over DB
quoteResponse
quoteResponseDuplicateCheck
quoteResponseIlpPacket
quoteExtensions
geoCode
end hnote
Switch \-- DB: Quote response saved
deactivate DB
end
end
alt SimpleRoutingMode is TRUE
elnyry-sam-k marked this conversation as resolved.
Show resolved Hide resolved
Switch -> Switch: Retrieve quotes endpoint for the Payer FSP
else SimpleRoutingMode is FALSE
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
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
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
oderayi marked this conversation as resolved.
Show resolved Hide resolved
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
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
end
else Payee DFSP quotes endpoint is not found
note left of Switch
Switch returns error to Payer DFSP
**<color #red>Error code: 3201</color>**
end note
PayerDFSP /- Switch: PUT quotes/{ID}error
PayerDFSP --/ Switch: 200 OK
end
@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
@startuml
Title Request Quote Creation
participant "Payer DFSP" as PayerDFSP
participant "Switch\n[Quoting\nService]" as Switch
database "Central Store" as DB
participant "Payee DFSP" as PayeeDFSP
autonumber

note over PayerDFSP, Switch: Payer DFSP sends request for quote \nto Payee DFSP via the Switch
PayerDFSP -\ Switch: POST /quotes
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: Quote request validation (rules engine etc.)
|||
alt SimpleRoutingMode === FALSE
Switch -> Switch: Duplicate check
|||
alt Request is a duplicate but not a resend
|||
note left of Switch
Switch returns error back to Payer DFSP
<color #red>**Error code: 3106**</color>
end note
PayerDFSP /- Switch: PUT /quotes/{ID}/error
PayerDFSP --/ Switch: 200 OK
|||
else Request is a duplicate and a resend
Switch -> Switch: Switch handles resend scenario
end
|||
Switch -\ DB: Persist quote request
activate DB
hnote over DB
quoteDuplicateCheck
transactionReference
quote
quoteParty
quoteExtension
geoCode
end hnote
Switch \-- DB: Quote request saved
deactivate DB
end
|||
alt SimpleRoutingMode === TRUE
Switch -> Switch: Use fspiop-destination header to retrieve quotes endpoint for Payee DFSP
else SimpleRoutingMode === FALSE
Switch -> Switch: Retireve Payee DFSP endpoint using quote party information
end
|||
alt Payee quotes endpoint found
note right of Switch: Switch forwards quote request to Payee DFSP
Switch -\ PayeeDFSP: POST /quotes
Switch \-- PayeeDFSP: 202 OK

PayeeDFSP -> PayeeDFSP: Payee DFSP presists and calculates quote
alt Payee quotes processing successful
note left of PayeeDFSP: Payee DFSP sends quote response back to Payer DFSP via the Switch
Switch /- PayeeDFSP: PUT /quotes/{ID}
Switch --/ PayeeDFSP: 200 OK

Switch -> Switch: Validate quote response
alt SimpleRoutingMode === FALSE
Switch -> Switch: Duplicate check
alt Response is duplicate but not a resend
Switch -\ PayeeDFSP: PUT /quotes/{ID}/error
Switch \-- PayeeDFSP: 200 OK
end
alt Response is a duplicate and a resend
Switch -> Switch: Switch handles resend scenario
end
Switch -\ DB: Persist quote response
activate DB
hnote over DB
quoteResponse
quoteDuplicateCheck
quoteResponseIlpPacket
geoCode
quoteExtension
end hnote
Switch \-- DB: Quote response saved
deactivate DB
end
note left of Switch: Switch forwards quote response to Payer DFSP
PayerDFSP /- Switch: PUT /quotes/{ID}
PayerDFSP --/ Switch: 200 OK
else Payee rejects quotes or encounters and error
note left of PayeeDFSP: Payee DFSP sends error callback to Payer DFSP via the Switch
Switch /- PayeeDFSP: PUT /quotes/{ID}/error
Switch --/ PayeeDFSP: 200 OK
alt SimpleRoutingMode === FALSE
Switch -\ DB: Store quote error
activate DB
hnote over DB
quoteError
end hnote
Switch \-- DB: Quote error saved
deactivate DB
end
note left of Switch: Switch forwards error callback to Payer DFSP
PayerDFSP /- Switch: PUT /quotes/{ID}/error
PayerDFSP --/ Switch: 200 OK
end
else Payee DFSP quotes endpoint not found
note left of Switch: Switch sends an error callback to Payer DFSP \n <color #red>**Error code: 3201**</color>
PayerDFSP /- Switch: PUT /quotes/{ID}/error
PayerDFSP --\ Switch: 200 OK
end

@enduml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# GET Quote By ID

Design for the retrieval of a Quote by a DFSP.

## Sequence Diagram

{% uml src="mojaloop-technical-overview/quoting-service/assets/diagrams/sequence/seq-get-quotes-1.1.0.plantuml" %}
{% enduml %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# POST Quote

Design for a Quote request by a DFSP.

## Sequence Diagram

{% uml src="mojaloop-technical-overview/quoting-service/assets/diagrams/sequence/seq-post-quotes-1.2.0.plantuml" %}
{% enduml %}