[BE-02] notification DISCORD 채널 편입 + DiscordNotificationGatewayImpl
작업 내용 (설계 의도)
변경 사항
기존 notification 발송 구조에 Discord 채널을 편입한다(PRD 지시, ADR-004 발송 재사용). 근거 TDD: ../TDD.md §AS-IS·§Detail Design.
domain/notification/vo/NotificationChannel.kt에DISCORD추가(엔진 변경 없음 —dispatchById의supportedChannel라우팅에 자동 편입).infrastructure/notification/gateway/DiscordNotificationGatewayImpl.kt신규 —NotificationChannelGateway구현,supportedChannel = DISCORD.send(notification)에서 payload(_title/_body/source/severity/env)를 Discord Embed JSON으로 구성해 webhook URL로 POST. severity→Embed color 매핑. 실패 시SendResult(success=false, ...)(예외를 삼켜 dispatch가 markFailed 하도록, 기존 SmsChannelGateway 패턴).infrastructure/notification/gateway/DiscordProperties.kt(@ConfigurationProperties) 신규 —webhookUrl,username등. webhook URL은 per-user 연락처가 아닌 고정 채널 URL(RecipientContactResolver 미사용).- RestClient는 기존
ExternalRestClientFactory.create(baseUrl)사용(Discord는 5초 타임아웃 충분). SUPPORTED_ENQUEUE_CHANNELS(이벤트 기반 enqueueOrSkip 전용)는 손대지 않는다 — DISCORD 발송은send()경로.
롤백: DiscordNotificationGatewayImpl 빈 제거(revert). enum 값 추가는 하위호환(기존 채널 무영향).
의존
- 없음 (wave 1)
다이어그램
처리 흐름
sequenceDiagram participant NS as NotificationDomainService participant DG as DiscordNotificationGatewayImpl participant D as Discord Webhook NS->>DG: send(notification[DISCORD]) DG->>D: POST webhook (Embed: title/color/fields) D-->>DG: 204 또는 5xx DG-->>NS: SendResult(success)
테스트 케이스
- DISCORD 채널 Notification을 dispatchById로 발송하면 DiscordNotificationGatewayImpl이 선택된다(supportedChannel 매칭).
- Embed에 env·source·severity 필드와 제목/본문이 포함된다(mock webhook 캡처).
- webhook이 5xx를 반환하면 SendResult(success=false)를 반환하고 예외를 전파하지 않는다.
- severity가 critical이면 Embed color가 warn/info와 다르게 매핑된다.
- NotificationChannel enum에 DISCORD가 추가되어도 기존 IN_APP/PUSH/EMAIL/SMS 라우팅이 변하지 않는다.