Compare commits

..

3 commits

5 changed files with 25 additions and 58 deletions

View file

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

View file

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

View file

@ -1,14 +0,0 @@
# 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

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

View file

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