Skip to content

Commit 0566691

Browse files
committed
docs: include sequence diagram
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
1 parent d4dcc68 commit 0566691

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

system-design/05-communication-components/04-rest-grpc.adoc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,30 @@ Rel(backend, stock_service, "checkAvailability()", "gRPC")
6161
Rel(stock_service, stock_db, "Reads/Writes", "SQL")
6262
6363
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
64+
----
65+
66+
67+
== Sequence Diagram: Inventory Check via gRPC
68+
69+
[source, mermaid]
70+
----
71+
sequenceDiagram
72+
participant 🧑 Client
73+
participant 🟦 Java Backend
74+
participant 💳 Payment Provider
75+
participant 📦 Stock Service
76+
participant 🗃️ Inventory DB
77+
78+
🧑 Client->>🟦 Java Backend: POST /checkout (REST)
79+
🟦 Java Backend->>📦 Stock Service: gRPC checkAvailability(productId)
80+
📦 Stock Service->>🗃️ Inventory DB: SELECT stock
81+
🗃️ Inventory DB-->>📦 Stock Service: Stock data
82+
📦 Stock Service-->>🟦 Java Backend: Stock OK
83+
84+
🟦 Java Backend->>💳 Payment Provider: POST /payments (REST)
85+
💳 Payment Provider-->>🟦 Java Backend: Payment Response
86+
note over 💳 Payment Provider,🟦 Java Backend: Later... webhook event
87+
💳 Payment Provider-->>🟦 Java Backend: POST /webhook/payment
88+
89+
🟦 Java Backend-->>🧑 Client: Order accepted
6490
----

0 commit comments

Comments
 (0)