Compare commits

..

6 commits

5 changed files with 58 additions and 25 deletions

View file

@ -0,0 +1,3 @@
# SPRING-ARC-CONVERGE-1783828654-attempt-2
Forge 이슈 작업 브랜치 `forge/SPRING-ARC-CONVERGE-1783828654-attempt-2`.

View file

@ -1,3 +0,0 @@
# iss-c7e589ce4a08-attempt-1
Forge 이슈 작업 브랜치 `forge/iss-c7e589ce4a08-attempt-1`.

View file

@ -0,0 +1,14 @@
# ADR: Payment Boundary
## Context
In our architecture, we aim to define the boundaries of the payment domain. This is vital for ensuring that our system is modular and easily maintainable. The payment process will interface with external gateways while keeping the core business logic separate from these integrations.
## Decision
We have decided to place the external payment gateway behind a port interface. This allows us to decouple our domain logic from the specific implementations of payment providers, thus making it easier to adapt to changes in external systems.
## Alternatives
1. **Direct integration with payment gateways:** This approach would tightly couple our domain layer with external systems, making changes difficult and increasing risk.
2. **Using an event-driven architecture:** While this could provide more flexibility, it introduces complexity and may lead to challenges in ensuring consistency.
## Consequences
By implementing this boundary, we gain the ability to change payment providers with minimal changes to our internal domain logic. However, we must carefully manage the interfaces and ensure that they are well-defined and stable to avoid integration challenges in the future.

View file

@ -0,0 +1,7 @@
| 패키지 | 책임 | 금지된 의존성 |
|----------------|------------------------------------------|------------------------------------------|
| Controller | 사용자 요청을 받고 응답 처리 | Domain 패키지 직접 참조 금지 |
| Service | 비즈니스 로직 처리 | Repository 패키지 직접 참조 금지 |
| Repository | 데이터베이스와의 상호작용 | Service 패키지 직접 참조 금지 |
| Domain | 핵심 비즈니스 규칙 및 객체 모델 정의 | Controller, Service, Repository 직접 참조 금지 |
| Integration | 외부 시스템과 통신을 위한 어댑터 | Domain 패키지 직접 참조 금지 |

View file

@ -1,25 +1,37 @@
```mermaid
sequenceDiagram sequenceDiagram
participant User participant User as 사용자
participant Payment Gateway participant Controller as 결제Controller
participant Database participant Service as 결제Service
participant Service participant Gateway as 결제Gateway
participant DB as 데이터베이스
User->>Service: Initiate Payment User->>Controller: 결제 요청
Service->>Payment Gateway: Send Payment Request Controller->>Service: 결제 처리 요청
alt Successful Payment Service->>Gateway: 결제 요청 전달
Payment Gateway-->>Service: Confirm Payment Gateway->>Service: 결제 결과
Service->>Database: Record Payment Service->>DB: 결제 정보 저장
Database-->>Service: Payment Recorded DB-->>Service: 저장 결과
Service-->>User: Payment Success Service-->>Controller: 결제 처리 결과
else External Payment Failed Controller-->>User: 결제 결과 응답
Payment Gateway-->>Service: Payment Failed
Service-->>User: Payment Failed rect rgb(200, 200, 200)
else Database Failure Note over Service: Commit 경계
Service->>Database: Attempt to Record Payment
Database-->>Service: Database Error
Service-->>User: Unable to process payment
end end
Service->>Database: Commit
alt Rollback Required rect rgb(255, 0, 0)
Database->>Database: Rollback Changes Note over Service: Rollback 처리
end end
Note over User, Gateway: 외부 실패 시
Gateway-->>Service: 실패 응답
Service-->>Controller: 결제 실패 응답
Controller-->>User: 결제 실패 알림
Note over Service, DB: DB 실패 시
Service-->>DB: 저장 실패
DB-->>Service: 저장 실패 응답
Service-->>Controller: 결제 실패 응답
Controller-->>User: 결제 실패 알림
```