Skip to content

Feature/admin backoffice#48

Merged
yerroong merged 6 commits into
developfrom
feature/admin-backoffice
Mar 15, 2026
Merged

Feature/admin backoffice#48
yerroong merged 6 commits into
developfrom
feature/admin-backoffice

Conversation

@yerroong
Copy link
Copy Markdown
Contributor

@yerroong yerroong commented Mar 15, 2026

✔️ 체크리스트

  • : Merge할 브랜치를 확인해 주세요.

🔍 작업 내용

어드민 페이지 api 및 ui 작업

  • 어드민 로그인 페이지 구현 (유저 로그인과 동일한 슬라이드 배경 디자인)
  • 문의사항 관리 페이지 API 연동 (목록 조회, 필터, 검색, 답변 전송/삭제, 문의 삭제)
  • 유저 문의 삭제 기능 추가 (미답변 문의만 삭제 가능)
  • 어드민 정책 관리 페이지 구현 (정책 CRUD, 카테고리 관리, 활성화 토글)
  • 어드민 유저 검색 기능 구현 (전화번호 뒷자리 + 이름 필터링)
  • 알림 전송 API 연동 (DIRECT/ALL/OWNER/MEMBER 타입, 대량 전송 지원, 타임아웃 제거)
  • 어드민 유저별 정책 관리 완전 재구현 (유저 페이지와 동일한 UI/UX)
    • 차단 관리: 반복 차단 정책 + 즉시 차단 (드럼롤 시간 선택, 요일 선택)
    • 데이터 제한: 월 공유 + 하루 총 데이터 슬라이더
    • 앱 관리: 검색, 필터링, 정렬, 데이터/속도 제한, 화이트리스트
    • 현재 적용 중인 정책 표시
  • 낙관적 업데이트 적용 (로딩 없이 즉시 UI 반영)

⚠️ 주의 사항 / 기타

  • 알림 전송 시 500 에러 발생 :
    요청 형식은 정상: { targetType: "OWNER", value: { message: "..." } }
    백엔드 개발자에게 /api/notifications 엔드포인트 로그 확인 요청 필요
    OWNER 타입 전송 시 서버 내부 오류 발생 원인 파악 필요
  • 유저 검색 및 역할 관련 차단/제한 부분 코드 수정 필요

Summary by CodeRabbit

새로운 기능

  • 관리자 전용 로그인 페이지 추가
  • 정책 관리 인터페이스 구현 (생성, 수정, 삭제, 활성화 토글)
  • 사용자 문의 관리 시스템 (답변 작성, 삭제, 필터링)
  • 공지사항 전송 기능 (선택적 수신자 지정)
  • 사용자 및 가족 구성원 관리 화면
  • 데이터 한도 및 앱 정책 설정
  • 즉시 차단 및 반복 차단 정책 관리

개선사항

  • 오류 메시지 처리 개선
  • 세션 만료 시 자동 리다이렉션
  • 관리자 인증 상태 관리 강화

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 15, 2026

Warning

Rate limit exceeded

@yerroong has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 326da988-7c0b-41dd-8453-26023f331bd9

📥 Commits

Reviewing files that changed from the base of the PR and between 4544940 and 084dcde.

📒 Files selected for processing (3)
  • src/api/client.ts
  • src/api/index.ts
  • src/page/Support/Support.tsx
📝 Walkthrough

Walkthrough

관리자 인증 시스템과 관리 대시보드를 구현합니다. 관리자 로그인 페이지, 보호된 라우트, 정책/문의/알림/사용자 관리 페이지를 추가하고 관련 API 서비스(adminPolicyService, notificationService)를 확장합니다. 에러 처리 유틸리티도 추가됩니다.

Changes

