phonebill/design/backend/sequence/outer/요금조회플로우.puml
hiondal 7ec8a682c6 외부 시퀀스 설계 완료
- 3개 핵심 비즈니스 플로우별 외부 시퀀스 다이어그램 작성
  - 사용자인증플로우.puml: UFR-AUTH-010, UFR-AUTH-020 반영
  - 요금조회플로우.puml: UFR-BILL-010~040 반영
  - 상품변경플로우.puml: UFR-PROD-010~040 반영

- 논리아키텍처와 참여자 완전 일치
- UI/UX 설계서 사용자 플로우 100% 반영
- 클라우드 패턴 적용 (API Gateway, Cache-Aside, Circuit Breaker)
- PlantUML 문법 검사 통과 (mono 테마 적용)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-08 10:27:39 +09:00

134 lines
4.1 KiB
Plaintext

@startuml
!theme mono
title 통신요금 관리 서비스 - 요금조회 플로우
actor "MVNO 고객" as Client
participant "MVNO Frontend" as Frontend
participant "API Gateway" as Gateway
participant "Auth Service" as Auth
participant "Bill-Inquiry Service" as BillService
participant "Redis Cache" as Cache
participant "Bill DB" as BillDB
participant "KOS-Order" as KOS
participant "MVNO AP Server" as MVNOServer
== 요금조회 메뉴 접근 (UFR-BILL-010) ==
Client -> Frontend: 요금조회 메뉴 요청
activate Frontend
Frontend -> Gateway: GET /api/bill/menu
activate Gateway
Gateway -> Auth: JWT 토큰 검증 및 권한 확인
activate Auth
Auth --> Gateway: 권한 확인 완료
deactivate Auth
Gateway -> BillService: 요금조회 메뉴 요청
activate BillService
BillService -> Cache: 고객 정보 캐시 조회
activate Cache
Cache --> BillService: 고객 정보 반환 (회선번호)
deactivate Cache
BillService --> Gateway: 요금조회 메뉴 데이터
deactivate BillService
Gateway --> Frontend: 요금조회 메뉴 응답
deactivate Gateway
Frontend --> Client: 요금조회 메뉴 화면 표시\n(회선번호, 조회월 선택 옵션)
deactivate Frontend
== 요금조회 신청 (UFR-BILL-020) ==
Client -> Frontend: 조회월 선택 후 조회 신청\n(당월 또는 특정월)
activate Frontend
Frontend -> Gateway: POST /api/bill/inquiry\n{lineNumber, inquiryMonth}
activate Gateway
Gateway -> Auth: JWT 토큰 검증
activate Auth
Auth --> Gateway: 인증 확인
deactivate Auth
Gateway -> BillService: 요금조회 요청
activate BillService
== Cache-Aside 패턴 적용 ==
BillService -> Cache: 조회 결과 캐시 확인\nKey: "bill:lineNumber:month"
activate Cache
alt 캐시 Hit (1시간 TTL 내)
Cache --> BillService: 캐시된 요금 정보 반환
deactivate Cache
note right: 성능 최적화\nKOS 호출 없이 즉시 응답
else 캐시 Miss
Cache --> BillService: 캐시 데이터 없음
deactivate Cache
== Circuit Breaker 패턴 적용 (UFR-BILL-030) ==
BillService -> KOS: 요금조회 API 호출\n{회선번호, 조회월}
activate KOS
alt Circuit Breaker - 정상 상태
KOS --> BillService: 요금 정보 응답\n{상품명, 청구월, 요금, 할인정보,\n사용량, 예상해지비용, 단말기할부금,\n청구/납부정보}
deactivate KOS
BillService -> Cache: 조회 결과 캐싱 (TTL: 1시간)
activate Cache
Cache --> BillService: 캐싱 완료
deactivate Cache
else Circuit Breaker - 장애 상태
KOS --> BillService: 연동 실패 (타임아웃/오류)
deactivate KOS
BillService --> Gateway: 서비스 장애 응답\n"일시적으로 서비스 이용이 어렵습니다"
Gateway --> Frontend: 오류 응답
Frontend --> Client: 오류 메시지 표시
note right: Circuit Breaker로\n서비스 안정성 확보
[-> BillService: 장애 로그 기록
end
end
== 요금조회 결과 전송 (UFR-BILL-040) ==
BillService -> MVNOServer: 조회 결과 전송\n(상품명, 청구월, 요금 등 전체 정보)
activate MVNOServer
MVNOServer --> BillService: 전송 완료 확인
deactivate MVNOServer
BillService -> BillDB: 요금 조회 이력 저장 (비동기)
activate BillDB
note right: 비동기 처리로\n응답 성능에 영향 없음
BillDB --> BillService: 이력 저장 완료
deactivate BillDB
BillService --> Gateway: 요금조회 결과
deactivate BillService
Gateway --> Frontend: 조회 결과 응답
deactivate Gateway
Frontend --> Client: 요금조회 결과 화면 표시\n{상품명, 청구월, 요금, 할인정보,\n사용량, 예상해지비용, 단말기할부금,\n청구/납부정보}
deactivate Frontend
== 오류 처리 흐름 ==
note over Frontend, BillService
각 단계별 오류 처리
- 권한 없음: 서비스 이용 권한이 없습니다
- 메뉴 로딩 실패: 요금 조회 메뉴 로딩에 실패하였습니다
- 조회 신청 실패: 요금 조회 신청에 실패하였습니다
- KOS 연동 실패: Circuit Breaker로 장애 격리
end note
@enduml