diff --git a/docs/architecture/transaction-sequence.md b/docs/architecture/transaction-sequence.md new file mode 100644 index 0000000..996073f --- /dev/null +++ b/docs/architecture/transaction-sequence.md @@ -0,0 +1,26 @@ +```mermaid +sequenceDiagram + participant User + participant Controller + participant Service + participant Repository + participant PaymentGateway + + User->>Controller: 결제 요청 + Controller->>Service: 결제 처리 요청 + Service->>Repository: 트랜잭션 시작 + alt 정상 흐름 + Service->>PaymentGateway: 결제 요청 + PaymentGateway-->>Service: 결제 성공 + Service->>Repository: 트랜잭션 커밋 + else 외부 실패 + Service->>PaymentGateway: 결제 요청 + PaymentGateway-->>Service: 결제 실패 + Service->>Repository: 트랜잭션 롤백 + else DB 실패 + Service->>Repository: 트랜잭션 시작 + Repository-->>Service: DB 오류 + Service->>Repository: 트랜잭션 롤백 + end + Controller-->>User: 결제 결과 반환 +``` \ No newline at end of file