Skip to content

feat: 결제 페이지 옵션 응답 API 연동#141

Merged
hyeeuncho merged 7 commits intodevelopfrom
feat/#129/payment-response-api
May 25, 2025
Merged

feat: 결제 페이지 옵션 응답 API 연동#141
hyeeuncho merged 7 commits intodevelopfrom
feat/#129/payment-response-api

Conversation

@hyeeuncho
Copy link
Copy Markdown
Member

@hyeeuncho hyeeuncho commented May 25, 2025

스크린샷 2025-05-25 오후 7 50 12

Summary by CodeRabbit

  • 신규 기능

    • 티켓 옵션 및 주문 관련 API와 React 훅이 추가되어, 티켓 옵션 조회 및 답변 제출, 티켓 주문/취소, 주문 상세 조회가 가능해졌습니다.
    • 티켓 옵션 선택 화면이 동적으로 옵션을 불러오고, 선택 결과를 제출해 주문까지 이어지는 흐름이 제공됩니다.
  • 기능 개선

    • 티켓 옵션 선택 및 제출 로직이 개선되어, 옵션 ID 기반의 관리와 다양한 답변 타입(텍스트, 단일/복수 선택)이 지원됩니다.
    • 티켓 확인 및 주문 페이지가 비동기 데이터와 에러/로딩 상태를 명확히 안내하도록 개선되었습니다.
    • 이메일 편집 시 예약 시간 필드가 제거되고, 티켓 관련 정보 반영이 강화되었습니다.
    • 티켓 옵션 레이아웃에서 실제 티켓 정보가 동적으로 표시되고, 옵션 답변 제출 후 주문 처리 흐름이 개선되었습니다.
    • 구매 배너에서 시작 시간이 제거되고, 시작일시에서 날짜와 시간이 분리되어 표시됩니다.
    • 티켓 주문 시 API 호출 대신 티켓 옵션 응답 페이지로 직접 이동하도록 변경되었습니다.
  • 버그 수정

    • 인증 콜백 처리 시 모달이 정상적으로 닫히도록 개선되었습니다.
  • 리팩터

    • 여러 컴포넌트가 내부 상태 관리 및 API 호출 방식을 React Query 기반의 훅으로 전환하여 코드 일관성과 유지보수성이 향상되었습니다.
    • 일부 데이터 모델 및 스토어 구조가 실제 사용 흐름에 맞게 정비되었습니다.
    • 티켓 옵션 선택 상태 관리가 문자열 키에서 숫자 ID 기반으로 변경되었습니다.
  • 문서 및 타입

    • 티켓 및 주문 관련 데이터 구조와 API 요청/응답 타입이 명확히 정의되었습니다.
    • 이메일 관련 타입에서 예약 시간 필드가 제거되었습니다.

@hyeeuncho hyeeuncho linked an issue May 25, 2025 that may be closed by this pull request
3 tasks
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented May 25, 2025

Walkthrough

이 변경사항은 티켓 옵션, 주문, 응답 관련 데이터 모델 및 API, React 훅, UI 컴포넌트 전반에 걸쳐 새로운 타입 시스템과 데이터 흐름을 도입합니다. 티켓 옵션 및 주문 처리 로직이 통합되고, 선택/응답 방식이 ID 기반으로 일원화되었으며, 여러 컴포넌트가 새로운 비동기 훅과 데이터 구조를 사용하도록 리팩토링되었습니다.

Changes

