Skip to content

feat: 크루 탈퇴 기능 구현#37

Merged
mandykr merged 4 commits intodevelopfrom
feature-10/crew-withdrawal
Apr 29, 2025
Merged

feat: 크루 탈퇴 기능 구현#37
mandykr merged 4 commits intodevelopfrom
feature-10/crew-withdrawal

Conversation

@mandykr
Copy link
Contributor

@mandykr mandykr commented Apr 26, 2025

🔍 PR 타입 선택

아래 타입 중 해당하는 하나를 선택해 주세요. 반드시 하나만 선택해 주세요.

  • feat: 새로운 기능 추가

📝 변경 사항 요약

변경 사항을 간단히 요약해 주세요.

  • 크루 탈퇴 기능 구현
  • 크루 여행 타입을 크루원 전용 여행, 크루원 포함 여행으로 분리
  • 크루 여행 타입에 따라 크루 탈퇴 가능 여부를 판단하는 로직 추가

🛠 관련 이슈

Resolves: #10

추가 설명 (선택 사항)

변경 사항에 대한 추가 설명을 작성해 주세요.

@mandykr mandykr self-assigned this Apr 26, 2025
@mandykr mandykr linked an issue Apr 26, 2025 that may be closed by this pull request
6 tasks
public void withdrawCrew(UUID crewId, CrewWithdrawalRequest request) {
Crew crew = findCrewById(crewId);
CrewMembers crewMembers = crew.getCrewMembers();
crewMembers.withdraw(request.memberId(), request.participatingCrewTrips());
Copy link
Collaborator

Choose a reason for hiding this comment

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

withDraw면 탈퇴하다 뜻인가요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 맞습니다


private void validatePossibleWithdrawal(UUID memberId, List<CrewTrip> crewTrips) {
if (isLeader(memberId)) {
throw new ImpossibleWithdrawCrewException("크루 리더는 탈퇴할 수 없습니다.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

크루 리더가 탈퇴 시, 다른 사람에 크루 리더 요청 할 수 있도록 했던거 같은데.! 어떻게 처리하실지 문의 드려요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

크루 리더를 먼저 위임해야 한다고 생각해서 별도의 이슈로 만들었어요 #36

Copy link
Contributor

@pparkjs pparkjs left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 코맨트 남겨놓은 거 확인 부탁드릴게요

Comment on lines +13 to +14
@Schema(description = "크루 ID")
UUID tripId,
Copy link
Contributor

Choose a reason for hiding this comment

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

이거 여행 ID로 해야할 거 같습니다!

import static com.retrip.crew.domain.CrewTrip.CrewTripType.EXCLUSION;

@Schema(description = "크루 여행")
public record CrewTrip(
Copy link
Contributor

Choose a reason for hiding this comment

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

혹시 해당 CrewTrip을 탈퇴 Request에서 받던데 본인이 참여중인 크루 여행목록은 프론트에서 주는건가요?? 여행에서 가져오는게 아니라?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

API gateway에서 Trip 서비스로 요청해서 참여중인 크루 여행 목록을 받아오고
다시 Crew 서비스의 크루 탈퇴 API의 Request로 넘겨준다고 생각해서 설계했습니다.

@mandykr mandykr merged commit 2b02534 into develop Apr 29, 2025
@mandykr mandykr deleted the feature-10/crew-withdrawal branch April 29, 2025 00:22
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.

크루 탈퇴

3 participants