Skip to content

refact: 이벤트 생성 및 표준 시간 구현#218

Merged
xaexunxang merged 7 commits intodevelopfrom
refact/#216/event-create
Jul 6, 2025
Merged

refact: 이벤트 생성 및 표준 시간 구현#218
xaexunxang merged 7 commits intodevelopfrom
refact/#216/event-create

Conversation

@xaexunxang
Copy link
Copy Markdown
Contributor

@xaexunxang xaexunxang commented Jul 6, 2025

이벤트 생성 간 데이터 유지

  1. 달력
default.mov
  1. 이미지
default.mov
  1. 이벤트 기본 정보 리다이렉트
default.mov

이벤트 삭제 예외 처리

image

이벤트 예약 발송 로컬 시간 구현

스크린샷 2025-07-06 20 28 09

Summary by CodeRabbit

  • 신규 기능

    • 날짜 및 시간 문자열을 변환하고 추출하는 새로운 날짜 유틸리티 함수가 추가되었습니다.
  • 버그 수정

    • 로그아웃 시 오류 코드 검사 구문의 문법 오류가 수정되었습니다.
    • 이메일 전송 실패 시 알림 메시지의 문자열 표기 방식이 통일되었습니다.
  • 기능 개선

    • 이벤트 정보 저장 후 해당 대시보드 페이지로 자동 이동됩니다.
    • 이벤트 삭제 실패 시 구매자가 있는 경우 별도의 안내 메시지가 제공됩니다.
    • 파일 업로드 안내 문구의 최대 파일 크기가 1MB에서 4MB로 변경되었습니다.
    • 파일 업로드 및 텍스트 에디터 입력값이 명시적으로 상태와 동기화됩니다.
    • 날짜 및 시간 선택기에서 시간 입력이 별도로 관리되고, 현지 시간 형식으로 전달됩니다.
    • 날짜 선택기, 티켓 날짜 선택기 등에서 시간 문자열 처리 및 동기화가 개선되었습니다.
  • 문서

    • 이메일 상태의 예약 날짜 포맷에 대한 주석이 더 명확하게 수정되었습니다.

@xaexunxang xaexunxang requested a review from Yejiin21 July 6, 2025 11:29
@xaexunxang xaexunxang self-assigned this Jul 6, 2025
@xaexunxang xaexunxang added the 🪄 Refactoring 코드 리팩토링 label Jul 6, 2025
@xaexunxang xaexunxang linked an issue Jul 6, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 6, 2025

Walkthrough

이 변경 사항은 날짜 및 시간 처리 로직을 로컬 포맷으로 일관성 있게 개선하고, 파일 업로드 안내 문구 및 에러 메시지 등을 수정합니다. 또한, 이벤트 저장 후 대시보드 이동, 입력값 제어, 에러 처리 강화 등 다양한 UI 및 유틸리티 함수 개선이 포함되어 있습니다.

Changes