파일/경로 요약 변경 내용 요약
.../model/ticketInformation.ts
.../model/orderInformation.ts
티켓 생성, 조회, 옵션, 응답, 주문, 확인 관련 새 TypeScript 인터페이스 추가
.../model/store/TicketOptionStore.tsx TOption 인터페이스 제거, selectedOptions 구조를 optionId 기반으로 변경, setOption 시그니처 변경 및 resetOptions 메서드 추가
.../api/ticket.ts TicketOption 관련 데이터 모델 import 경로 수정, deleteTicket 포맷 변경, readTicketOptions 및 createTicketOptionAnswers API 함수 추가
.../hooks/useTicketHook.ts useTicketOptions, useCreateTicketOptionAnswers 두 개의 새 React Query 훅 추가
.../hooks/useOrderHook.ts 티켓 주문, 상세조회, 취소, 구매용 React Query 훅 4종 새로 추가
.../api/order.ts OrderTicketRequest import 경로 변경(../model/order → ../model/orderInformation)
.../ui/TicketOption.tsx 옵션 prop 타입 TicketOptionResponse로 변경, 내부 상태 및 렌더링 로직 optionId 기반으로 리팩토링
.../ui/ticket/TicketOptionResponsePage.tsx 정적 옵션 import 제거, useTicketOptions 훅으로 옵션 비동기 fetch, 로딩/에러 처리 UI 추가
.../ui/ticket/TIcketConfirmPage.tsx 수동 fetch/state 제거, useTicketOrderDetail 및 useCancelTicket 훅 사용, 로딩/에러 명시적 처리, 데이터 구조 변경 반영
.../ui/backgrounds/TicketOptionLayout.tsx ticketInfo prop 추가, 동적 티켓 정보 fetch, 옵션 응답 제출 및 주문 통합, resetOptions 사용, 네비게이션 로직 개선
.../ui/mail/EmailEditPage.tsx reservationTime 제거, ticketId/targetType 추가, emailData 타입 명시, TimePicker 핸들러 단일화
.../ui/ticket/PurchaseBanner.tsx startTime prop 제거, startDate만 사용, 날짜/시간 포맷 유틸 적용, 인터페이스 및 파라미터 변경
.../ui/TicketInfo.tsx orderTickets API 호출 제거, 네비게이션만 수행하도록 변경
.../model/email.ts ReadEmailResponse에서 reservationTime 필드 제거
.../AuthCallback.tsx handleAuth 내 closeModal() 호출 추가, useAuthStore에서 closeModal 추출 및 의존성 배열 반영

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TicketInfo
    participant Router
    participant TicketOptionResponsePage
    participant useTicketOptions
    participant TicketOption
    participant TicketOptionLayout
    participant useCreateTicketOptionAnswers
    participant useOrderTicket
    participant ConfirmPage

    User->>TicketInfo: "구매하기" 클릭
    TicketInfo->>Router: /payment/ticket-option-response로 이동 (ticketId 등 state 전달)
    Router->>TicketOptionResponsePage: ticketId, eventId, ticketCnt 전달
    TicketOptionResponsePage->>useTicketOptions: 옵션 데이터 fetch
    useTicketOptions-->>TicketOptionResponsePage: 옵션 데이터 반환
    TicketOptionResponsePage->>TicketOption: 옵션 데이터 렌더링
    TicketOption->>TicketOptionLayout: 옵션 선택값 저장
    User->>TicketOptionLayout: 옵션 입력 후 "다음"/"제출" 클릭
    TicketOptionLayout->>useCreateTicketOptionAnswers: 옵션 응답 제출 (반복)
    useCreateTicketOptionAnswers-->>TicketOptionLayout: 성공/실패 응답
    TicketOptionLayout->>useOrderTicket: 주문 요청
    useOrderTicket-->>TicketOptionLayout: 주문 결과 반환
    TicketOptionLayout->>Router: /dashboard/ticket/confirm로 이동 (주문 정보 전달)
    Router->>ConfirmPage: 주문 확인 페이지 렌더링
Loading

Poem

토끼는 깡총, 코드를 바꿨어요
옵션은 숫자로, 주문은 더 똑똑하게
새 훅과 타입이 춤을 추고
티켓의 여정이 매끄럽게 이어지네
깡총깡총, 새로운 흐름 속
버그는 멀리, 기능은 가까이!
🐰✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e92528d and 78027f8.

📒 Files selected for processing (1)
  • src/features/ticket/model/ticketInformation.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/features/ticket/model/ticketInformation.ts
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (6)
src/features/ticket/api/ticket.ts (1)

26-29: 매개변수 명명과 타입 일관성 검토 필요

