Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR extends the admin panel with two independent feature enhancements: user acquisition metadata (referral source, signup platform) displayed across admin users management with Excel export; and reservation promotion details visible in the admin reservations page. Additionally, reservation completion email notices are updated with clearer 24-hour delivery expectations. ChangesUser Acquisition and Signup Metadata Display
Reservation Promotion Display and Completion Email
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/models/admin/index.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. src/models/reservation/index.tsESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox. src/pages/admin/reservations/index.tsxESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds referral source and signup platform information to the admin user list, including UI display and Excel export functionality. It also introduces promotion code and discount rate details to the admin reservation view, alongside updated localization messages. Regarding the feedback, a potential bug was identified in the formatPromotionRate helper, where using a heuristic (value <= 1) to handle both decimal and integer percentages could lead to severe data distortion (e.g., displaying a 1% discount as 100%). It is recommended to clarify the API's data format and apply a single, consistent formatting logic.
| const formatPromotionRate = (value?: number | null) => { | ||
| if (typeof value !== 'number' || !Number.isFinite(value)) return '-'; | ||
|
|
||
| if (value <= 1) { | ||
| return new Intl.NumberFormat('ko-KR', { | ||
| style: 'percent', | ||
| maximumFractionDigits: 1, | ||
| }).format(value); | ||
| } | ||
|
|
||
| return `${value}%`; | ||
| }; |
There was a problem hiding this comment.
value <= 1 조건으로 소수점 비율(예: 0.1 -> 10%)과 정수 비율(예: 10 -> 10%)을 동시에 지원하려는 휴리스틱은 버그를 유발할 가능성이 높습니다.\n\n만약 API가 정수 비율(0100)을 반환하고 실제 할인율이 1)인지, 아니면 항상 정수 형태(0~100)인지 데이터 포맷을 명확히 정의하고 하나의 방식으로만 포맷팅하도록 수정하는 것을 권장합니다.1% 또는 0.5%인 경우, value <= 1 조건에 걸려 각각 100%, 50%로 잘못 표기되는 심각한 데이터 왜곡이 발생할 수 있습니다.\n\npromotion_code_rate가 항상 소수점 형태(0
📝 관련 문서 레퍼런스
💻 주요 변경 사항은 무엇인가요?
📚 추가된 라이브러리
📱 결과 화면 (선택)
🙇 코드 리뷰 중점사항, 예상되는 문제점 (선택)
Summary by CodeRabbit
Release Notes
New Features
Documentation