hgzero/design/backend/sequence/inner/notification-Todo알림발송.puml
ondal 715add4dbc 외부/내부 시퀀스 설계 일관성 개선 및 표준화
주요 변경사항:

[Critical]
- API 엔드포인트 통일: POST /api/minutes/{minutesId}/finalize
- 이벤트 이름 표준화: MinutesFinalized

[Warning]
- API Gateway 라우팅 규칙 문서화 (외부 시퀀스 7개 파일)
- 대시보드 API 경로 통일: GET /api/dashboard
- AI 제안 병합 프로세스 상세 문서화
- 회의록 확정 검증 로직 5단계 상세화

[Minor]
- Redis 캐시 TTL 명시 (7개 파일, TTL 정책 표준화)
- 대시보드 페이지네이션 파라미터 추가
- 에러 응답 포맷 표준화 (14개 에러 응답)

총 31개 파일 수정, 34건의 개선 사항 적용

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 09:48:06 +09:00

148 lines
3.8 KiB
Plaintext

@startuml
!theme mono
title Notification Service - Todo알림발송 내부 시퀀스
participant "NotificationController" as Controller
participant "NotificationService" as Service
participant "EmailTemplateService" as TemplateService
participant "NotificationRepository" as Repository
participant "EmailClient" as EmailClient
database "Notification DB" as DB
queue "Azure Event Hubs<<E>>" as EventHub
participant "Email Service<<E>>" as EmailService
== TodoAssigned 이벤트 수신 ==
EventHub -> Controller: TodoAssigned 이벤트 수신
activate Controller
note right
이벤트 데이터:
- todoId
- meetingId
- 담당자 (userId, userName, email)
- Todo 내용
- 마감일
- 우선순위
- 회의록 링크
end note
Controller -> Service: sendTodoNotification(todoId, todoData)
activate Service
== 알림 기록 생성 ==
Service -> Repository: createNotification(todoId, "TODO_ASSIGNED", assignee)
activate Repository
Repository -> DB: 알림 정보 생성\n(알림ID, TodoID, 유형, 상태, 수신자, 생성일시)
activate DB
DB --> Repository: notificationId 반환
deactivate DB
Repository --> Service: NotificationEntity 반환
deactivate Repository
== 이메일 템플릿 생성 ==
Service -> TemplateService: generateTodoEmail(todoData)
activate TemplateService
TemplateService -> TemplateService: 템플릿 로드
note right
템플릿 정보:
- 제목: "[TODO 할당] {Todo 내용}"
- 내용: Todo 상세 + 회의록 링크
- 우선순위 뱃지 표시
end note
TemplateService -> TemplateService: 데이터 바인딩
note right
바인딩 데이터:
- Todo 내용
- 마감일
- 우선순위
- 회의 제목
- 회의록 링크 (해당 섹션)
- Todo 관리 페이지 링크
end note
TemplateService --> Service: EmailContent 반환
deactivate TemplateService
== 이메일 발송 ==
Service -> EmailClient: sendEmail(assignee.email, emailContent)
activate EmailClient
EmailClient -> EmailService: SMTP 이메일 발송
activate EmailService
EmailService --> EmailClient: 발송 결과
deactivate EmailService
alt 발송 성공
EmailClient --> Service: SUCCESS
Service -> Repository: updateNotificationStatus(notificationId, "SENT")
activate Repository
Repository -> DB: 알림 상태 업데이트\n(상태=발송완료, 발송일시=현재시각)
activate DB
DB --> Repository: 업데이트 완료
deactivate DB
Repository --> Service: 완료
deactivate Repository
else 발송 실패
EmailClient --> Service: FAILED (errorMessage)
Service -> Repository: updateNotificationStatus(notificationId, "FAILED")
activate Repository
Repository -> DB: 알림 상태 업데이트\n(상태=발송실패, 오류메시지=에러내용)
activate DB
DB --> Repository: 업데이트 완료
deactivate DB
Repository --> Service: 완료
deactivate Repository
Service -> Service: 재시도 큐에 추가
end
deactivate EmailClient
Service --> Controller: NotificationResponse\n(notificationId, status)
deactivate Service
Controller --> EventHub: TodoNotificationSent 이벤트 발행\n(todoId, notificationId, status)
deactivate Controller
== Todo 마감일 3일 전 리마인더 (스케줄링) ==
note over Service, EmailService
별도 스케줄링 작업:
- 마감일 3일 전 자동 리마인더
- 실행 주기: 1일 1회
- 대상: 미완료 Todo
- 템플릿: "[리마인더] Todo 마감 3일 전"
end note
note over Controller, EmailService
처리 시간:
- 알림 기록 생성: ~100ms
- 템플릿 생성: ~200ms
- 이메일 발송: ~500ms
- 총 처리 시간: ~800ms
재시도 정책:
- 최대 3회 재시도
- 재시도 간격: 5분, 15분, 30분
Todo 알림 유형:
1. 할당 알림 (즉시)
2. 마감일 3일 전 리마인더
3. 마감일 1일 전 리마인더
4. 마감일 당일 리마인더
end note
@enduml