Skip to content

refactor: 봉사 모집글 참여(Recruitment Participation) 도메인 리팩토링#112

Merged
BonSik-Koo merged 26 commits intodevelopfrom
refactor/recruitment-participation-domain
Feb 28, 2024
Merged

refactor: 봉사 모집글 참여(Recruitment Participation) 도메인 리팩토링#112
BonSik-Koo merged 26 commits intodevelopfrom
refactor/recruitment-participation-domain

Conversation

@BonSik-Koo
Copy link
Copy Markdown
Member

close #111

리팩토링 사항

  • 클린 코드 규칙 준수
  • Controller Layer
    • DTO 네이밍 전체 수정
  • Service Layer
    • 메서드 네이밍 전체 수정
    • 비지니스 로직 내 도메인 로직 분리
  • Domain Layer
    • 도메인 필드명, 컬럼명 전체 수정
    • 일급 컬렉션 적용(RecruitmentParticipations)
      • 다중 팀원 승인/팀원 방출을 위한 상태 변경/검증 기능이 기존엔 Service 로직에 존재했음. 일급 컬렉션을 통해 검증과 행위를 분리.
    • 기존 Service 로직에 존재하던 참여 승인/방출 인원 수 검증을 Recruitment 도메인 로직으로 분리
  • 테스트 코드 분리 및 추가
    • API 인수 테스트
    • Rest docs 문서화 테스트
    • 통합 테스트(Service)
    • 도메인 단위 테스트

참고사항

@BonSik-Koo BonSik-Koo added the 리팩토링 코드 변경, 폴더 구조 변경 label Feb 17, 2024
@BonSik-Koo BonSik-Koo self-assigned this Feb 17, 2024
Copy link
Copy Markdown
Collaborator

@ojino88 ojino88 left a comment

Choose a reason for hiding this comment

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

본식님 수고하셨어요~ PR요청때 정리해주신 덕분에 그 부분을 더 깊게 볼수있었던 것 같아요!

@Override
public void cancelJoin(final User user, final Recruitment recruitment) {
RecruitmentParticipation recruitmentParticipation = findRecruitmentParticipation(recruitment, user);
checkCancelPossible(recruitmentParticipation);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

행위와 검증 분리가 확실히 가독성이나 유지보수에 좋은것 같아요 ㅎㅎ

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

감사해요~~ :)

}

public void increaseParticipationNum(int addParticipationNum) {
validateRemainingParticipationCapacity(addParticipationNum);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

서비스 레이어에서 하던 검증을 도메인에서 하는것도 역할이 명확해지는 것 같아서 좋은것 같습니다~ 본식님 덕분에 service 레이어의 역할에 대해 깊게 고민해볼 수 있었어요 ㅎㅎ 감사합니다~

Copy link
Copy Markdown
Member Author

@BonSik-Koo BonSik-Koo Feb 28, 2024

Choose a reason for hiding this comment

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

아니예요~~ 저도 리팩토링하면서 객체지향 프로그래밍을 고민하다보니 쉽지 않네요 ㅎㅎ

@BonSik-Koo BonSik-Koo merged commit 823ba48 into develop Feb 28, 2024
@BonSik-Koo BonSik-Koo deleted the refactor/recruitment-participation-domain branch February 28, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

리팩토링 코드 변경, 폴더 구조 변경

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recruitment Participation 도메인 리팩토링

2 participants