파일/그룹 변경 요약
src/features/dashboard/hook/useEmailHook.ts 에러 알림 메시지 문자열을 백틱(`)으로 변경
src/features/dashboard/model/store/EmailStore.tsx reservationDate 주석 내 날짜 포맷 설명을 간소화
src/features/event/ui/DatePicker.tsx formatISO → formatDateLocalString 및 extractTimeFromDateString 사용, 시간 상태 변수 추가 및 동기화
src/features/event/ui/FileUpload.tsx 파일 업로드 안내 문구의 최대 용량 1MB → 4MB로 변경
src/features/event/ui/TimePicker.tsx toISOString() 대신 로컬 포맷(YYYY-MM-DDTHH:mm:00) 문자열로 변경하여 onChange에 전달
src/features/ticket/ui/TicketDatePicker.tsx formatISO → formatDateLocalString로 포맷 함수 변경
src/pages/dashboard/ui/EventInfoPage.tsx 이벤트 저장 성공 시 대시보드로 이동하는 네비게이션 추가
src/pages/event/ui/create-event/EventInfoPage.tsx FileUpload, TextEditor에 value prop 명시적으로 추가
src/pages/join/LogoutPage.tsx 불필요한 괄호 제거로 에러 코드 조건문 문법 오류 수정
src/shared/lib/date.ts extractTimeFromDateString, formatDateLocalString 유틸 함수 추가
src/shared/ui/EventCard.tsx 이벤트 삭제 실패 시 에러 코드별로 상세 메시지 및 처리 로직 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EventInfoPage
    participant Server
    participant Router

    User->>EventInfoPage: 저장 버튼 클릭
    EventInfoPage->>Server: 이벤트 정보 저장 요청
    Server-->>EventInfoPage: 저장 성공 응답
    EventInfoPage->>User: 저장 성공 알림
    EventInfoPage->>Router: 대시보드 페이지로 이동
Loading
sequenceDiagram
    participant User
    participant TimePicker
    participant ParentComponent

    User->>TimePicker: 날짜/시간 선택
    TimePicker->>ParentComponent: 로컬 포맷(YYYY-MM-DDTHH:mm:00) 문자열 전달
Loading

Possibly related PRs

Suggested labels

🛠️ BugFix

Suggested reviewers

  • hyeeuncho
  • Yejiin21

Poem

🐰
시간과 날짜, 토끼가 맞춰요
포맷도 맞추고, 에러도 잡아요
파일 업로드 크기도 살짝 키우고
저장하면 대시보드로 폴짝!
오늘도 코드는 깔끔하게,
토끼는 행복하게,
Hop, hop, hop!

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 6, 2025

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/features/dashboard/hook/useEmailHook.ts (1)

37-37: 문자열 리터럴 스타일 변경이 불필요합니다.

현재 문자열에는 보간이 필요하지 않으므로 템플릿 리터럴 대신 일반 문자열 리터럴을 사용하는 것이 더 적합합니다.

-      alert(`메일 전송에 실패했습니다. 다시 시도해 주세요.`);
+      alert('메일 전송에 실패했습니다. 다시 시도해 주세요.');
src/features/event/ui/TimePicker.tsx (1)

50-50: 디버깅용 console.log 제거 권장

프로덕션 코드에서는 디버깅용 console.log 문을 제거하는 것이 좋습니다.

-      console.log(localString);
src/features/event/ui/DatePicker.tsx (1)

45-46: 프로덕션 환경에서 디버깅 로그 제거 필요

개발 중 디버깅을 위한 콘솔 로그는 유용하지만, 프로덕션 배포 전에는 제거해야 합니다.

-  console.log('startDate', startDate);
-  console.log('endDate', endDate);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ce3830a and 9893864.

📒 Files selected for processing (11)
  • src/features/dashboard/hook/useEmailHook.ts (1 hunks)
  • src/features/dashboard/model/store/EmailStore.tsx (1 hunks)
  • src/features/event/ui/DatePicker.tsx (4 hunks)
  • src/features/event/ui/FileUpload.tsx (1 hunks)
  • src/features/event/ui/TimePicker.tsx (1 hunks)
  • src/features/ticket/ui/TicketDatePicker.tsx (2 hunks)
  • src/pages/dashboard/ui/EventInfoPage.tsx (2 hunks)
  • src/pages/event/ui/create-event/EventInfoPage.tsx (1 hunks)
  • src/pages/join/LogoutPage.tsx (1 hunks)
  • src/shared/lib/date.ts (1 hunks)
  • src/shared/ui/EventCard.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: xaexunxang
PR: GoTogether-Inc/frontend#106
File: src/entities/event/model/eventRequest.ts:26-30
Timestamp: 2025-04-29T10:26:21.217Z
Learning: GoTogether 프로젝트의 이벤트 API에서는 생성(EventCreate)과 수정(EventUpdate) 인터페이스에서 다른 필드명을 사용합니다:
- EventCreate: organizerEmail, organizerPhoneNumber (Swagger 스펙 기준)
- EventUpdate: hostEmail, hostPhoneNumber (Notion 스펙 기준)
이는 백엔드 API 명세의 불일치로 인한 의도적인 차이입니다.
src/shared/ui/EventCard.tsx (1)
Learnt from: xaexunxang
PR: GoTogether-Inc/frontend#106
File: src/entities/event/model/eventRequest.ts:26-30
Timestamp: 2025-04-29T10:26:21.217Z
Learning: GoTogether 프로젝트의 이벤트 API에서는 생성(EventCreate)과 수정(EventUpdate) 인터페이스에서 다른 필드명을 사용합니다:
- EventCreate: organizerEmail, organizerPhoneNumber (Swagger 스펙 기준)
- EventUpdate: hostEmail, hostPhoneNumber (Notion 스펙 기준)
이는 백엔드 API 명세의 불일치로 인한 의도적인 차이입니다.
🧬 Code Graph Analysis (3)
src/features/ticket/ui/TicketDatePicker.tsx (1)
src/shared/lib/date.ts (1)
  • formatDateLocalString (33-45)
src/pages/dashboard/ui/EventInfoPage.tsx (2)
src/entities/event/hook/useEventHook.ts (1)
  • useEventDetail (8-23)
src/features/dashboard/hook/useEventHook.ts (1)
  • useUpdateEventHook (5-14)
src/features/event/ui/DatePicker.tsx (1)
src/shared/lib/date.ts (2)
  • extractTimeFromDateString (25-31)
  • formatDateLocalString (33-45)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: storybook
🔇 Additional comments (18)
src/pages/join/LogoutPage.tsx (1)

25-26: 구문 오류 수정이 올바르게 완료되었습니다.

논리 OR 조건에서 불필요한 닫는 괄호가 제거되어 토큰 만료 오류 코드 검증 로직이 올바르게 작동하도록 수정되었습니다.

src/shared/lib/date.ts (2)

25-31: 시간 추출 유틸리티 함수가 잘 구현되었습니다.

extractTimeFromDateString 함수가 안전하게 구현되어 있습니다:

  • 입력값 검증 및 기본값 제공
  • 올바른 시간 형식 반환 (HH:mm)
  • 예외 처리가 잘 되어 있음

33-45: 로컬 시간대 포맷팅 함수가 적절히 구현되었습니다.

formatDateLocalString 함수가 올바르게 구현되어 있습니다:

  • 타임존 변환 없이 로컬 시간을 유지
  • 일관된 날짜/시간 형식 반환 (YYYY-MM-DDTHH:mm:00)
  • 기존 formatISO 함수와 구분되는 명확한 목적
src/shared/ui/EventCard.tsx (1)

136-146: 이벤트 삭제 에러 처리가 개선되었습니다.

구체적인 에러 코드(EVENT4002)에 대한 맞춤형 메시지가 추가되어 사용자가 삭제 실패 원인을 명확히 알 수 있게 되었습니다. 타입 안전성을 위한 적절한 검증도 포함되어 있습니다.

src/features/event/ui/FileUpload.tsx (1)

39-39: 파일 크기 제한 검증 로직 확인 요청

useImageUpload 훅의 validateFile 함수에서 4MB(4 * 1024 * 1024) 검증이 반영된 것을 확인했습니다.
다만, 프로젝트 내에서 백엔드 업로드 검증 로직을 찾지 못해 아래 항목에 대해 수동 확인이 필요합니다.

  • 프론트엔드 UI
    • 파일: src/features/event/ui/FileUpload.tsx (39행)
    • 안내 텍스트: “4MB 이하의 jpeg, png 파일만 등록할 수 있습니다.”
  • 클라이언트 검증
    • 훅: useImageUploadvalidateFile에서 4MB 제한 적용 확인
  • 백엔드 검증
    • 업로드 API 또는 설정 파일에서 최대 파일 크기 제한이 4MB로 적용되었는지 확인

백엔드 검증 로직 위치를 확인하거나, 백엔드 담당자에게 4MB 제한 반영 여부를 검증해 주세요.

src/features/ticket/ui/TicketDatePicker.tsx (2)

6-6: 로컬 시간 포맷팅 유틸리티 도입 승인

formatISO에서 formatDateLocalString으로 변경하여 로컬 시간 포맷팅을 일관성 있게 적용한 것이 좋습니다.


47-48: 날짜 포맷팅 로직 개선 승인

formatDateLocalString을 사용하여 타임존 변환 없이 로컬 시간 문자열을 생성하는 것이 일관성 있는 접근입니다.

src/pages/event/ui/create-event/EventInfoPage.tsx (2)

31-31: FileUpload 컴포넌트 제어 입력 패턴 적용 승인

value prop을 추가하여 FileUpload 컴포넌트를 제어 입력으로 변경한 것이 좋습니다. 현재 이벤트 상태를 정확히 반영합니다.


37-42: TextEditor 컴포넌트 제어 입력 패턴 적용 승인

TextEditor 컴포넌트에 value, eventState, setEventState, onValidationChange prop을 추가하여 완전한 제어 입력으로 구현한 것이 적절합니다.

src/features/dashboard/model/store/EmailStore.tsx (1)

8-8: 날짜 포맷 주석 업데이트 승인

reservationDate 포맷을 UTC ISO 문자열에서 로컬 시간 문자열로 변경한 주석 업데이트가 적절합니다. 전체 코드베이스의 로컬 시간 포맷팅 변경사항과 일치합니다.

src/pages/dashboard/ui/EventInfoPage.tsx (3)

15-15: 네비게이션 훅 import 승인

이벤트 저장 후 리디렉션 기능을 위한 useNavigate import가 적절합니다.


22-22: 네비게이션 인스턴스 생성 승인

navigate 변수를 적절하게 선언했습니다.


67-67: 이벤트 저장 후 네비게이션 로직 승인

성공적인 이벤트 저장 후 대시보드로 이동하는 로직이 좋은 UX 개선입니다. 이벤트 ID를 올바르게 사용하여 해당 이벤트의 대시보드로 리디렉션합니다.

src/features/event/ui/TimePicker.tsx (1)

39-49: 로컬 시간 포맷팅 로직 개선 승인

toISOString() 대신 수동으로 로컬 datetime 문자열을 구성하는 방식이 타임존 변환 없이 로컬 시간을 처리하는 일관된 접근법입니다.

src/features/event/ui/DatePicker.tsx (4)

6-6: 로컬 시간 처리를 위한 유틸리티 함수 임포트 개선

formatISO에서 formatDateLocalStringextractTimeFromDateString으로 변경하여 로컬 시간 처리 로직을 일관성 있게 개선한 것은 좋은 변경사항입니다.


29-43: 상태 초기화 로직 개선

코드 가독성을 위해 포맷팅이 개선되었으며, 기존 로직이 유지되어 안정적입니다.


48-53: 시간 상태 변수 추가로 기능 개선

startTimeendTime 상태 변수를 추가하여 날짜와 시간을 분리하여 관리하는 것은 좋은 개선사항입니다. extractTimeFromDateString 함수를 사용하여 일관된 시간 추출 로직을 적용한 것도 적절합니다.


106-107: 로컬 시간 포맷팅 함수 적용

formatISO에서 formatDateLocalString으로 변경하여 로컬 시간 기반 포맷팅을 적용한 것은 전체 시스템의 일관성을 위한 좋은 개선사항입니다.

@xaexunxang xaexunxang requested a review from hyeeuncho July 6, 2025 11:33
Copy link
Copy Markdown
Member

@hyeeuncho hyeeuncho left a comment

Choose a reason for hiding this comment

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

수고하셨습니다

@xaexunxang xaexunxang merged commit ea5a7d1 into develop Jul 6, 2025
2 checks passed
@xaexunxang xaexunxang deleted the refact/#216/event-create branch July 6, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪄 Refactoring 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] 이벤트 등록 시간 설정

2 participants