diff --git a/docs/architecture/transaction-sequence.md b/docs/architecture/transaction-sequence.md new file mode 100644 index 0000000..1b564ec --- /dev/null +++ b/docs/architecture/transaction-sequence.md @@ -0,0 +1,29 @@ +sequenceDiagram + participant C as Controller + participant S as Service + participant R as Repository + participant DB as Database + participant E as External Payment Gateway + + C->>S: 결제 요청 + S->>R: 결제 정보 요청 + R->>DB: 결제 정보 저장 + DB-->>R: 저장 성공 + S->>E: 결제 진행 + E-->>S: 결제 성공 + S->>C: 결제 성공 응답 + + note over C: 외부 실패와 같은 경우 + S->>E: 결제 진행 + E-->>S: 결제 실패 + S->>R: 데이터 롤백 + R->>DB: 롤백 처리 + DB-->>R: 롤백 성공 + S->>C: 결제 실패 응답 + + note over C: DB 실패의 경우 + S->>R: 결제 정보 요청 + R->>DB: 결제 정보 저장 + DB-->>R: 저장 실패 + R-->>S: 에러 응답 + S->>C: 결제 실패 응답