Skip to content

크루 참여 요청#29

Merged
mandykr merged 8 commits intodevelopfrom
feature-2/demand-crew-member
Mar 17, 2025
Merged

크루 참여 요청#29
mandykr merged 8 commits intodevelopfrom
feature-2/demand-crew-member

Conversation

@mandykr
Copy link
Contributor

@mandykr mandykr commented Mar 11, 2025

🔍 PR 타입 선택

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

  • feat: 새로운 기능 추가

📝 변경 사항 요약

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

  • 크루 최대 인원 설정 기능 추가
  • 크루 모집 상태 변경 기능 추가
  • 크루 참여 요청 기능 추가

🛠 관련 이슈

Resolves: #2

@mandykr mandykr self-assigned this Mar 11, 2025
@mandykr mandykr linked an issue Mar 11, 2025 that may be closed by this pull request
6 tasks
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 14 to +20
@Schema(description = "크루 타이틀")
@Size(min = 1, max = 30)
String title,

@Schema(description = "크루 설명")
@Size(min = 1, max = 500)
String description
String description,
Copy link
Contributor

Choose a reason for hiding this comment

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

이 두개는 CrewTitle, CrewDescription VO에서 이미 유효성 검사하기에 Size는뺴도 될 거 같습니다. 만약 해당 크기에 대한 유효성 검사가 VO에없다면 추가 하시면 될 거 같아요!

Copy link
Contributor Author

@mandykr mandykr Mar 15, 2025

Choose a reason for hiding this comment

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

request랑 VO에서 이중으로 체크하는 게 안전할 듯 하긴 한데 한쪽에서 size 변경되면 다른 쪽도 변경되어야 하니까 관리하기 어려울 수도 있겠네요.
다른 분들도 의견 부탁드려요

Copy link
Collaborator

Choose a reason for hiding this comment

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

VO에서 체크되는 Validation과 Request에서 체크되는 Validation 목적성 및 에러 코드가 다르다고 생각이 됩니다.
5xx 에러와 4xx 에러가 발생될 거 같은데..
저는 둘 다 있어야 될 것 같다고 생각됩니다(DB에 직접적으로 데이터를 넣는것을 방지하기 위해서로도 VO에서는 반드시 있어야 될 거 같습니다.)

Comment on lines +8 to +14
@Schema(description = "크루 타이틀")
@Size(min = 1, max = 30)
String title,

@Schema(description = "크루 설명")
@Size(min = 1, max = 500)
String description,
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Comment on lines +33 to +39

public void start(int membersSize) {
if (isRecruitmentComplete(membersSize)) {
stop();
throw new IllegalStateException("최대 인원을 모두 모집 완료하여 더 이상 멤버를 모집할 수 없습니다.");
}
this.status = RECRUITING;
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM👍🏻

UUID id,

@Schema(description = "모집 상태")
RecruitmentStatus status
Copy link
Collaborator

Choose a reason for hiding this comment

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

해당 값 Enum 값 Swagger에 어떻게 표시되는지 확인 가능하실까요??

}

