feat: 관리자 마케팅 알림 발송 기능 추가 - #292
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d73c35a45
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| AdminNoticePushTargetType.ALL -> | ||
| userRepository.findAllMarketingAgreed() | ||
|
|
||
| AdminNoticePushTargetType.SELECTED_USERS -> | ||
| userRepository.findAllMarketingAgreedByIdIn(request.userIds) |
There was a problem hiding this comment.
Honor night-push consent for nighttime campaigns
When this endpoint is invoked during the application's night period (21:00–08:00), both target queries select users solely by marketing consent, so users with nightPushConsent = false still receive the campaign. The existing reminder query in NotificationSettingRepository explicitly excludes such users at night; apply the same consent check here or prevent administrators from initiating campaigns during that period.
Useful? React with 👍 / 👎.
| require(title.isNotBlank()) { "제목은 비어 있을 수 없습니다." } | ||
| require(body.isNotBlank()) { "본문은 비어 있을 수 없습니다." } | ||
| require(link.isNotBlank()) { "링크는 비어 있을 수 없습니다." } |
There was a problem hiding this comment.
Reject payloads that cannot be stored in history
Limit title, body, and link to the 255-character capacity of the corresponding notification_histories columns (or enlarge those columns). With, for example, a 256-character body that FCM accepts, the push is sent first and history persistence then fails; runCatching suppresses that failure, the endpoint returns 204, and the audit reports the delivered push as failed, which can prompt an administrator to retry and send duplicates.
Useful? React with 👍 / 👎.
변경 사항
POST /api/v1/admin/notice-pushesALL,SELECTED_USERS대상 유형 지원SUPER_ADMIN권한 적용ADMIN_MARKETING유형의 앱 내 알림 히스토리를 저장합니다.변경 이유
관리자가 마케팅 목적의 푸시 알림을 발송할 수 있는 기능이 없었고, 기존 관리자 전체 이메일은 마케팅 수신 동의 여부를 확인하지 않고 있었습니다. 마케팅 수신 동의 정책을 이메일과 푸시 발송 대상 조회에 일관되게 적용하기 위해 변경했습니다.
영향
link를 통해 클라이언트가 알림 클릭 시 관련 화면으로 이동할 수 있습니다.검증
spotlessCheck통과asciidoctorAdmin문서 빌드 통과git diff --check통과참고
현재 감사 로그의
sentCount는 실제 기기 도달 수가 아니라 서버에서 발송 처리가 예외 없이 완료된 사용자 수입니다.