결제 전환 목표 아키텍처 정의 #2
4 changed files with 63 additions and 0 deletions
3
.forge/SPRING-ARC-REFERENCE-1783832425-attempt-2.md
Normal file
3
.forge/SPRING-ARC-REFERENCE-1783832425-attempt-2.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# SPRING-ARC-REFERENCE-1783832425-attempt-2
|
||||
|
||||
Forge 이슈 작업 브랜치 `forge/SPRING-ARC-REFERENCE-1783832425-attempt-2`.
|
||||
15
docs/architecture/adr-payment-boundary.md
Normal file
15
docs/architecture/adr-payment-boundary.md
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Architecture Decision Record: Payment Boundary
|
||||
|
||||
## Context
|
||||
In the context of transitioning to a new payment system, we need to define clear boundaries within our architecture to ensure proper integration and maintainability. This decision will outline the approach we take to isolate the payment processing components from other parts of the application.
|
||||
|
||||
## Decision
|
||||
We decide to encapsulate all payment-related operations within a dedicated Payment Service. This service will handle transactions, manage payment methods, and interact with third-party payment gateways. The service will expose a RESTful API to other services that require payment processing.
|
||||
|
||||
## Alternatives
|
||||
1. **Integrate payment processing directly within existing services**: This would lead to tightly coupled code with potential for increased complexity and difficulty in maintenance.
|
||||
2. **Use a microservices approach for every payment operation**: While this increases modularity, it may also introduce excessive complexity and communication overhead between services.
|
||||
|
||||
## Consequences
|
||||
- **Pros**: Clear boundaries will improve maintainability, making it easier to reason about the payment process as a distinct component. This separation allows for independent scaling and potential future integration with different payment systems.
|
||||
- **Cons**: Requires an initial investment in creating the boundary and service infrastructure, potentially increasing the upfront complexity during the migration phase.
|
||||
10
docs/architecture/package-map.md
Normal file
10
docs/architecture/package-map.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# 패키지 책임 및 금지 의존성 매핑
|
||||
|
||||
| 패키지 | 책임 | 금지 의존성 |
|
||||
| -------------- | ------------------------------- | ------------------------------ |
|
||||
| controller | HTTP 요청 및 응답 처리 | service |
|
||||
| service | 비즈니스 로직 처리 및 유효성 검사| repository |
|
||||
| repository | 데이터베이스와의 상호작용 | integration |
|
||||
| domain | 도메인 객체와 비즈니스 규칙 | controller, integration |
|
||||
| integration | 외부 시스템과의 통합 | service |
|
||||
|
||||
35
docs/architecture/transaction-sequence.md
Normal file
35
docs/architecture/transaction-sequence.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
```mermaid
|
||||
sequenceDiagram
|
||||
participant User
|
||||
participant PaymentService
|
||||
participant PaymentGateway
|
||||
participant Database
|
||||
|
||||
%% 정상 흐름
|
||||
User->>PaymentService: 결제 요청
|
||||
PaymentService->>PaymentGateway: 결제 요청
|
||||
PaymentGateway-->>PaymentService: 결제 결과
|
||||
PaymentService->>Database: 거래 정보 저장
|
||||
Database-->>PaymentService: 저장 확인
|
||||
|
||||
%% 외부 실패 흐름
|
||||
User->>PaymentService: 결제 요청
|
||||
PaymentService->>PaymentGateway: 결제 요청
|
||||
PaymentGateway-->>PaymentService: 결제 실패
|
||||
PaymentService->>User: 오류 메시지 전송
|
||||
|
||||
%% DB 실패 흐름
|
||||
User->>PaymentService: 결제 요청
|
||||
PaymentService->>PaymentGateway: 결제 요청
|
||||
PaymentGateway-->>PaymentService: 결제 결과
|
||||
PaymentService->>Database: 거래 정보 저장
|
||||
Database-->>PaymentService: 저장 오류
|
||||
PaymentService->>User: 오류 메시지 전송
|
||||
|
||||
%% commit과 rollback 경계
|
||||
PaymentService->>Database: 거래 정보 커밋
|
||||
PaymentGateway-->>PaymentService: 결제 완료
|
||||
activate PaymentService
|
||||
PaymentService-->>Database: 롤백 요청
|
||||
deactivate PaymentService
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue