결제 전환 목표 아키텍처 정의 #2
1 changed files with 46 additions and 0 deletions
46
docs/architecture/transaction-sequence.md
Normal file
46
docs/architecture/transaction-sequence.md
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant User
|
||||||
|
participant Controller
|
||||||
|
participant Service
|
||||||
|
participant Repository
|
||||||
|
participant Database
|
||||||
|
|
||||||
|
User->>Controller: 결제 요청
|
||||||
|
Controller->>Service: 결제 처리 요청
|
||||||
|
Service->>Repository: 결제 정보 저장
|
||||||
|
Repository->>Database: DB에 저장
|
||||||
|
Database-->>Repository: 저장 완료
|
||||||
|
Repository-->>Service: 저장 완료
|
||||||
|
Service-->>Controller: 처리 완료
|
||||||
|
Controller-->>User: 결제 완료
|
||||||
|
|
||||||
|
%% 외부 실패 흐름
|
||||||
|
User->>Controller: 결제 요청
|
||||||
|
Controller->>Service: 결제 처리 요청
|
||||||
|
Service->>Repository: 결제 정보 저장
|
||||||
|
Repository->>Database: DB에 저장
|
||||||
|
Database-->>Repository: 저장 실패
|
||||||
|
Repository-->>Service: 저장 실패
|
||||||
|
Service-->>Controller: 처리 실패
|
||||||
|
Controller-->>User: 결제 실패
|
||||||
|
|
||||||
|
%% DB 실패 흐름
|
||||||
|
User->>Controller: 결제 요청
|
||||||
|
Controller->>Service: 결제 처리 요청
|
||||||
|
Service->>Repository: 결제 정보 저장
|
||||||
|
Repository->>Database: DB에 저장
|
||||||
|
Database-->>Repository: DB 오류
|
||||||
|
Repository-->>Service: DB 오류
|
||||||
|
Service-->>Controller: 처리 실패
|
||||||
|
Controller-->>User: 결제 실패
|
||||||
|
|
||||||
|
%% Commit/Rollback 경계
|
||||||
|
alt 정상 흐름
|
||||||
|
Service->>Database: Commit
|
||||||
|
else 외부 실패
|
||||||
|
Service->>Database: Rollback
|
||||||
|
else DB 실패
|
||||||
|
Service->>Database: Rollback
|
||||||
|
end
|
||||||
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue