spring-architecture-split-1.../docs/architecture/transaction-sequence.md
forge-bot f58dedfd41
All checks were successful
ci / test (pull_request) Successful in 7s
결제 전환 목표 아키텍처 정의 (SPRING-ARC-SPLIT-1783827796)
2026-07-12 03:47:13 +00:00

1.1 KiB

sequenceDiagram
    participant Controller
    participant Service
    participant Repository
    participant Domain
    participant Integration

    Controller->>Service: processPayment()
    Service->>Repository: savePayment()
    Repository-->>Service: paymentSaved
    Service-->>Controller: paymentProcessed

    alt External API call
        Service->>Integration: sendPaymentRequest()
        Integration-->>Service: paymentResponse
    end

    opt Within DB transaction
        Service->>Repository: beginTransaction()
        Repository-->>Service: transactionStarted
        Service->>Repository: commitTransaction()
    end
    Note over Service: Success (commit)

    opt External Failure
        Service->>Integration: sendPaymentRequest()
        Integration-->>Service: paymentFailure
        Service->>Repository: rollbackTransaction()
        Repository-->>Service: transactionRolledBack
    end

    opt DB Failure
        Service->>Repository: throwException()
        Repository-->>Service: exceptionOccurred
        Service->>Repository: rollbackTransaction()
        Repository-->>Service: transactionRolledBack
    end