Cohort / File(s) Summary
API 에러 처리 및 유틸리티
src/api/client.ts
ApiErrorResponse 인터페이스, getErrorMessage(), getErrorCode() 함수 추가. 401 에러 시 adminAuthenticated 제거, CSRF 토큰 초기화, 경로에 따라 /admin/login 또는 /login으로 리다이렉트하도록 변경.
API 내보내기
src/api/index.ts
adminPolicyService, notificationService 추가 내보내기.
인증 서비스
src/api/services/authService.ts
adminLogin() 메서드 추가. /auth/admin/login으로 POST 요청, CSRF 토큰 추출 및 저장, LoginResult 반환.
정책 및 블록 관리 API
src/api/services/blockService.ts, src/api/services/thresholdService.ts
blockService: updateRepeatBlockPolicy에 PATCH 사용, getImmediateBlock(), updateImmediateBlock() 추가. thresholdService: toggleDailyLimit(), updateDailyLimit(), toggleSharedLimit(), updateSharedLimit() 추가.
가족 및 라인 관리 API
src/api/services/familyService.ts, src/api/services/lineService.ts
familyService: FamilyMember, FamilyMembersByLineResponse 인터페이스, getMembersByLine() 메서드 추가. lineService: LineByPhoneResult 인터페이스, getLinesByPhone() 메서드 추가.
관리 정책 서비스
src/api/services/adminPolicyService.ts
AdminPolicy, PolicyRequest, PolicyActivationResponse, PolicyCategory 인터페이스 추가. getAllPolicies(), createPolicy(), updatePolicy(), deletePolicy(), toggleActivation(), getCategories(), createCategory(), updateCategory(), deleteCategory() 메서드 포함한 adminPolicyService 객체 내보내기.
알림 서비스
src/api/services/notificationService.ts
NotificationTargetType 타입, SendNotificationRequest 인터페이스, send() 메서드를 포함한 notificationService 객체 추가.
질문 서비스
src/api/services/questionService.ts
createAnswer(), deleteAnswer(), getAdminQuestions() 메서드 추가. 페이지네이션 및 선택적 필터(categoryIds, isAnswered, lineId) 지원.
관리자 인증 및 레이아웃
src/page/Admin/AdminLoginPage.tsx, src/page/Admin/AdminLayout.tsx, src/routes/Router.tsx, src/utils/domain.ts
AdminLoginPage 컴포넌트 추가 (이메일/비밀번호 입력, 배경 슬라이드쇼). AdminLayout: 로그아웃 시 adminAuthenticated, adminEmail 제거, adminEmail의 첫 글자 표시. Router: AdminProtectedRoute 추가, /admin/login 라우트 추가. domain.ts: isAdminDomain에 'office' 포함 여부 확인 추가.
관리 대시보드 페이지
src/page/Admin/PolicyManagement.tsx, src/page/Admin/InquiryManagement.tsx, src/page/Admin/NotificationManagement.tsx, src/page/Admin/UserManagement.tsx
PolicyManagement: adminPolicyService로 정책/카테고리 데이터 페칭, ConfirmModal, PolicyFormModal, CategoryManageModal 추가. InquiryManagement: questionService로 문의 데이터 페칭, 상세 조회, 첨부파일 처리, 회신 및 삭제 기능 추가. NotificationManagement: TARGET_OPTIONS 기반 UI, notificationService로 알림 전송. UserManagement: lineService/familyService로 라인 및 가족 구성원 검색, MemberPolicyManager 통합.
정책 관리 컴포넌트
src/page/Admin/components/policy/BlockPolicyTab.tsx, src/page/Admin/components/policy/BlockPolicyManager.tsx, src/page/Admin/components/policy/ImmediateBlockPolicy.tsx, src/page/Admin/components/policy/LimitPolicyTab.tsx, src/page/Admin/components/policy/AppPolicyTab.tsx, src/page/Admin/components/policy/AppFilterBar.tsx, src/page/Admin/components/policy/AppPolicyFilters.tsx
BlockPolicyTab: 즉시 블록 상태 관리. BlockPolicyManager: 반복 블록 정책 생성/편집/삭제, ScrollPicker/TimePicker UI. ImmediateBlockPolicy: 즉시 블록 활성화, 사전 설정 시간, 커스텀 입력. LimitPolicyTab: 일일/공유 데이터 제한 토글 및 수정. AppPolicyTab: 라인 앱 목록, 정책 필터링, 데이터/속도 제한 설정. AppFilterBar/AppPolicyFilters: 검색, 음성 검색, 정렬, 정책/조건 필터.
사용자 관리 컴포넌트
src/page/Admin/components/MemberPolicyManager.tsx
FamilyMember 선택, 탭 기반 정책 관리 (BlockPolicyTab, LimitPolicyTab, AppPolicyTab), 적용된 정책 표시.
지원 페이지 확장
src/page/Support/Support.tsx, src/page/Support/components/InquiryHistory.tsx
Support.tsx: handleDeleteInquiry() 추가. InquiryHistory.tsx: onDeleteInquiry 선택적 prop, 삭제 버튼, ConfirmModal 통합.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive PR 제목이 매우 단순하고 모호하여 구체적인 변경 사항을 전달하지 못합니다. 관리자 백오피스 기능 추가의 핵심 변경 사항을 더 구체적으로 명시하는 제목으로 수정하는 것을 권장합니다. 예: 'feat: admin backoffice - login, policies, inquiries, notifications'
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed PR 설명이 템플릿 구조를 따르고 작업 내용을 한국어로 상세히 기술했으나 이슈 번호가 누락되었습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/admin-backoffice
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yerroong yerroong merged commit 5a88bc6 into develop Mar 15, 2026
This was referenced Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant