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