결제 전환 목표 아키텍처 정의 (SPRING-ARC-SPLIT-1783827796)
All checks were successful
ci / test (pull_request) Successful in 7s
All checks were successful
ci / test (pull_request) Successful in 7s
This commit is contained in:
parent
23abbbd301
commit
f58dedfd41
1 changed files with 39 additions and 0 deletions
39
docs/architecture/transaction-sequence.md
Normal file
39
docs/architecture/transaction-sequence.md
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant Controller
|
||||||
|
participant Service
|
||||||
|
participant Repository
|
||||||
|
participant Domain
|
||||||
|
participant Integration
|
||||||
|
|
||||||
|
Controller->>Service: processPayment()
|
||||||
|
Service->>Repository: savePayment()
|
||||||
|
Repository-->>Service: paymentSaved
|
||||||
|
Service-->>Controller: paymentProcessed
|
||||||
|
|
||||||
|
alt External API call
|
||||||
|
Service->>Integration: sendPaymentRequest()
|
||||||
|
Integration-->>Service: paymentResponse
|
||||||
|
end
|
||||||
|
|
||||||
|
opt Within DB transaction
|
||||||
|
Service->>Repository: beginTransaction()
|
||||||
|
Repository-->>Service: transactionStarted
|
||||||
|
Service->>Repository: commitTransaction()
|
||||||
|
end
|
||||||
|
Note over Service: Success (commit)
|
||||||
|
|
||||||
|
opt External Failure
|
||||||
|
Service->>Integration: sendPaymentRequest()
|
||||||
|
Integration-->>Service: paymentFailure
|
||||||
|
Service->>Repository: rollbackTransaction()
|
||||||
|
Repository-->>Service: transactionRolledBack
|
||||||
|
end
|
||||||
|
|
||||||
|
opt DB Failure
|
||||||
|
Service->>Repository: throwException()
|
||||||
|
Repository-->>Service: exceptionOccurred
|
||||||
|
Service->>Repository: rollbackTransaction()
|
||||||
|
Repository-->>Service: transactionRolledBack
|
||||||
|
end
|
||||||
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue