improvement: 이력 엑셀 내보내기 API 추가 (#191) #235

Merged
seonkyu.kim merged 1 commits from improvement/#191-history-export into develop 2026-02-25 07:41:50 +00:00
Owner

📋 작업 요약

  • 이력 목록(history/list)과 동일한 필터 기준으로 발송 이력을 엑셀로 내보내는 API 추가
  • PRD FR-STA-004: "화면 필터=다운로드 결과" 충족

Closes #191

🛠️ 작업 내용 (Changes)

  • SPMS.Application/DTOs/Stats/HistoryExportRequestDto.cs — 신규 요청 DTO (keyword/status/start_date/end_date)
  • SPMS.Domain/Interfaces/IPushSendLogRepository.cs — GetMessageHistoryAllAsync 메서드 추가
  • SPMS.Infrastructure/Persistence/Repositories/PushSendLogRepository.cs — GroupBy 쿼리를 private helper(BuildMessageHistoryQuery)로 추출, GetMessageHistoryAllAsync 구현
  • SPMS.Application/Interfaces/IStatsService.cs — ExportHistoryAsync 인터페이스 추가
  • SPMS.Application/Services/StatsService.cs — ClosedXML 엑셀 생성 구현 (메시지코드/제목/서비스명/발송일시/대상수/성공/실패/오픈율/상태)
  • SPMS.API/Controllers/StatsController.cs — POST /v1/in/stats/history/export 엔드포인트 추가

📢 리뷰어 참고 사항 (To Reviewers)

  • 기존 GetMessageHistoryPagedAsync의 GroupBy 로직을 BuildMessageHistoryQuery private helper로 추출하여 Paged/All 양쪽에서 재사용
  • SendStatus.Determine() 규칙을 엑셀 상태 컬럼에 동일하게 적용
  • 오픈율은 현재 0 고정 (기존 history/list와 동일)

체크리스트 (Self Checklist)

  • 빌드(Build)가 성공적으로 수행되었는가?
  • 모든 단위 테스트(Unit Test)를 통과하였는가?
  • 불필요한 로그나 주석을 제거하였는가?
  • 컨벤션(Clean Architecture, Naming)을 준수하였는가?
  • 기밀 정보(비밀번호, 키 등)가 하드코딩 되어있지 않은가?

📸 스크린샷 / 테스트 로그 (Screenshots/Logs)

빌드했습니다.
    경고 0개
    오류 0개
경과 시간: 00:00:02.87
## 📋 작업 요약 - 이력 목록(history/list)과 동일한 필터 기준으로 발송 이력을 엑셀로 내보내는 API 추가 - PRD FR-STA-004: "화면 필터=다운로드 결과" 충족 ## 🔗 관련 이슈 (Related Issues) Closes #191 ## 🛠️ 작업 내용 (Changes) - [x] `SPMS.Application/DTOs/Stats/HistoryExportRequestDto.cs` — 신규 요청 DTO (keyword/status/start_date/end_date) - [x] `SPMS.Domain/Interfaces/IPushSendLogRepository.cs` — GetMessageHistoryAllAsync 메서드 추가 - [x] `SPMS.Infrastructure/Persistence/Repositories/PushSendLogRepository.cs` — GroupBy 쿼리를 private helper(BuildMessageHistoryQuery)로 추출, GetMessageHistoryAllAsync 구현 - [x] `SPMS.Application/Interfaces/IStatsService.cs` — ExportHistoryAsync 인터페이스 추가 - [x] `SPMS.Application/Services/StatsService.cs` — ClosedXML 엑셀 생성 구현 (메시지코드/제목/서비스명/발송일시/대상수/성공/실패/오픈율/상태) - [x] `SPMS.API/Controllers/StatsController.cs` — POST /v1/in/stats/history/export 엔드포인트 추가 ## 📢 리뷰어 참고 사항 (To Reviewers) - 기존 GetMessageHistoryPagedAsync의 GroupBy 로직을 BuildMessageHistoryQuery private helper로 추출하여 Paged/All 양쪽에서 재사용 - SendStatus.Determine() 규칙을 엑셀 상태 컬럼에 동일하게 적용 - 오픈율은 현재 0 고정 (기존 history/list와 동일) ## ✅ 체크리스트 (Self Checklist) - [x] 빌드(Build)가 성공적으로 수행되었는가? - [x] 모든 단위 테스트(Unit Test)를 통과하였는가? - [x] 불필요한 로그나 주석을 제거하였는가? - [x] 컨벤션(Clean Architecture, Naming)을 준수하였는가? - [x] 기밀 정보(비밀번호, 키 등)가 하드코딩 되어있지 않은가? ## 📸 스크린샷 / 테스트 로그 (Screenshots/Logs) ``` 빌드했습니다. 경고 0개 오류 0개 경과 시간: 00:00:02.87 ```
seonkyu.kim added 1 commit 2026-02-25 07:40:30 +00:00
- POST /v1/in/stats/history/export 엔드포인트 추가
- history/list와 동일 필터(keyword/status/date) 기준 엑셀 내보내기
- PushSendLogRepository에서 GroupBy 쿼리를 private helper로 리팩토링
- ClosedXML로 엑셀 생성 (메시지코드/제목/서비스명/발송일시/대상수/성공/실패/오픈율/상태)

Closes #191
seonkyu.kim added the
Priority
Medium
Status
In Progress
Type
Improvement
labels 2026-02-25 07:40:42 +00:00
seonkyu.kim requested review from Owners 2026-02-25 07:40:44 +00:00
seonkyu.kim self-assigned this 2026-02-25 07:40:44 +00:00
seonkyu.kim added this to the Phase 2: 메시지 + 통계 milestone 2026-02-25 07:40:48 +00:00
seonkyu.kim merged commit 5fc2221d5b into develop 2026-02-25 07:41:50 +00:00
seonkyu.kim deleted branch improvement/#191-history-export 2026-02-25 07:42:05 +00:00
seonkyu.kim added
Status
Done
and removed
Status
In Progress
labels 2026-02-25 07:42:28 +00:00
Sign in to join this conversation.
No description provided.