함수명과 매개변수명 사이에 불일치가 있습니다. 함수명 createTicketOptionAnswers는 복수형이지만 매개변수 타입 TicketOptionAnswerRequest는 단수형입니다.

다음 중 하나를 고려해보세요:

-export const createTicketOptionAnswers = async (answers: TicketOptionAnswerRequest) => {
+export const createTicketOptionAnswers = async (answer: TicketOptionAnswerRequest) => {

또는 실제로 여러 답변을 처리한다면:

-export const createTicketOptionAnswers = async (answers: TicketOptionAnswerRequest) => {
+export const createTicketOptionAnswers = async (answers: TicketOptionAnswerRequest[]) => {
src/features/ticket/hooks/useTicketHook.ts (1)

47-57: 성공 처리 일관성 개선 필요

다른 훅들은 성공 시 alert를 사용하는데, 이 훅만 console.log를 사용하고 있어 일관성이 부족합니다.

일관성을 위해 다음과 같이 수정하는 것을 고려해보세요:

        onSuccess: () => {
-            console.log("티켓 옵션 응답 전송 성공");
+            alert("티켓 옵션 응답이 성공적으로 전송되었습니다.");
        },

또는 사용자 경험을 고려해 성공 메시지 없이 조용히 처리하는 것도 좋은 선택입니다.

src/widgets/event/ui/TicketInfo.tsx (1)

36-40: 로직 분리를 통한 관심사 분리 개선

복잡한 주문 API 호출 로직을 제거하고 전용 페이지로 네비게이션하는 방식으로 변경한 것이 좋습니다. 코드가 더 간결해지고 각 컴포넌트의 책임이 명확해졌습니다.

주석을 더 구체적으로 작성하면 도움이 될 것 같습니다:

-  // 티켓 옵션 응답 페이지 이동.
+  // 티켓 옵션 선택을 위해 전용 페이지로 이동하고 필요한 정보를 state로 전달
src/features/ticket/hooks/useOrderHook.ts (1)

26-31: 알림 시스템 개선을 권장합니다.

alert() 함수 대신 토스트 알림이나 모달 등 더 나은 사용자 경험을 제공하는 알림 시스템 사용을 고려해보세요.

-        onSuccess: () => {
-            alert('티켓이 성공적으로 취소되었습니다.');
-        },
-        onError: () => {
-            alert('티켓 취소에 실패하였습니다.');
-        },
+        onSuccess: () => {
+            // 토스트 알림 시스템 사용 권장
+            showSuccessToast('티켓이 성공적으로 취소되었습니다.');
+        },
+        onError: (error) => {
+            // 에러 상세 정보와 함께 알림
+            showErrorToast('티켓 취소에 실패하였습니다.');
+        },
src/features/payment/ui/TicketOption.tsx (2)

29-29: 개발용 console.log 제거가 필요합니다.

프로덕션 코드에서는 디버깅용 console.log를 제거해야 합니다.

-    console.log(selectedOptions)

14-14: 타입 안전성 개선을 권장합니다.

하드코딩된 문자열 대신 enum이나 상수를 사용하여 타입 안전성을 높이는 것이 좋겠습니다.

-  const handleChange = (
-    type: "text" | "single" | "multiple",
-    optionId: number,
-    value: string | number
-  ) => {
+  const handleChange = (
+    type: TicketOptionResponse['type'] | 'text' | 'single' | 'multiple',
+    optionId: number,
+    value: string | number
+  ) => {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 265e48d and 174715f.

📒 Files selected for processing (17)
  • src/features/dashboard/model/TicketOptionStore.tsx (1 hunks)
  • src/features/dashboard/model/emailInformation.ts (0 hunks)
  • src/features/payment/ui/TicketOption.tsx (1 hunks)
  • src/features/ticket/api/order.ts (1 hunks)
  • src/features/ticket/api/ticket.ts (2 hunks)
  • src/features/ticket/hooks/useOrderHook.ts (1 hunks)
  • src/features/ticket/hooks/useTicketHook.ts (2 hunks)
  • src/features/ticket/model/OrderCreation.ts (0 hunks)
  • src/features/ticket/model/orderInformation.ts (1 hunks)
  • src/features/ticket/model/ticketInformation.ts (1 hunks)
  • src/pages/dashboard/ui/mail/EmailEditPage.tsx (3 hunks)
  • src/pages/dashboard/ui/ticket/TIcketConfirmPage.tsx (3 hunks)
  • src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (1 hunks)
  • src/pages/join/AuthCallback.tsx (1 hunks)
  • src/shared/ui/backgrounds/TicketOptionLayout.tsx (3 hunks)
  • src/widgets/dashboard/ui/TicketConfirmPage/PurchaseBanner.tsx (2 hunks)
  • src/widgets/event/ui/TicketInfo.tsx (1 hunks)
💤 Files with no reviewable changes (2)
  • src/features/dashboard/model/emailInformation.ts
  • src/features/ticket/model/OrderCreation.ts
🧰 Additional context used
🧬 Code Graph Analysis (8)
src/features/ticket/api/ticket.ts (2)
src/features/ticket/model/ticketInformation.ts (2)
  • TicketOptionResponse (33-40)
  • TicketOptionAnswerRequest (55-59)
src/shared/types/api/http-client.ts (1)
  • axiosClient (6-13)
src/widgets/dashboard/ui/TicketConfirmPage/PurchaseBanner.tsx (1)
src/shared/lib/date.ts (2)
  • formatDate (1-9)
  • formatTime (10-15)
src/pages/join/AuthCallback.tsx (2)
src/app/provider/authStore.ts (1)
  • useAuthStore (17-33)
src/features/join/hooks/useUserHook.ts (1)
  • useUserInfo (5-10)
src/features/ticket/hooks/useTicketHook.ts (2)
src/features/ticket/model/ticketInformation.ts (3)
  • TicketOptionResponse (33-40)
  • TicketResponse (14-19)
  • TicketOptionAnswerRequest (55-59)
src/features/ticket/api/ticket.ts (2)
  • readTicketOptions (21-24)
  • createTicketOptionAnswers (26-29)
src/pages/dashboard/ui/mail/EmailEditPage.tsx (2)
src/features/dashboard/model/EmailStore.tsx (1)
  • useEmailStore (21-46)
src/features/dashboard/model/emailInformation.ts (1)
  • EmailRequest (1-9)
src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (1)
src/features/ticket/hooks/useTicketHook.ts (1)
  • useTicketOptions (39-45)
src/features/ticket/hooks/useOrderHook.ts (2)
src/features/ticket/api/order.ts (3)
  • readTicket (4-19)
  • cancelTickets (28-31)
  • orderTickets (22-25)
src/features/ticket/model/orderInformation.ts (1)
  • OrderTicketRequest (1-5)
src/pages/dashboard/ui/ticket/TIcketConfirmPage.tsx (2)
src/features/ticket/hooks/useOrderHook.ts (2)
  • useTicketOrderDetail (14-20)
  • useCancelTicket (23-33)
src/features/ticket/model/orderInformation.ts (1)
  • TicketConfirm (6-19)
🔇 Additional comments (32)
src/features/ticket/api/order.ts (1)

2-2:

Details

✅ Verification successful

import 경로 변경이 올바르게 적용되었습니다.

모델 파일 재구성에 따른 import 경로 변경이 정확하게 반영되었습니다. OrderTicketRequest 타입이 orderInformation 모듈로 이동된 것과 일치합니다.

다른 파일들에서도 동일한 타입을 사용하는 곳이 있는지 확인해보겠습니다:


🏁 Script executed:

#!/bin/bash
# 설명: OrderTicketRequest 타입 사용 현황 확인
# 예상 결과: 모든 import가 새로운 경로로 업데이트되었는지 확인

rg -A 3 "OrderTicketRequest" --type ts --type tsx

Length of output: 77


다른 파일에서도 OrderTicketRequest 사용 여부를 정확히 확인하기 위해 검색 스크립트를 수정합니다.


🏁 Script executed:

#!/bin/bash
# OrderTicketRequest 타입 사용 현황 확인 (모든 .ts, .tsx 파일 대상)
rg -A 3 "OrderTicketRequest" -g '*.ts' -g '*.tsx'

Length of output: 2273


OrderTicketRequest import 경로 일관성 확인 완료

다음 파일들에서 모두 OrderTicketRequestmodel/orderInformation 모듈로부터 import 되고 있음을 확인했습니다:

  • src/shared/ui/backgrounds/TicketOptionLayout.tsx
  • src/features/ticket/hooks/useOrderHook.ts
  • src/features/ticket/api/order.ts

변경사항을 승인합니다.

src/pages/join/AuthCallback.tsx (1)

10-10: 모달 상태 관리 함수가 올바르게 추가되었습니다.

closeModal 함수가 useAuthStore에서 정확하게 구조분해할당으로 추가되었습니다.

src/pages/dashboard/ui/mail/EmailEditPage.tsx (5)

11-11: 타입 안전성을 위한 import가 적절히 추가되었습니다.

EmailRequest 타입을 명시적으로 import하여 타입 안전성을 향상시켰습니다.


25-26: 새로운 상태 변수들이 올바르게 추가되었습니다.

ticketIdtargetType 상태 변수들이 이메일 타겟팅 기능을 위해 적절히 추가되었습니다.


31-31: 명시적 타입 지정으로 타입 안전성이 개선되었습니다.

emailData 객체에 EmailRequest 타입을 명시적으로 지정하여 컴파일 타임 타입 검사를 강화했습니다.


39-41: 조건부 티켓 ID 할당 로직이 올바르게 구현되었습니다.

targetType'TICKET'일 때만 ticketId를 포함하는 조건부 로직이 적절하게 구현되었습니다. 이는 불필요한 데이터 전송을 방지하고 API 요구사항에 맞춘 구현입니다.


56-56: TimePicker onChange 핸들러가 효율적으로 개선되었습니다.

이전의 별도 핸들러들을 단일 onChange 핸들러로 통합하여 코드가 간소화되었습니다. ISO 문자열을 직접 설정하는 방식이 더 명확합니다.

src/widgets/dashboard/ui/TicketConfirmPage/PurchaseBanner.tsx (3)

4-4: 유틸리티 함수 import로 코드 재사용성이 향상되었습니다.

shared 라이브러리의 formatDateformatTime 유틸리티 함수를 사용하여 날짜/시간 포맷팅 로직을 중앙화했습니다. 이는 코드 재사용성과 일관성을 크게 향상시킵니다.


13-13: 컴포넌트 인터페이스가 효율적으로 단순화되었습니다.

별도의 startTime prop을 제거하고 startDate 하나로 통합한 것은 데이터 모델의 단순화와 일치하는 좋은 개선입니다. 단일 소스에서 날짜와 시간을 모두 관리하는 것이 더 일관성 있습니다.


32-32: 날짜/시간 포맷팅이 올바르게 구현되었습니다.

formatDateformatTime 함수를 사용하여 단일 startDate에서 날짜와 시간을 각각 추출하여 표시하는 로직이 정확하게 구현되었습니다.

src/features/ticket/api/ticket.ts (2)

2-2: API 타입 임포트 추가 확인됨

새로운 티켓 옵션 관련 타입들이 올바르게 임포트되었습니다.


21-24: API 함수 구현이 올바릅니다

readTicketOptions 함수가 올바르게 구현되었습니다. 엔드포인트 경로와 반환 타입이 적절합니다.

src/features/ticket/hooks/useTicketHook.ts (2)

2-3: 새로운 API 함수와 타입 임포트 확인됨

새로운 훅에 필요한 API 함수들과 타입들이 올바르게 임포트되었습니다.


39-45: useTicketOptions 훅 구현이 우수합니다

React Query 패턴을 올바르게 따르고 있으며, enabled 조건으로 유효한 ticketId가 있을 때만 쿼리를 실행하도록 구현되어 있습니다.

src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (2)

11-12: 로딩 및 오류 상태 처리 확인됨

로딩 상태와 데이터 성공 여부를 적절히 확인하고 있습니다. 사용자에게 명확한 피드백을 제공합니다.


15-16: 컴포넌트 props 전달 구조 확인됨

TicketOptionLayoutTicketOption 컴포넌트에 필요한 데이터를 올바르게 전달하고 있습니다.

src/features/ticket/model/orderInformation.ts (1)

1-19: 인터페이스 정의가 잘 구성되어 있습니다.

주문 요청과 티켓 확인을 위한 인터페이스가 명확하게 분리되어 있고, 타입 정의도 적절합니다. orderStatus의 유니온 타입도 올바르게 제한되어 있습니다.

src/features/ticket/hooks/useOrderHook.ts (2)

1-11: React Query 훅 구현이 적절합니다.

쿼리 키 구조와 페이지네이션 처리가 올바르게 구현되어 있습니다.


14-20: enabled 조건 처리가 우수합니다.

!!ticketId && !!eventId 조건으로 불필요한 API 호출을 방지하는 것이 좋은 접근입니다.

src/features/payment/ui/TicketOption.tsx (3)

13-30: 옵션 타입 처리 로직이 잘 구현되어 있습니다.

텍스트, 단일 선택, 다중 선택 옵션에 대한 처리가 올바르게 구현되어 있습니다. 숫자 ID 기반으로 변경된 것도 적절합니다.


41-51: 입력 필드 구현이 적절합니다.

텍스트 입력 옵션의 처리가 올바르게 구현되어 있습니다.


53-75: 체크박스 옵션 처리가 올바릅니다.

단일 선택과 다중 선택 옵션 모두 적절하게 구현되어 있으며, 배열 상태 관리도 정확합니다.

src/features/ticket/model/ticketInformation.ts (2)

29-40: 티켓 옵션 인터페이스가 잘 설계되어 있습니다.

TicketOptionChoiceTicketOptionResponse 인터페이스가 명확하게 분리되어 있고, 옵션 타입의 유니온 타입도 적절합니다.


43-59: 옵션 응답 인터페이스 구조가 우수합니다.

텍스트와 선택지 응답을 별도 인터페이스로 분리하고, 통합 인터페이스도 제공하여 유연성과 타입 안전성을 모두 확보했습니다.

src/features/dashboard/model/TicketOptionStore.tsx (2)

7-9: 타입 변경이 적절합니다.

옵션 식별자를 문자열에서 숫자형 ID로 변경한 것은 API 통합에 더 적합한 구조입니다. resetOptions 메서드 추가도 상태 관리에 유용할 것으로 보입니다.


17-27: 구현이 올바르게 수정되었습니다.

optionName에서 optionId로의 변경이 일관되게 적용되었고, resetOptions 구현도 깔끔합니다.

src/pages/dashboard/ui/ticket/TIcketConfirmPage.tsx (3)

20-22: 커스텀 훅 사용이 훌륭합니다.

useTicketOrderDetail 훅을 사용하여 데이터 페칭 로직을 간소화한 것이 좋습니다.


41-45: 로딩 및 에러 상태 처리가 개선되었습니다.

사용자 경험을 위한 로딩/에러 상태 UI 추가가 적절합니다.


48-66: 컴포넌트 props가 새로운 데이터 모델에 맞게 업데이트되었습니다.

TicketConfirm 인터페이스의 새로운 구조에 맞춰 props가 올바르게 수정되었습니다.

src/shared/ui/backgrounds/TicketOptionLayout.tsx (3)

8-16: 새로운 타입과 훅 임포트가 적절합니다.

티켓 주문 기능을 위한 필요한 의존성들이 올바르게 추가되었습니다.


23-28: 티켓 데이터 조회 로직이 잘 구현되었습니다.

ticketInfo를 기반으로 티켓 세부 정보를 동적으로 가져오는 방식이 좋습니다.


121-127: 동적 티켓 정보 표시가 개선되었습니다.

하드코딩된 텍스트 대신 실제 티켓 데이터를 표시하도록 변경된 것이 좋습니다.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (1)

10-12: 검증 로직이 개선되었지만 추가 보완 필요

이전 리뷰 코멘트에서 제기된 라우트 상태 검증 이슈가 어느 정도 해결되었습니다. 하지만 타입 검증과 엣지 케이스 처리가 여전히 필요합니다.

🧹 Nitpick comments (1)
src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (1)

14-15: 로딩 및 오류 처리 개선 권장

현재 로딩 및 오류 상태 처리가 기본적이지만, 사용자 경험과 접근성 측면에서 개선할 수 있습니다.

다음과 같이 개선하는 것을 권장합니다:

-   if (isLoading) return <div>로딩 중...</div>;
-   if (!data?.isSuccess) return <div>옵션 정보를 불러오지 못했습니다.</div>;
+   if (isLoading) return (
+       <div role="status" aria-label="티켓 옵션 정보 로딩 중">
+           <span>티켓 옵션 정보를 불러오는 중...</span>
+       </div>
+   );
+   if (!data?.isSuccess) return (
+       <div role="alert" aria-label="오류 발생">
+           <span>티켓 옵션 정보를 불러올 수 없습니다. 다시 시도해 주세요.</span>
+       </div>
+   );
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 174715f and 276e724.

📒 Files selected for processing (3)
  • src/pages/dashboard/ui/ticket/TIcketConfirmPage.tsx (3 hunks)
  • src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (1 hunks)
  • src/pages/join/AuthCallback.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/pages/join/AuthCallback.tsx
  • src/pages/dashboard/ui/ticket/TIcketConfirmPage.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (1)
src/features/ticket/hooks/useTicketHook.ts (1)
  • useTicketOptions (39-45)
🔇 Additional comments (2)
src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (2)

1-4: 가져오기 구문이 적절합니다.

필요한 의존성들이 모두 적절하게 가져와졌고, 가져오기 경로도 프로젝트 구조를 따르고 있습니다.


18-19: 렌더링 로직이 적절합니다.

컴포넌트 구조와 props 전달이 올바르게 구현되었습니다. TicketOptionLayoutTicketOption 컴포넌트에 필요한 데이터가 적절하게 전달되고 있습니다.

@hyeeuncho hyeeuncho self-assigned this May 25, 2025
@hyeeuncho hyeeuncho added the 🔧 Feature 기능 구현 label May 25, 2025
@hyeeuncho hyeeuncho force-pushed the feat/#129/payment-response-api branch from 276e724 to 535a5d6 Compare May 25, 2025 12:58
@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/widgets/dashboard/ui/ticket/PurchaseBanner.tsx (3)

6-12: 인터페이스명에 오타가 있습니다.

인터페이스에서 startTime 속성을 제거한 것은 좋은 변경이지만, 인터페이스명에 오타가 있습니다.

다음과 같이 수정하세요:

-interface PurchaseBannerPrpos {
+interface PurchaseBannerProps {

13-13: 컴포넌트 매개변수 업데이트가 적절합니다.

단일 startDate prop만 사용하도록 변경한 것이 새로운 데이터 구조와 일치합니다. 단, 인터페이스명 수정 시 여기도 함께 업데이트해야 합니다.

인터페이스명 수정 시 타입 참조도 업데이트하세요:

-const PurchaseBanner = ({ title, startDate, ticketName, quantity, setIsModalOpen }: PurchaseBannerPrpos) => {
+const PurchaseBanner = ({ title, startDate, ticketName, quantity, setIsModalOpen }: PurchaseBannerProps) => {

15-15: 오래된 TODO 코멘트를 제거하세요.

이 TODO 코멘트는 API 연동과 관련된 것으로 보이는데, 현재 변경사항이 바로 그 API 연동의 일부입니다. 따라서 이 코멘트는 더 이상 필요하지 않습니다.

다음과 같이 제거하세요:

-  //@TODO:api연동하면서 props 변경
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 276e724 and 535a5d6.

📒 Files selected for processing (16)
  • src/features/dashboard/model/email.ts (0 hunks)
  • src/features/dashboard/model/store/TicketOptionStore.tsx (1 hunks)
  • src/features/payment/ui/TicketOption.tsx (2 hunks)
  • src/features/ticket/api/order.ts (1 hunks)
  • src/features/ticket/api/ticket.ts (2 hunks)
  • src/features/ticket/hooks/useOrderHook.ts (1 hunks)
  • src/features/ticket/hooks/useTicketHook.ts (2 hunks)
  • src/features/ticket/model/orderInformation.ts (1 hunks)
  • src/features/ticket/model/ticketInformation.ts (1 hunks)
  • src/pages/dashboard/ui/mail/EmailEditPage.tsx (3 hunks)
  • src/pages/dashboard/ui/ticket/TIcketConfirmPage.tsx (4 hunks)
  • src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx (1 hunks)
  • src/pages/join/AuthCallback.tsx (2 hunks)
  • src/shared/ui/backgrounds/TicketOptionLayout.tsx (1 hunks)
  • src/widgets/dashboard/ui/ticket/PurchaseBanner.tsx (2 hunks)
  • src/widgets/event/ui/TicketInfo.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • src/features/dashboard/model/email.ts
🚧 Files skipped from review as they are similar to previous changes (13)
  • src/features/ticket/api/order.ts
  • src/pages/dashboard/ui/mail/EmailEditPage.tsx
  • src/features/ticket/hooks/useTicketHook.ts
  • src/pages/dashboard/ui/ticket/TicketOptionResponsePage.tsx
  • src/widgets/event/ui/TicketInfo.tsx
  • src/features/ticket/api/ticket.ts
  • src/features/ticket/hooks/useOrderHook.ts
  • src/pages/dashboard/ui/ticket/TIcketConfirmPage.tsx
  • src/shared/ui/backgrounds/TicketOptionLayout.tsx
  • src/features/ticket/model/orderInformation.ts
  • src/pages/join/AuthCallback.tsx
  • src/features/ticket/model/ticketInformation.ts
  • src/features/payment/ui/TicketOption.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/widgets/dashboard/ui/ticket/PurchaseBanner.tsx (1)
src/shared/lib/date.ts (2)
  • formatDate (1-9)
  • formatTime (10-15)
🔇 Additional comments (5)
src/widgets/dashboard/ui/ticket/PurchaseBanner.tsx (2)

4-4: 유틸리티 함수 import가 적절합니다.

공유 라이브러리에서 날짜 포맷팅 함수들을 가져오는 것이 코드 재사용성과 일관성을 높입니다.


32-32: 날짜/시간 포맷팅 로직이 올바르게 구현되었습니다.

단일 startDate 문자열에서 formatDateformatTime 함수를 사용하여 날짜와 시간을 분리하여 표시하는 로직이 적절합니다. 이는 새로운 데이터 구조와 잘 맞습니다.

src/features/dashboard/model/store/TicketOptionStore.tsx (3)

7-7: 데이터 구조가 올바르게 개선되었습니다.

페이지별로 옵션 ID를 키로 사용하는 중첩 매핑 구조로 변경되어 다중 페이지 옵션 선택 시나리오에 적합합니다. 값 타입도 다양한 입력 형태(문자열, 숫자, 숫자 배열)를 지원하도록 확장되었습니다.


8-9: 메서드 시그니처가 적절합니다.

새로운 데이터 구조와 일치하는 매개변수 타입과 resetOptions 메서드 추가가 적절합니다.


27-27: resetOptions 구현이 올바릅니다.

선택된 옵션과 현재 페이지를 모두 초기화하는 로직이 적절합니다.

@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

@hyeeuncho hyeeuncho merged commit 1e09df9 into develop May 25, 2025
2 checks passed
@hyeeuncho hyeeuncho deleted the feat/#129/payment-response-api branch May 25, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 Feature 기능 구현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 결제 페이지 옵션 응답 API 연동

2 participants