Skip to content

Refactor: Admin 이벤트 보상 시스템 단순화 및 레거시 정리 (#319)#320

Merged
IISweetHeartII merged 4 commits intodevfrom
refactor/admin-event-reward-simplify-#319
Mar 9, 2026
Merged

Refactor: Admin 이벤트 보상 시스템 단순화 및 레거시 정리 (#319)#320
IISweetHeartII merged 4 commits intodevfrom
refactor/admin-event-reward-simplify-#319

Conversation

@IISweetHeartII
Copy link
Contributor

Summary

Admin 이벤트 보상 지급 시스템을 단순화하고, 불필요한 API와 레거시 코드를 제거합니다.

Changes

Backend (NestJS)

  • EventOpsConfigallowMultipleRewards 필드 추가 (CS 이벤트 다중 지급 지원)
  • AdminGrantRewardReqDTO 단순화: notice 수동 입력 필드 5개 제거(noticeTitle, noticeBody, noticeCtaText, noticeCtaLink, displayReason), customRewards 추가
  • Notice 자동 구성: event DB 값(title, rewardConfig, ctaText, ctaLink) 기반
  • CTA 자동 매핑: 경험 정리만 → /experience, 첨삭만 → /correction, 둘 다 → /experience
  • 어드민 이벤트 목록: 기간 필터 제거 → 모든 manualRewardOnly 이벤트 표시
  • manual-reward-options API에 userId 쿼리 파라미터 추가 (isGranted 포함)
  • CS 이벤트: allowMultipleRewards 시 중복 보상 검증 스킵, 커스텀 이용권 지원

제거된 API

  • POST /admin/api/tickets/grant → CS 이벤트로 통합
  • GET /admin/api/tickets/historyGET /admin/api/ticket-grants로 통합

Admin UI (admin-client/)

  • 이용권 거래 내역 탭 제거 (3탭 → 2탭)
  • "이용권 지급" 버튼 제거 → "이벤트 보상" 버튼만 유지
  • GrantEventRewardModal 리팩터링:
    • Notice 수동 입력 UI 제거 → read-only 미리보기
    • CS 이벤트: 이용권 종류/수량 선택 UI 추가 (+/- 버튼)
    • 이미 보상 받은 이벤트는 드롭다운에서 disabled (CS 제외)
  • GrantTicketModal, TicketHistory.js 파일 삭제

DB

  • FEEDBACK_OBT_W1, FEEDBACK_OBT_W2, FEEDBACK, CS 이벤트 seed 마이그레이션 추가
  • 스키마 변경 없음 (jsonb 필드 데이터만 변경)

Type of Change

  • Refactoring (기능 변경 없이 코드 개선)
  • Breaking change (기존 기능에 영향을 주는 변경)

Target Environment

  • Dev (dev)

Related Issues

Testing

  • Admin 대시보드 접속 확인 (/admin/dashboard)
  • 회원 관리 → 이벤트 보상 버튼 → 모달 동작 확인
  • FEEDBACK 이벤트 보상 지급 → Notice 자동 생성 확인
  • CS 이벤트 → 커스텀 이용권 선택 → 다중 지급 확인
  • 이미 보상 받은 유저 → 해당 이벤트 드롭다운 disabled 확인
  • 지급/안내 이력 탭 정상 표시 확인
  • Supabase 마이그레이션 적용 확인

Checklist

  • 코드 컨벤션을 준수했습니다 (docs/development/CODE_STYLE.md)
  • Git 컨벤션을 준수했습니다 (docs/development/GIT_CONVENTIONS.md)
  • 네이밍 컨벤션을 준수했습니다 (docs/development/NAMING_CONVENTIONS.md)
  • 로컬에서 빌드가 성공합니다 (pnpm run build)
  • (API 변경 시) Swagger 문서가 업데이트되었습니다

Screenshots

N/A

Additional Notes

  • 제거된 2개 API(tickets/grant, tickets/history)를 사용하는 외부 클라이언트가 없는지 확인 필요
  • CS 이벤트의 ops_configallowMultipleRewards: true가 마이그레이션에 포함되어 있음
  • Admin UI는 별도 빌드 없이 정적 파일로 서빙되므로 즉시 반영됨

- Notice 수동 입력 필드 제거, event DB 값 기반 자동 구성
- CS 이벤트 다중 지급 지원 (allowMultipleRewards)
- CS 커스텀 이용권 선택 (customRewards DTO 추가)
- 어드민 이벤트 드롭다운 기간 필터 제거
- CTA 자동 매핑 (보상 종류 기반)
- POST /admin/api/tickets/grant API 제거 (CS 이벤트로 통합)
- GET /admin/api/tickets/history API 제거 (ticket-grants로 통합)
- Admin UI: 이용권 거래 내역 탭/이용권 지급 버튼 제거
- Admin UI: GrantEventRewardModal 리팩터링
- manual-reward-options에 userId 쿼리 추가 (isGranted 포함)
- FEEDBACK/CS 이벤트 seed 마이그레이션 추가
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 풀 리퀘스트는 관리자 이벤트 보상 시스템의 전반적인 효율성과 사용성을 개선하는 데 중점을 둡니다. 불필요한 기능을 제거하고, 프로세스를 자동화하며, 사용자 인터페이스를 간소화하여 관리자가 보상을 보다 쉽고 정확하게 처리할 수 있도록 합니다. 특히 CS 이벤트에 대한 유연성을 높이고, 레거시 코드를 정리하여 시스템 유지보수성을 향상시켰습니다.

Highlights

  • 백엔드 리팩토링 및 API 단순화: Admin 이벤트 보상 시스템을 단순화하기 위해 EventOpsConfigallowMultipleRewards 필드를 추가하여 CS 이벤트의 다중 지급을 지원합니다. AdminGrantRewardReqDTO에서 수동 알림 입력 필드 5개를 제거하고 customRewards 필드를 추가하여 DTO를 간소화했습니다. 또한, 이벤트 DB 값에 기반한 알림 자동 구성 및 CTA 자동 매핑 로직을 구현했습니다. POST /admin/api/tickets/grantGET /admin/api/tickets/history API는 제거되었으며, 각각 CS 이벤트 로직 및 GET /admin/api/ticket-grants로 통합되었습니다.
  • 어드민 UI 개선: 어드민 클라이언트에서 '이용권 거래 내역' 탭과 '이용권 지급' 버튼을 제거하여 UI를 간소화했습니다. GrantEventRewardModal은 수동 알림 입력 UI를 제거하고 읽기 전용 미리보기로 대체했으며, CS 이벤트의 경우 이용권 종류 및 수량을 선택할 수 있는 UI를 추가했습니다. 이미 보상을 받은 이벤트는 드롭다운에서 비활성화됩니다. GrantTicketModalTicketHistory.js 파일도 삭제되었습니다.
  • 데이터베이스 마이그레이션: FEEDBACK_OBT_W1, FEEDBACK_OBT_W2, FEEDBACK, CS 이벤트에 대한 시드 마이그레이션이 추가되었습니다. 스키마 변경은 없으며, jsonb 필드 데이터만 업데이트됩니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • admin-client/assets/app.js
    • Removed ComingSoonTab and TicketHistoryTab imports and their corresponding rendering logic.
  • admin-client/assets/components/Layout.js
    • Removed the ComingSoonTab component.
  • admin-client/assets/components/Modal.js
    • Removed legacy notice-related utility functions and components.
    • Modified formatRewardSummary to handle multiple rewards.
    • Added resolveCtaFromRewards to dynamically determine CTA text and link.
    • Removed the GrantTicketModal component.
    • Refactored GrantEventRewardModal to load event options internally, support custom CS rewards with quantity selectors, and display a read-only notice preview.
    • Updated GrantEventRewardModal's confirmation step to reflect new reward and notice logic.
  • admin-client/assets/components/Table.js
    • Removed the onGrant prop from UserTable and the '이용권 지급' button.
  • admin-client/assets/lib/api.js
    • Removed GRANT_REASONS constant.
    • Removed the 'tickets' tab from the TABS array.
  • admin-client/assets/pages/TicketHistory.js
    • Removed the TicketHistory.js file.
  • admin-client/assets/pages/UserManagement.js
    • Removed GrantTicketModal import and related state and handlers.
    • Removed eventOptions state, as it is now managed within GrantEventRewardModal.
    • Updated UserTable and GrantEventRewardModal component usages to reflect these changes.
  • src/modules/admin/application/dtos/admin-event-reward.dto.ts
    • Removed notice-related regex and messages.
    • Added RewardConfigItem import.
    • Updated AdminManualRewardEventItemResDTO with rewardConfig, allowMultipleRewards, and isGranted fields.
    • Introduced CustomRewardItemDTO for custom reward configurations.
    • Simplified AdminGrantRewardReqDTO by removing manual notice fields and adding customRewards.
    • Removed AdminGrantTicketsReqDTO, AdminGrantTicketsResDTO, AdminTicketHistoryItemResDTO, and AdminTicketHistoryResDTO DTOs.
    • Updated GrantRewardByUserIdParams to remove manual notice fields and include customRewards.
  • src/modules/admin/application/facades/admin-event-reward.facade.ts
    • Removed Logger and related ticket grant DTO imports.
    • Modified getManualRewardEvents to accept an optional userId and return additional event details including rewardConfig, allowMultipleRewards, and isGranted.
    • Removed grantTickets and getTicketHistory methods.
    • Refactored grantFeedbackRewardByUserId to simplify notice creation, handle custom rewards, and incorporate allowMultipleRewards logic for reward granting checks.
    • Added private helper methods resolveRewards, buildNoticeFromEvent, resolveCtaText, and resolveCtaLink for dynamic reward and notice generation.
  • src/modules/admin/presentation/admin-event-reward.controller.ts
    • Removed AdminGrantTicketsReqDTO, AdminGrantTicketsResDTO, and AdminTicketHistoryResDTO imports.
    • Modified getManualRewardEvents endpoint to accept an optional userId query parameter.
    • Removed POST /admin/api/tickets/grant and GET /admin/api/tickets/history endpoints.
  • src/modules/event/application/services/event-participation.service.ts
    • Added findGrantedEventIdsByUserId method to retrieve event IDs for which a user has already received a reward.
  • src/modules/event/application/services/event.service.ts
    • Added findAllManualRewardEvents method to retrieve all active manual reward events.
  • src/modules/event/domain/entities/event.entity.ts
    • Added allowMultipleRewards property to the EventOpsConfig interface.
  • src/modules/event/infrastructure/repositories/event-participation.repository.ts
    • Added findGrantedEventIdsByUserId method to query granted event participations for a given user and event IDs.
  • src/modules/event/infrastructure/repositories/event.repository.ts
    • Added findAllManualRewardEvents method to query all active events configured for manual rewards.
  • supabase/migrations/20260309200000_seed_feedback_and_cs_events.sql
    • Added a new SQL migration file to seed initial data for FEEDBACK_OBT_W1, FEEDBACK_OBT_W2, FEEDBACK, and CS events, including allowMultipleRewards configuration for the CS event.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@IISweetHeartII IISweetHeartII self-assigned this Mar 9, 2026
- POST /admin/api/tickets/grant 제거 반영
- GET /admin/api/tickets/history 제거 반영
- GET /admin/api/events/manual-reward-options 문서 추가
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly refactors the admin dashboard's reward granting system. The 'Ticket History' tab and its associated components, including ComingSoonTab and TicketHistoryTab, have been entirely removed from the UI and backend. The manual ticket granting modal (GrantTicketModal) has also been deleted, consolidating all reward issuance into the GrantEventRewardModal. This modal has been refactored to load event options internally, support custom reward quantities for Customer Service (CS) events, and dynamically generate notice previews and CTA links/texts based on the selected rewards. Backend changes reflect these UI updates by removing ticket granting DTOs and related facade methods, enhancing event reward DTOs with rewardConfig, allowMultipleRewards, and isGranted fields, and introducing a CustomRewardItemDTO for flexible reward definitions. The event service now includes methods to retrieve all manual reward events and check if a user has already been granted a specific event reward. Database migrations were added to seed 'FEEDBACK' and 'CS' events with manualRewardOnly and allowMultipleRewards configurations. Review comments highlighted the need for error handling when event options fail to load and suggested removing redundant descriptive text in the GrantEventRewardModal UI.

- Admin UI: 보상 안내 모달 체크박스 제거 → 항상 생성
- AdminGrantRewardReqDTO: createNotice 필드 제거
- buildNoticeFromEvent: createNotice 파라미터 제거
@IISweetHeartII IISweetHeartII merged commit f4d20b7 into dev Mar 9, 2026
2 checks passed
hyoinkang added a commit that referenced this pull request Mar 10, 2026
* Fix: 포트폴리오 내용 글자수 임시 변경 (#313)

* Fix: rag 요청 실패 시 fallback 로직 추가 (#312)

* fix: rag 생성 실패 시 fallback 코드 추가

- rag 생성 호출이 실패하면 상태를 failed로 바꾼다.

* fix: AI 서버 스펙 변경에 맞춰 API 스펙 수정 및 엔티티 마이그레이션

- 누락된 failed enum을 추가
- 첨삭 총평 필드를 correction_item에서 제거하고 portfolio-correction에 추가

* feat: correctionStatus enum 상태 다양화

- rag가 실패한 경우와 첨삭이 실패한 경우를 분리하기 위해 enum 상태를 추가함.

* refactor: try/catch 구문을 사용해 오류 처리 로직 개선

- async/await 비동기 오류 처리로 오류 처리 로직을 더 명확하고 읽기 쉽게 개선

* fix: createdAt 시간 오류 해결 (#315)

* Fix: 인사이트로그 시간 에러 해결 (#317)

- 채팅 멘션 주석처리

* Fix: 시간 UTC로 롤백 (#318)

* Refactor: Admin 이벤트 보상 시스템 단순화 및 레거시 정리 (#319) (#320)

* refactor: Admin 이벤트 보상 시스템 단순화 및 레거시 정리 (#319)

- Notice 수동 입력 필드 제거, event DB 값 기반 자동 구성
- CS 이벤트 다중 지급 지원 (allowMultipleRewards)
- CS 커스텀 이용권 선택 (customRewards DTO 추가)
- 어드민 이벤트 드롭다운 기간 필터 제거
- CTA 자동 매핑 (보상 종류 기반)
- POST /admin/api/tickets/grant API 제거 (CS 이벤트로 통합)
- GET /admin/api/tickets/history API 제거 (ticket-grants로 통합)
- Admin UI: 이용권 거래 내역 탭/이용권 지급 버튼 제거
- Admin UI: GrantEventRewardModal 리팩터링
- manual-reward-options에 userId 쿼리 추가 (isGranted 포함)
- FEEDBACK/CS 이벤트 seed 마이그레이션 추가

* docs: API.md 제거된 엔드포인트 반영 (#319)

- POST /admin/api/tickets/grant 제거 반영
- GET /admin/api/tickets/history 제거 반영
- GET /admin/api/events/manual-reward-options 문서 추가

* refactor: createNotice 체크박스 제거, 항상 notice 생성 (#319)

- Admin UI: 보상 안내 모달 체크박스 제거 → 항상 생성
- AdminGrantRewardReqDTO: createNotice 필드 제거
- buildNoticeFromEvent: createNotice 파라미터 제거

* fix: 이벤트 옵션 로드 실패 시 에러 메시지 표시 (#319)

---------

Co-authored-by: 김덕환 <sachi009955@gmail.com>
IISweetHeartII added a commit that referenced this pull request Mar 10, 2026
* Fix: 포트폴리오 내용 글자수 임시 변경 (#313)

* Fix: rag 요청 실패 시 fallback 로직 추가 (#312)

* fix: rag 생성 실패 시 fallback 코드 추가

- rag 생성 호출이 실패하면 상태를 failed로 바꾼다.

* fix: AI 서버 스펙 변경에 맞춰 API 스펙 수정 및 엔티티 마이그레이션

- 누락된 failed enum을 추가
- 첨삭 총평 필드를 correction_item에서 제거하고 portfolio-correction에 추가

* feat: correctionStatus enum 상태 다양화

- rag가 실패한 경우와 첨삭이 실패한 경우를 분리하기 위해 enum 상태를 추가함.

* refactor: try/catch 구문을 사용해 오류 처리 로직 개선

- async/await 비동기 오류 처리로 오류 처리 로직을 더 명확하고 읽기 쉽게 개선

* fix: createdAt 시간 오류 해결 (#315)

* Fix: 인사이트로그 시간 에러 해결 (#317)

- 채팅 멘션 주석처리

* Fix: 시간 UTC로 롤백 (#318)

* Refactor: Admin 이벤트 보상 시스템 단순화 및 레거시 정리 (#319) (#320)

* refactor: Admin 이벤트 보상 시스템 단순화 및 레거시 정리 (#319)

- Notice 수동 입력 필드 제거, event DB 값 기반 자동 구성
- CS 이벤트 다중 지급 지원 (allowMultipleRewards)
- CS 커스텀 이용권 선택 (customRewards DTO 추가)
- 어드민 이벤트 드롭다운 기간 필터 제거
- CTA 자동 매핑 (보상 종류 기반)
- POST /admin/api/tickets/grant API 제거 (CS 이벤트로 통합)
- GET /admin/api/tickets/history API 제거 (ticket-grants로 통합)
- Admin UI: 이용권 거래 내역 탭/이용권 지급 버튼 제거
- Admin UI: GrantEventRewardModal 리팩터링
- manual-reward-options에 userId 쿼리 추가 (isGranted 포함)
- FEEDBACK/CS 이벤트 seed 마이그레이션 추가

* docs: API.md 제거된 엔드포인트 반영 (#319)

- POST /admin/api/tickets/grant 제거 반영
- GET /admin/api/tickets/history 제거 반영
- GET /admin/api/events/manual-reward-options 문서 추가

* refactor: createNotice 체크박스 제거, 항상 notice 생성 (#319)

- Admin UI: 보상 안내 모달 체크박스 제거 → 항상 생성
- AdminGrantRewardReqDTO: createNotice 필드 제거
- buildNoticeFromEvent: createNotice 파라미터 제거

* fix: 이벤트 옵션 로드 실패 시 에러 메시지 표시 (#319)

---------

Co-authored-by: 강효인 <hyoin1704@gmail.com>
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.

[Refactor] Admin/Event 이벤트 보상 시스템 단순화 및 레거시 정리

1 participant