diff --git a/.forge/SPRING-ARC-REFERENCE-1783832425-attempt-2.md b/.forge/SPRING-ARC-REFERENCE-1783832425-attempt-2.md new file mode 100644 index 0000000..907bf5e --- /dev/null +++ b/.forge/SPRING-ARC-REFERENCE-1783832425-attempt-2.md @@ -0,0 +1,3 @@ +# SPRING-ARC-REFERENCE-1783832425-attempt-2 + +Forge 이슈 작업 브랜치 `forge/SPRING-ARC-REFERENCE-1783832425-attempt-2`. diff --git a/.forge/iss-5046557b3d46-attempt-1.md b/.forge/iss-5046557b3d46-attempt-1.md deleted file mode 100644 index c92d376..0000000 --- a/.forge/iss-5046557b3d46-attempt-1.md +++ /dev/null @@ -1,3 +0,0 @@ -# iss-5046557b3d46-attempt-1 - -Forge 이슈 작업 브랜치 `forge/iss-5046557b3d46-attempt-1`. diff --git a/.forge/iss-6f8eac22f6f0-attempt-1.md b/.forge/iss-6f8eac22f6f0-attempt-1.md deleted file mode 100644 index ef87d47..0000000 --- a/.forge/iss-6f8eac22f6f0-attempt-1.md +++ /dev/null @@ -1,3 +0,0 @@ -# iss-6f8eac22f6f0-attempt-1 - -Forge 이슈 작업 브랜치 `forge/iss-6f8eac22f6f0-attempt-1`. diff --git a/docs/architecture/adr-payment-boundary.md b/docs/architecture/adr-payment-boundary.md new file mode 100644 index 0000000..d2b9b55 --- /dev/null +++ b/docs/architecture/adr-payment-boundary.md @@ -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. diff --git a/docs/architecture/package-map.md b/docs/architecture/package-map.md index 72bb4c0..19a6cfa 100644 --- a/docs/architecture/package-map.md +++ b/docs/architecture/package-map.md @@ -1,9 +1,10 @@ -# Package Responsibility and Forbidden Dependencies +# 패키지 책임 및 금지 의존성 매핑 + +| 패키지 | 책임 | 금지 의존성 | +| -------------- | ------------------------------- | ------------------------------ | +| controller | HTTP 요청 및 응답 처리 | service | +| service | 비즈니스 로직 처리 및 유효성 검사| repository | +| repository | 데이터베이스와의 상호작용 | integration | +| domain | 도메인 객체와 비즈니스 규칙 | controller, integration | +| integration | 외부 시스템과의 통합 | service | -| Package | Responsibility | Forbidden Dependencies | -|------------------|------------------------------------------------------|--------------------------| -| controller | Handle user requests, validate inputs, and respond | domain | -| service | Contain business logic and orchestration | repository | -| repository | Manage data access and persistence | service | -| domain | Define core business models and rules | integration | -| integration | Interface with external systems (e.g. payment gateways) | domain, service | diff --git a/docs/architecture/transaction-sequence.md b/docs/architecture/transaction-sequence.md index 52f0575..9707983 100644 --- a/docs/architecture/transaction-sequence.md +++ b/docs/architecture/transaction-sequence.md @@ -7,35 +7,29 @@ sequenceDiagram %% 정상 흐름 User->>PaymentService: 결제 요청 - PaymentService->>Database: 거래 데이터 저장 - Database-->>PaymentService: 저장 완료 PaymentService->>PaymentGateway: 결제 요청 - PaymentGateway-->>PaymentService: 결제 성공 - PaymentService->>Database: 거래 완료 상태 업데이트 - Database-->>PaymentService: 상태 업데이트 완료 - PaymentService-->>User: 결제 성공 응답 + PaymentGateway-->>PaymentService: 결제 결과 + PaymentService->>Database: 거래 정보 저장 + Database-->>PaymentService: 저장 확인 %% 외부 실패 흐름 User->>PaymentService: 결제 요청 - PaymentService->>Database: 거래 데이터 저장 - Database-->>PaymentService: 저장 완료 PaymentService->>PaymentGateway: 결제 요청 PaymentGateway-->>PaymentService: 결제 실패 - PaymentService->>Database: 거래 실패 상태 업데이트 - Database-->>PaymentService: 상태 업데이트 완료 - PaymentService-->>User: 결제 실패 응답 + PaymentService->>User: 오류 메시지 전송 %% DB 실패 흐름 User->>PaymentService: 결제 요청 - PaymentService->>Database: 거래 데이터 저장 - Database-->>PaymentService: 저장 실패 - PaymentService-->>User: 결제 실패 응답 + PaymentService->>PaymentGateway: 결제 요청 + PaymentGateway-->>PaymentService: 결제 결과 + PaymentService->>Database: 거래 정보 저장 + Database-->>PaymentService: 저장 오류 + PaymentService->>User: 오류 메시지 전송 - %% commit 흐름 - PaymentService->>Database: 커밋 - Database-->>PaymentService: 커밋 완료 - - %% rollback 흐름 - PaymentService->>Database: 롤백 - Database-->>PaymentService: 롤백 완료 + %% commit과 rollback 경계 + PaymentService->>Database: 거래 정보 커밋 + PaymentGateway-->>PaymentService: 결제 완료 + activate PaymentService + PaymentService-->>Database: 롤백 요청 + deactivate PaymentService ``` \ No newline at end of file