diff --git a/docs/architecture/transaction-sequence.md b/docs/architecture/transaction-sequence.md new file mode 100644 index 0000000..6a8cfa8 --- /dev/null +++ b/docs/architecture/transaction-sequence.md @@ -0,0 +1,21 @@ +sequenceDiagram + participant User + participant PaymentService + participant PaymentRepository + participant ExternalAPI + + User->>PaymentService: 결제 요청 + PaymentService->>PaymentRepository: 결제 정보 저장 + alt 정상 흐름 + PaymentRepository-->>PaymentService: 저장 성공 + PaymentService->>ExternalAPI: 결제 처리 요청 + ExternalAPI-->>PaymentService: 결제 성공 + PaymentService-->>User: 결제 완료 + else 외부 실패 + PaymentRepository-->>PaymentService: 저장 성공 + PaymentService-->>User: 결제 실패 (외부 API 오류) + else DB 실패 + PaymentRepository-->>PaymentService: 저장 실패 + PaymentService-->>User: 결제 실패 (DB 오류) + end + note over PaymentService: 커밋 또는 롤백 경계 \ No newline at end of file