diff --git a/.forge/SPRING-ARC-CONVERGE-1783828654-attempt-2.md b/.forge/SPRING-ARC-CONVERGE-1783828654-attempt-2.md new file mode 100644 index 0000000..664f9f6 --- /dev/null +++ b/.forge/SPRING-ARC-CONVERGE-1783828654-attempt-2.md @@ -0,0 +1,3 @@ +# SPRING-ARC-CONVERGE-1783828654-attempt-2 + +Forge 이슈 작업 브랜치 `forge/SPRING-ARC-CONVERGE-1783828654-attempt-2`. diff --git a/docs/architecture/adr-payment-boundary.md b/docs/architecture/adr-payment-boundary.md new file mode 100644 index 0000000..7b2a86a --- /dev/null +++ b/docs/architecture/adr-payment-boundary.md @@ -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. \ No newline at end of file diff --git a/docs/architecture/package-map.md b/docs/architecture/package-map.md new file mode 100644 index 0000000..ffda01f --- /dev/null +++ b/docs/architecture/package-map.md @@ -0,0 +1,7 @@ +| 패키지 | 책임 | 금지된 의존성 | +|----------------|------------------------------------------|------------------------------------------| +| Controller | 사용자 요청을 받고 응답 처리 | Domain 패키지 직접 참조 금지 | +| Service | 비즈니스 로직 처리 | Repository 패키지 직접 참조 금지 | +| Repository | 데이터베이스와의 상호작용 | Service 패키지 직접 참조 금지 | +| Domain | 핵심 비즈니스 규칙 및 객체 모델 정의 | Controller, Service, Repository 직접 참조 금지 | +| Integration | 외부 시스템과 통신을 위한 어댑터 | Domain 패키지 직접 참조 금지 | \ No newline at end of file diff --git a/docs/architecture/transaction-sequence.md b/docs/architecture/transaction-sequence.md new file mode 100644 index 0000000..a7c1745 --- /dev/null +++ b/docs/architecture/transaction-sequence.md @@ -0,0 +1,37 @@ +```mermaid +sequenceDiagram + participant User as 사용자 + participant Controller as 결제Controller + participant Service as 결제Service + participant Gateway as 결제Gateway + participant DB as 데이터베이스 + + 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 + + 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: 결제 실패 알림 + +``` \ No newline at end of file