Skip to content

feat: Discord DM → FCM 푸시 전환 + 벌금 상세 페이지#80

Merged
bbbang105 merged 11 commits intodevfrom
feat/dm-to-push-and-fines-page
Apr 15, 2026
Merged

feat: Discord DM → FCM 푸시 전환 + 벌금 상세 페이지#80
bbbang105 merged 11 commits intodevfrom
feat/dm-to-push-and-fines-page

Conversation

@bbbang105
Copy link
Copy Markdown
Owner

Summary

  • 5종 리마인더 알림(벌금 부과/독촉, 마감, 지각, 투표)을 Discord DM → FCM 푸시로 전환
  • 벌금 상세 페이지(/profile/fines) 신규 — 본인 벌금 조회 + 납부 완료 버튼
  • 알림 로그에 push 타겟 + 수신자 닉네임 표시

변경사항

봇 (packages/bot)

  • lib/push-client.ts 신규 — 웹 내부 API /api/internal/reminder-push 호출 래퍼
  • handlers/dm-handler.tssendFineNotification/sendFineReminder/sendPollReminderPush 3종 푸시로 전환 (기존 DM 버튼 핸들러는 레거시 호환용으로 유지)
  • schedulers/fine-reminder.ts, deadline-reminder.ts, poll-reminder.ts — 배치 푸시 발송으로 교체

웹 (packages/web)

  • /profile/fines 신규 페이지 — 미납/납부완료/면제 3단 요약, 회차별 내역, 납부 완료 다이얼로그, 계좌번호 복사
  • /api/profile/fines GET, /api/fines/[id]/pay PATCH, /api/internal/reminder-push POST 신규
  • 프로필 "미납 벌금" 스탯 카드 클릭 → /profile/fines 이동
  • 알림 로그 관리자 UI에 push 필터 옵션 + 수신자 닉네임 표시

공유 (packages/shared)

  • NotificationType에 5종 추가: fine_notification, fine_reminder, deadline_reminder, grace_nudge, poll_reminder
  • 5종 전부 FORCE_SEND_TYPES — 유저가 끌 수 없음

리뷰 반영 (P0 + 핵심 P1)

  • 벌금 납부 race condition 방어 (atomic UPDATE)
  • Discord markdown 이스케이프, UUID 검증
  • clickUrl protocol-relative 차단, type 허용 목록, memberIds max 200
  • FORCE_SEND_TYPES 단일화
  • 로딩 상태에서 헤더 유지, 납부 다이얼로그에 계좌 정보 명시
  • profile/fines GET에 withCache(30s) 적용

Test plan

  • pnpm typecheck 통과 (shared/web/bot)
  • pnpm lint — 0 errors
  • pnpm --filter @blog-study/bot test — 150/150 통과
  • 로컬에서 5종 푸시 수동 발송 검증 (FCM 토큰 3개 모두 성공)
  • 알림 로그 UI에 수신자 닉네임 정상 표시 확인
  • 벌금 납부 플로우 직접 테스트 (다이얼로그 → atomic update → 관리자 채널 알림)
  • 딥링크 클릭 시 /profile/fines 이동 확인
  • 봇 배포 후 자동 스케줄러 (fine-reminder 09:00, deadline-reminder 08:00 KST) 검증

스펙 / 플랜

  • 스펙: `docs/superpowers/specs/26-04-15-dm-to-push-and-fines-page-design.md`
  • 플랜: `docs/superpowers/plans/26-04-15-dm-to-push-and-fines-page.md`

🤖 Generated with Claude Code

bbbang105 and others added 11 commits April 15, 2026 14:12
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
- GET /api/profile/fines: 내 벌금 목록 + 미납/납부/합계 요약
- PATCH /api/fines/[id]/pay: 본인 벌금 납부 완료 처리 + 관리자 Discord 알림

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
- push-client.ts: 웹 내부 API(/api/internal/reminder-push) 호출 클라이언트
- dm-handler.ts: sendFineNotification, sendFineReminder, sendPollReminderPush 푸시 전환
- fine-reminder.ts: sendGracePeriodNudge 배치 푸시 + sendFineReminder 호출부 수정
- deadline-reminder.ts: sendForDDay 배치 푸시 전환
- poll-reminder.ts: sendPollReminderPush 호출로 전환

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
- fine/deadline/grace/poll 등 리마인더 타입은 유저가 끌 수 없음 (FORCE_SEND_TYPES)
- 알림 설정 UI에서도 강제 타입 자동 필터링
- 푸시 알림 로그 metadata에 수신자 닉네임 저장
- 관리자 알림 로그 UI에서 "푸시 → 닉네임1, 닉네임2" 표시

Co-Authored-By: Claude <noreply@anthropic.com>
- [P0 버그] fine-reminder/deadline-reminder: client null 가드 제거 (수동 실행 차단 해소)
- [P0 UI] 벌금 페이지 로딩 시 헤더 유지
- [보안] reminder-push: clickUrl protocol-relative 차단, type 허용목록, memberIds max 200
- [보안] fines/pay: atomic update (race condition), Discord markdown escape, UUID 검증
- [DRY] FORCE_SEND_TYPES 단일화 (push.ts → notification-preferences import)
- [UX] 계좌번호 복사 실패 처리, 납부 확인 다이얼로그에 계좌 정보 명시
- [Perf] profile/fines GET에 withCache(30s) 적용

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@bbbang105 bbbang105 requested a review from choihooo as a code owner April 15, 2026 06:11
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
study-admin-web Ready Ready Preview, Comment Apr 15, 2026 6:12am

@bbbang105 bbbang105 added ⚡️ perf 성능 개선 작업 📄 docs 문서 추가 및 수정 🚀 feat 새로운 기능 추가 / 일부 코드 추가 / 일부 코드 수정 (리팩토링과 구분) / 디자인 요소 수정 🚨 fix 버그 수정 / 에러 해결 labels Apr 15, 2026
@bbbang105 bbbang105 merged commit 974f6da into dev Apr 15, 2026
8 checks passed
@bbbang105 bbbang105 deleted the feat/dm-to-push-and-fines-page branch April 15, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📄 docs 문서 추가 및 수정 🚀 feat 새로운 기능 추가 / 일부 코드 추가 / 일부 코드 수정 (리팩토링과 구분) / 디자인 요소 수정 🚨 fix 버그 수정 / 에러 해결 ⚡️ perf 성능 개선 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant