Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughThis PR introduces WooJooYon Clinic as a second company profile alongside The Gate Spa, with localized content in three languages, new UI styling, and company-specific rendering. It also refactors promotion discount handling to support discount rates and multi-program associations in admin and reservation flows. ChangesWooJooYon Company Integration
Promotion Discount Rate System
Sequence DiagramsequenceDiagram
participant User as User
participant AdminUI as Admin UI
participant PromotionAPI as Promotion API
participant ReservationUI as Reservation UI
participant PaymentAPI as Payment API
User->>AdminUI: Create/Update promo with program_ids
AdminUI->>AdminUI: Parse program_ids, fetch program details
AdminUI->>PromotionAPI: POST/PUT promo (program_ids, rate)
PromotionAPI-->>AdminUI: Success with promo ID
User->>ReservationUI: Select program & enter promo code
ReservationUI->>PaymentAPI: Validate promo code
PaymentAPI-->>ReservationUI: Return rate, final_price
ReservationUI->>ReservationUI: Calculate discount<br/>(final_price - base_price)
ReservationUI->>User: Display original + discounted price
User->>ReservationUI: Confirm checkout
ReservationUI->>User: Show promotion applied toast
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 introduces the WooJooYon Clinic detail page by refactoring the existing story logic into a reusable component and adding localized content for multiple languages. It also enhances the promotion system to support multiple program IDs per influencer and simplifies the promotion application process on the reservation page. The admin dashboard for influencers was updated to manage these multi-program associations with improved UI components. Feedback suggests using stricter parsing for program IDs in the admin panel, refactoring duplicated discount calculation logic into a utility, and addressing a fragile dependency between localized program items and static image arrays.
I am having trouble creating individual review comments. Click here to see my feedback.
src/pages/admin/influencers/index.tsx (71-83)
The parseProgramIds function uses Number.parseInt which is lenient and will parse strings like "123abc" as 123. For program IDs, it is safer to use a stricter conversion to ensure the entire token is a valid integer.
const parseProgramIds = (value: string) => {
const seen = new Set<number>();
return value
.split(/[\s,]+/)
.map((token) => {
const trimmed = token.trim();
return trimmed === '' ? NaN : Number(trimmed);
})
.filter((id) => Number.isInteger(id) && id > 0)
.filter((id) => {
if (seen.has(id)) return false;
seen.add(id);
return true;
});
};
src/pages/reservations/index.tsx (993-997)
The logic for calculating the discount amount is duplicated for both appliedPromotionDiscountAmount and verifiedPromotionDiscountAmount. Consider extracting this into a small utility function to improve maintainability and ensure consistent rounding/precision logic across the reservation flow.
src/components/company-detail/company-info/index.tsx (400-436)
The WooJooYonStory component maps program images from a static array WOO_JOO_YON_PROGRAM_IMAGES using the index of programItems from the i18n JSON. This creates a fragile dependency where the order and count of items in the JSON must perfectly match the static image array. If they get out of sync, the wrong images will be displayed for the programs.
📝 관련 문서 레퍼런스
💻 주요 변경 사항은 무엇인가요?
📚 추가된 라이브러리
📱 결과 화면 (선택)
🙇 코드 리뷰 중점사항, 예상되는 문제점 (선택)
Summary by CodeRabbit
New Features
Style
Refactor