public void startRecruitment() {
int membersSize = crewMembers.getValues().size();
Copy link
Collaborator

Choose a reason for hiding this comment

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

crewMembers 하위에 Size를 구해주는 메서드를 만드는 것은 어떤가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네 별도의 메서드를 구현하는게 좋겠네요

public CrewMember getLeader() {
return this.values.stream().filter(it -> it.getCrewMemberRole() == CrewMemberRole.LEADER).findFirst().orElse(null);
return this.values.stream()
.filter(it -> it.getCrewMemberRole() == CrewMemberRole.LEADER)
Copy link
Collaborator

Choose a reason for hiding this comment

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

CrewMemberRole에 Code 값 비교하는 함수 없나요??
해당 함수가 있다면 그 함수를 사용하는게 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이번 이슈에서 개발한 부분이 아니라 별도의 이슈로 만들어 담당하신 분의 의견을 들어보는게 좋겠어요

return this.values.stream()
.filter(it -> it.getCrewMemberRole() == CrewMemberRole.LEADER)
.findFirst()
.orElse(null);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Null을 반환하는것 보단 Enum 타입에 None과 같은 타입을 만들어서 반환하는게 좋을거 같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이번 이슈에서 개발한 부분이 아니라 별도의 이슈로 만들어 담당하신 분의 의견을 들어보는게 좋겠어요

public void start(int membersSize) {
if (isRecruitmentComplete(membersSize)) {
stop();
throw new IllegalStateException("최대 인원을 모두 모집 완료하여 더 이상 멤버를 모집할 수 없습니다.");
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.

ILLEGAL_STATE(BAD_REQUEST, "Common-005", "Illegal state")
기본적으로 가지고 있는 BAD_REQUEST를 사용하도록 했습니다.

@mandykr mandykr force-pushed the feature-2/demand-crew-member branch from 28d3ce6 to 7d791cc Compare March 17, 2025 08:58
@mandykr mandykr merged commit 7df7f62 into develop Mar 17, 2025
@mandykr mandykr deleted the feature-2/demand-crew-member branch March 17, 2025 09:01
ekfrehd pushed a commit that referenced this pull request Jun 3, 2025
* feat: 크루 모집상태 변경시 최대 인원수 검증 추가
- IllegalStateException 추가
- common exception 생성자 수정

* refactor: CrewMembers size 조회 메서드 추가

* fix: conflict repair
ekfrehd added a commit that referenced this pull request Jun 29, 2025
* feat: PR 템플릿 and PR Discord 알림 연동

* feat: Crew 생성 (#20)

* feat: Crew 생성

* feat: Code 리뷰 반영, Exception 추가

* feat: 주석 제거 및 코드 수정

---------

Co-authored-by: junhokim <junhokim@gmarket.com>

* feat: 비즈니스 예외와 API 공통 응답 모듈 추가 (#23)

* feat: 비즈니스 예외와 API 공통 응답 모듈 추가
- vo 검증에서 발생하는 비즈니스 예외 삭제 및 InvalidValueException 으로 변경

* feat: 스웨거 추가 작업 (#24)

Co-authored-by: junhokim <junhokim@gmarket.com>

* [feat] 크루 상세, 리스트 조회 API 기능 구현 (#25)

* [feat] 크루 리스트 조회 API 기능 구현 및 테스트코드 리팩토링 (#4)

* [feat] 크루 상세 조회 API 기능 구현 (#4)

* feat: 스웨거 추가 작업 (#24)

Co-authored-by: junhokim <junhokim@gmarket.com>

* [fix] 크루 상세 조회 API 코드리뷰 반영 (#4)

* [fix] 단위테스트 SpringBootTest -> DataJpaTest 사용하도록 수정 (#4)

---------

Co-authored-by: Kimjunho <39546306+xjvmdutl@users.noreply.github.com>
Co-authored-by: junhokim <junhokim@gmarket.com>

* 크루 참여 요청 (#29)

* feat: 크루 모집상태 변경시 최대 인원수 검증 추가
- IllegalStateException 추가
- common exception 생성자 수정

* refactor: CrewMembers size 조회 메서드 추가

* fix: conflict repair

* feat:크루 참여 요청 질문 등록

* feat:크루 참여 요청 질문 등록

* [FEAT]-recruitment로 연관관계 변경

* 크루 참여 요청 질문 등록 수정

* 크루 참여 요청 질문 등록 수정 구현

---------

Co-authored-by: junhokim <junhokim@gmarket.com>
Co-authored-by: Kimjunho <39546306+xjvmdutl@users.noreply.github.com>
Co-authored-by: mandykr <94955454+mandykr@users.noreply.github.com>
Co-authored-by: coPpark <qkrwjdtn963@gmail.com>
Co-authored-by: MonChest <p_caso@atzsoft.kr>
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