-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 봉사자가 신청한 봉사 리스트 조회 로직을 구현한다. (#87)
* feat: Review 생성시 검증 로직을 추가한다. * refactor: Review 를 Applicant 와 oneToOne 관계를 설정한다. * feat: 봉사자가 신청한 봉사 리스트 조회 쿼리를 작성한다. * test: 봉사자가 신청한 봉사 리스트 조회 레포지토리 테스트 코드를 작성한다. * feat: 봉사자가 신청한 봉사 리스트 조회 서비스 코드를 작성한다. * test: 봉사자가 신청한 봉사 리스트 조회 테스트 코드를 작성한다. * feat: 봉사자가 신청한 봉사 리스트 조회 컨트롤러 코드를 작성한다. * fix: Review 연관관계 변경으로 인한 빌드 실패를 수정한다. * fix: Review 연관관계 변경으로 인한 빌드 실패를 수정한다. * refactor : 후기 작성 가능 여부를 applicant에서 판단한다. * style: shouldWriteReview를 hasNotReview로 변경한다. * fix: 충돌을 해결한다. --------- Co-authored-by: pushedrumex <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: hseong3243 <[email protected]>
- Loading branch information
1 parent
975d4ba
commit 790ad93
Showing
16 changed files
with
339 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/com/clova/anifriends/domain/applicant/dto/FindApplyingVolunteersResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.clova.anifriends.domain.applicant.dto; | ||
|
||
import com.clova.anifriends.domain.applicant.Applicant; | ||
import com.clova.anifriends.domain.applicant.wrapper.ApplicantStatus; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
public record FindApplyingVolunteersResponse( | ||
List<FindApplyingVolunteerResponse> findApplyingVolunteerResponses | ||
) { | ||
|
||
public record FindApplyingVolunteerResponse( | ||
Long recruitmentId, | ||
Long applicantId, | ||
String title, | ||
String shelterName, | ||
ApplicantStatus status, | ||
boolean isWritedReview, | ||
LocalDateTime volunteerDate | ||
) { | ||
|
||
public static FindApplyingVolunteerResponse from( | ||
Applicant applicant | ||
) { | ||
return new FindApplyingVolunteerResponse( | ||
applicant.getRecruitment().getRecruitmentId(), | ||
applicant.getApplicantId(), | ||
applicant.getRecruitment().getTitle(), | ||
applicant.getRecruitment().getShelter().getName(), | ||
applicant.getStatus(), | ||
applicant.hasNotReview(), | ||
applicant.getRecruitment().getStartTime() | ||
); | ||
} | ||
} | ||
|
||
public static FindApplyingVolunteersResponse from( | ||
List<Applicant> applicants | ||
) { | ||
return new FindApplyingVolunteersResponse( | ||
applicants | ||
.stream() | ||
.map(FindApplyingVolunteerResponse::from) | ||
.toList() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.