Compare commits

..

6 commits

6 changed files with 58 additions and 50 deletions

View file

@ -0,0 +1,3 @@
# SPRING-ARC-REF-FINAL-1783833422-attempt-1
Forge 이슈 작업 브랜치 `forge/SPRING-ARC-REF-FINAL-1783833422-attempt-1`.

View file

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

View file

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

View file

@ -0,0 +1,23 @@
# Architecture Decision Record for Payment Boundary
## Context
In the context of our ongoing project, we are focused on defining clear boundaries for the payment services. This is crucial to ensure that our architecture remains clean, modular, and maintainable. We need to outline the responsibilities and interactions of various components involved in payment processing.
## Decision
To establish a clear payment boundary, we will:
1. Define the payment service as a separate module.
2. Use REST APIs for communication between the payment service and other microservices.
3. Ensure that any sensitive operations, like payment processing, are encapsulated within the payment service and not exposed directly to clients.
4. Implement service-level security to protect payment information.
## Alternatives
- **Monolithic Approach**: Keeping all payment processing logic within a single application. This is easier to manage initially but leads to tight coupling.
- **Event-Driven Architecture**: Using a messaging system for inter-service communication. This would add complexity in terms of managing events and message reliability, but would result in a more decoupled system.
## Consequences
By defining clear boundaries for payment processing:
- We achieve separation of concerns, which improves maintainability.
- We can independently scale the payment service based on demand.
- Security risks are minimized as sensitive operations are isolated.
This decision will guide the development and integration efforts moving forward, especially when considering transaction management and error handling.

View file

@ -1,9 +1,7 @@
# Package Responsibility Map | 패키지 | 책임 | 금지 의존성 |
|------------|---------------------------------------|------------------|
| Package | Responsibility | Forbidden Dependencies | | controller | 사용자 요청 처리 및 응답 반환 | domain, repository |
|----------------|------------------------------------------------|------------------------| | service | 비즈니스 로직 처리 및 트랜잭션 관리 | repository |
| controller | Handles user input and orchestrates payment | domain | | repository | 데이터베이스와의 상호작용 | domain |
| service | Contains business logic for payment processing | integration | | domain | 비즈니스 규칙 및 도메인 모델 정의 | integration |
| repository | Data access layer for payment records | service | | integration | 외부 시스템과의 통신 및 데이터 변환 | domain |
| domain | Defines the core domain models and business rules| controller |
| integration | Communicates with external payment gateways | domain, service |

View file

@ -1,38 +1,28 @@
```mermaid
sequenceDiagram sequenceDiagram
participant User participant User
participant PaymentService participant Controller
participant PaymentGateway participant Service
participant Database participant Repository
participant ExternalGateway
%% Normal Flow User->>Controller: 결제 요청
User->>PaymentService: Initiate Payment Controller->>Service: 결제 처리 요청
PaymentService->>Database: Store Transaction Service->>Repository: 트랜잭션 시작
Database-->>PaymentService: Transaction Stored Service->>ExternalGateway: 결제 요청
PaymentService->>PaymentGateway: Process Payment alt 결제 성공
PaymentGateway-->>PaymentService: Payment Success ExternalGateway-->>Service: 결제 성공 응답
PaymentService->>Database: Update Transaction Status Service->>Repository: 트랜잭션 커밋
Database-->>PaymentService: Transaction Updated Repository-->>Service: 커밋 완료
PaymentService-->>User: Payment Success Service-->>Controller: 결제 완료 응답
Controller-->>User: 결제 완료
%% External Failure Flow else 외부 실패
User->>PaymentService: Initiate Payment ExternalGateway-->>Service: 결제 실패 응답
PaymentService->>Database: Store Transaction Service->>Repository: 트랜잭션 롤백
Database-->>PaymentService: Transaction Stored Repository-->>Service: 롤백 완료
PaymentService->>PaymentGateway: Process Payment Service-->>Controller: 결제 실패 응답
PaymentGateway-->>PaymentService: Payment Failure Controller-->>User: 결제 실패
PaymentService->>Database: Rollback Transaction else DB 실패
Database-->>PaymentService: Transaction Rolled Back Service->>Repository: 트랜잭션 롤백
PaymentService-->>User: Payment Failure Repository-->>Service: 롤백 완료
Service-->>Controller: DB 오류 응답
%% DB Failure Flow Controller-->>User: DB 오류
User->>PaymentService: Initiate Payment
PaymentService->>Database: Store Transaction
Database-->>PaymentService: Transaction Store Failure
PaymentService-->>User: Payment Failure
%% Commit & Rollback
Note over User, PaymentService:
commit --> PaymentService
rollback --> PaymentService
```