Skip to content

[Release] develop -> main#198

Merged
Yunil-dev merged 2 commits intomainfrom
develop
May 6, 2026
Merged

[Release] develop -> main#198
Yunil-dev merged 2 commits intomainfrom
develop

Conversation

@Yunil-dev
Copy link
Copy Markdown
Contributor

@Yunil-dev Yunil-dev commented May 6, 2026

📝 관련 문서 레퍼런스

- [Issue] : 
- [Slack] : 
- [Notion] : 

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

-

📚 추가된 라이브러리

- [추가] : YES | NO

📱 결과 화면 (선택)


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

-

Summary by CodeRabbit

  • New Features

    • Added WOOJOOYON CLINIC with comprehensive program information, details, and imagery across multiple languages.
    • Enhanced reservation payment display with separate "Discounted Price" and "Promotion Discount" labels.
    • Improved promotion system to show discount rates and support multi-program associations in admin management.
  • Style

    • Added new visual styling for clinic programs and story elements.
  • Refactor

    • Streamlined promotion validation and application flow in reservations.

@Yunil-dev Yunil-dev self-assigned this May 6, 2026
@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:44pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

This 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.

Changes

WooJooYon Company Integration

Layer / File(s) Summary
Localization Data
messages/en/company-detail.json, messages/ja/company-detail.json, messages/ko/company-detail.json
Added wooJooYon top-level blocks with comprehensive clinic metadata, program descriptions, hanok/traditional medicine sections, and image alt text in three languages.
Localization (Reservation)
messages/en/reservation.json, messages/ja/reservation.json, messages/ko/reservation.json
Added discountedPaymentAmount and promotionDiscountLabel keys to the payment section across all languages.
Company Detection
src/utils/the-gate-spa-discount.ts
Introduced hasCompanyIdentifier helper and new isWooJooYonCompany selector to detect WooJooYon by name or code. Refactored isTheGateSpaCompany to use the shared helper.
Component Styling
src/components/company-detail/company-info/index.styles.ts
Added seven new style exports for story elements (storyTextStack, storyExternalLink, storyProgramList, storyProgramItem, storyProgramName, storyProgramImageGrid, storyProgramImage). Adjusted theGateSpaFeatureCopy gap to 6px.
Component Rendering
src/components/company-detail/company-info/index.tsx
Added WooJooYonStory component with image assets, program features, and translated sections. Extended CompanyInfo to render WooJooYon when detected, falling back to The Gate Spa or editor content. Introduced CompanyStory wrapper for reusable story rendering.

Promotion Discount Rate System

Layer / File(s) Summary
Data Models
src/models/admin/index.ts, src/models/payment/index.ts
Extended AdminPromotionCode, AdminInfluencer, and related request types to support program_ids: number[] (multi-program). Added rate: number to PostValidatePromotionResponse and admin promotion request types. Added optional timestamps to admin models.
Promotion Hook
src/hooks/reservation/use-promotion.ts
Added rate: number field to VerifiedPromotion interface. Merged handleApply logic into handleSelectVerified. Updated validation flow to apply and show promotion-applied toast immediately. Removed handleApply from public API.
Admin Influencer Management
src/pages/admin/influencers/index.tsx
Refactored influencer form to remove program_id field. Introduced program_ids_input for promotion codes to link multiple programs. Added parseProgramIds parser, formatPromotionRate and formatProgramLabel helpers. Orchestrated program detail fetching via useQueries. Updated UI to display programs as chips instead of single ID. Changed table headers to "연결 프로그램".
Reservation Display
src/pages/reservations/index.tsx
Reworked pricing summary to be promotion-aware: introduced appliedPromotion and baseSummaryPrice. Added derived metrics (appliedPromotionDiscountAmount, appliedPromotionDiscountText, overallHasDiscount) to drive discount line and final price display. Removed promotion apply CTA from promotion options. Updated price rendering to show original amount with strikethrough and discounted amount when promotions apply.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

✨ feature, 🎨 UI, 🌍 i18n

Poem

A second clinic joins the fray,
With programs linked in every way,
Rates now parsed and discounts shown,
The reservation dance has grown! 🏥✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title '[Release] develop -> main' is generic and does not describe the actual changes in the PR. It only indicates a branch merge without conveying what features or fixes are included. Provide a more descriptive title summarizing the main changes, such as '[Release] Add WooJooYon clinic profile and promotion discount support' or similar.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

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 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)

medium

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)

medium

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)

medium

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.

@Yunil-dev Yunil-dev merged commit f3ef693 into main May 6, 2026
5 checks passed
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