Skip to content

[Feature/promotion-code] 프로모션 코드 다중 프로그램 지원 및 예약 결제 할인 표시 정리#197

Merged
Yunil-dev merged 2 commits intodevelopfrom
feature/promotion-code
May 6, 2026
Merged

[Feature/promotion-code] 프로모션 코드 다중 프로그램 지원 및 예약 결제 할인 표시 정리#197
Yunil-dev merged 2 commits intodevelopfrom
feature/promotion-code

Conversation

@Yunil-dev
Copy link
Copy Markdown
Contributor

📝 관련 문서 레퍼런스

- [Issue] : #196 
- [Slack] : 
- [Notion] : 

💻 주요 변경 사항은 무엇인가요?

- 인플루언서 생성/수정 요청을 `influencer_name` 단일 입력 구조로 변경
- 프로모션 코드 생성/수정 요청에 `program_ids` 다중 프로그램 연결 지원 추가
- 어드민 인플루언서 목록/프로모션 코드 목록을 `program_ids` 기준으로 표시하도록 수정
- 어드민 프로모션 코드 입력 UI에서 여러 프로그램 ID 입력 및 미리보기 지원 추가
- 프로그램 상세 조회를 사용해 프로그램 ID 옆에 프로그램명 표시 추가
- 프로모션 검증 응답에 `rate` 필드 반영
- 예약 페이지에서 프로모션 코드 검증 시 즉시 적용되도록 수정
- `Do not use` 선택 시 프로모션 해제, `Validated Code` 재선택 시 재적용되도록 수정
- 예약 결제 금액 영역에서 기존 할인과 프로모션 할인 동시 노출 방식 정리
- 중복 할인 시 `Original Price / Discount Amount / Promotion Discount / Final Payment Amount` 구성으로 표시되도록 수정



📚 추가된 라이브러리

- [추가] : NO

📱 결과 화면 (선택)


🙇 코드 리뷰 중점사항, 예상되는 문제점 (선택)

- 인플루언서 생성 시 이름만 입력되는지
- 프로모션 코드 생성/수정 시 여러 프로그램 ID 연결이 가능한지
- 인플루언서/프로모션 코드 목록에서 연결 프로그램이 정상 표시되는지
- 예약 페이지에서 프로모션 검증 후 즉시 적용되는지
- `Do not use` 선택 시 할인 해제, `Validated Code` 재선택 시 재적용되는지
- 우주연 한의원/더게이트 스파처럼 기존 할인과 프로모션 할인이 함께 있을 때 결제 금액 표시가 의도대로 노출되는지

@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

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

Project Deployment Actions Updated (UTC)
meditrip-web Ready Ready Preview, Comment May 6, 2026 3:40pm

Request Review

@Yunil-dev Yunil-dev self-assigned this May 6, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ec4f9519-8790-4de7-8120-bddafaa4ae9c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/promotion-code

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.

@Yunil-dev Yunil-dev merged commit 359dad4 into develop May 6, 2026
4 checks passed
Copy link
Copy Markdown

@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 introduces support for multiple program IDs for influencers and promotion codes, updating the admin UI to manage these associations and refining the reservation summary logic to correctly calculate and display promotion discounts. The reviewer recommends simplifying the paymentAmountText logic, extracting currency-specific discount calculations into a shared utility function to improve maintainability, and debouncing the program ID input in the admin panel to enhance performance.

I am having trouble creating individual review comments. Click here to see my feedback.

src/pages/reservations/index.tsx (1002-1006)

medium

The logic for paymentAmountText can be simplified. Since baseSummaryPrice.originalPriceText already represents the program's price before any base discounts (or the regular price if no base discount exists), and appliedPromotion.originalPrice should match the program's regular price when there is no base discount, baseSummaryPrice.originalPriceText can be used directly in all cases.

  const paymentAmountText = baseSummaryPrice.originalPriceText;

src/pages/reservations/index.tsx (993-997)

medium

The logic for calculating the discount amount based on currency (rounding for KRW vs. 2 decimal places for USD) is duplicated here and likely in other parts of the application (like the verifiedPromotionDiscountAmount calculation). Consider creating a shared utility function for this calculation to ensure consistency and improve maintainability.

src/pages/admin/influencers/index.tsx (115-128)

medium

The uniqueProgramIds calculation and subsequent programQueries will re-run on every keystroke as the user types in the program_ids_input field. While React Query's caching helps, this still causes unnecessary re-renders and array mapping. Consider debouncing the promoForm.program_ids_input value before using it to derive uniqueProgramIds to improve performance during input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant