docs: [notification-settings] API soundType 완료 상태 반영

- Gap 분석 → 연동 현황으로 업데이트 (API 완료, React 대기)
- 저장/조회 흐름 코드 추가
- React 구현 요청서 링크 추가
This commit is contained in:
김보곤
2026-03-18 11:26:31 +09:00
parent 2a35cf311f
commit ac1eecb71d

View File

@@ -1,7 +1,7 @@
# 서비스 알림설정 (Notification Settings)
> **작성일**: 2026-03-18
> **상태**: 구현 완료 (soundType 연동 미완)
> **상태**: API 구현 완료 (React soundType 연동 대기)
> **대상**: API (`sam/api`) + React (`sam/react`)
---
@@ -445,56 +445,43 @@ MNG 관리자가 보내는 수동 푸시 알림 관리.
---
## 9. Gap 분석 — soundType 연동
## 9. soundType 연동 현황
### 9.1 현재 상태
### 9.1 현재 상태 (2026-03-18)
| 항목 | React | API | 상태 |
|------|-------|-----|------|
| `soundType` 타입 정의 | ✅ `types.ts` | — | React만 선행 |
| `soundType` UI (드롭다운) | ✅ `index.tsx` | — | 렌더링됨 |
| `soundType` 미리듣기 | 🟡 Mock (토스트만) | — | 실제 재생 없음 |
| `soundType` 저장 | ✅ API 호출 시 전송 | ❌ 무시됨 | **Gap** |
| `soundType` 조회 | ✅ 기본값 'default' 병합 | ❌ 반환 안 함 | **Gap** |
| 음원 파일 서빙 | ❌ 빈 placeholder | — | **Gap** |
| 항목 | API | React | 상태 |
|------|-----|-------|------|
| `soundType` 저장 | ✅ `settings.sound_type` JSON에 저장 | ✅ PUT 요청 시 전송 | **완료** |
| `soundType` 조회 | ✅ 응답에 `soundType` 포함 | ✅ 기본값 병합 | **완료** |
| `soundType` 검증 | ✅ `in:default,sam_voice,mute` | ✅ 타입 정의 | **완료** |
| `soundType` UI | — | ✅ 드롭다운 + Play 버튼 | **완료** |
| 미리듣기 실제 재생 | — | ❌ Mock (토스트만) | **React 작업 대기** |
| 음원 파일 서빙 | — | ❌ 빈 placeholder | **React 작업 대기** |
### 9.2 React types.ts 주석 (2026-01-05)
### 9.2 API 구현 완료 내용
```typescript
/**
* [2026-01-05] 백엔드 API 수정 필요 사항
* 1. NotificationItem에 soundType 필드 추가
* - 기존: { enabled: boolean, email: boolean }
* - 변경: { enabled: boolean, email: boolean, soundType: 'default' | 'sam_voice' | 'mute' }
*/
**저장 흐름**:
```
React PUT → { soundType: "sam_voice" }
NotificationSettingService::updateGroupedSettings()
→ notification_settings.settings JSON = { "sound_type": "sam_voice" }
```
### 9.3 구현 필요 항목
**조회 흐름**:
```
NotificationSettingService::getGroupedSettings()
→ notification_settings.settings['sound_type'] 읽기
→ 미저장 시 기본값 'default'
→ React 응답: { enabled, email, soundType }
```
#### API 측
### 9.3 React 구현 대기 항목
1. **그룹 기반 응답에 soundType 포함**
- `NotificationSettingService::getGroupedSettings()` 수정
- 각 항목에 `soundType` 필드 추가 (기본값: `'default'`)
> **요청 문서**: `docs/plans/notification-sound-react-request.md`
2. **그룹 기반 업데이트에 soundType 저장**
- `NotificationSettingService::updateGroupedSettings()` 수정
- `soundType` 값을 `notification_settings.settings` JSON 또는 `push_notification_settings.sound` 컬럼에 저장
3. **음원 파일 API 제공**
- 옵션 A: `GET /api/v1/sounds/{soundType}.wav` — API에서 직접 서빙
- 옵션 B: React `public/sounds/` 경로에 실제 음원 파일 배치 — 정적 파일로 서빙
- **권장**: 옵션 B (React에서 직접 서빙, CDN 캐싱 가능)
#### React 측
4. **음원 파일 배치**
- `mng/public/sounds/default.wav``react/public/sounds/default.wav` 복사
- SAM 보이스 음원 제작 후 `react/public/sounds/sam_voice.wav` 배치
5. **미리듣기 실제 구현**
- `playPreviewSound()` 함수에서 `Audio` 객체로 실제 재생
- 음원 URL: `/sounds/{soundType}.wav`
1. **음원 파일 배치**`mng/public/sounds/default.wav``react/public/sounds/` 복사
2. **미리듣기 실제 재생**`playPreviewSound()`에서 `Audio` API 사용
3. **types.ts 주석 정리** — "백엔드 API 수정 필요" 블록 제거
---
@@ -545,6 +532,7 @@ MNG 관리자가 보내는 수동 푸시 알림 관리.
| 문서 | 설명 |
|------|------|
| `docs/plans/notification-sound-react-request.md` | soundType React 구현 요청서 (프론트 전달용) |
| `docs/dev/dev_plans/flow-tests/notification-settings-flow.json` | 플로우 테스트 시나리오 |
| `docs/dev/dev_plans/archive/notification-sound-system-plan.md` | 알림음 시스템 구현 계획 (완료) |
| `docs/dev/dev_plans/archive/fcm-user-targeted-notification-plan.md` | FCM 사용자별 발송 계획 (완료) |