Skip to content

Commit

Permalink
Merge pull request #158 from PawWithU/feat/157-application-pick-up-ti…
Browse files Browse the repository at this point in the history
…me-add

[Feature] 이동봉사자 봉사 관리 - 목록 조회 API 수정
  • Loading branch information
kyeong-hyeok authored Apr 17, 2024
2 parents 8ba5d32 + 67ef842 commit e32f45f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public record ApplicationVolunteerCompletedResponse(Long postId, String mainImag
LocalDate startDate,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
LocalDate endDate,
String pickUpTime,
String intermediaryName, Boolean isKennel,
Long reviewId, Long dogStatusId) {
Long reviewId) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public record ApplicationVolunteerProgressingResponse(Long postId, String mainIm
LocalDate startDate,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
LocalDate endDate,
String pickUpTime,
String intermediaryName,
Boolean isKennel) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public record ApplicationVolunteerWaitingResponse(Long postId, String mainImage,
LocalDate startDate,
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "Asia/Seoul")
LocalDate endDate,
String pickUpTime,
String intermediaryName,
Boolean isKennel,
Long applicationId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public class CustomApplicationRepositoryImpl implements CustomApplicationReposit
public List<ApplicationVolunteerWaitingResponse> getVolunteerWaitingApplications(Long volunteerId, Pageable pageable) {
return queryFactory
.select(Projections.constructor(ApplicationVolunteerWaitingResponse.class,
post.id, postImage.image, post.departureLoc, post.arrivalLoc, post.startDate, post.endDate,
post.id, postImage.image, post.departureLoc, post.arrivalLoc,
post.startDate, post.endDate, post.pickUpTime,
intermediary.name, post.isKennel, application.id))
.from(application)
.join(application.post, post)
Expand All @@ -52,7 +53,8 @@ public List<ApplicationVolunteerWaitingResponse> getVolunteerWaitingApplications
public List<ApplicationVolunteerProgressingResponse> getVolunteerProgressingApplications(Long volunteerId, Pageable pageable) {
return queryFactory
.select(Projections.constructor(ApplicationVolunteerProgressingResponse.class,
post.id, postImage.image, post.departureLoc, post.arrivalLoc, post.startDate, post.endDate,
post.id, postImage.image, post.departureLoc, post.arrivalLoc,
post.startDate, post.endDate, post.pickUpTime,
intermediary.name, post.isKennel))
.from(application)
.join(application.post, post)
Expand Down Expand Up @@ -131,14 +133,14 @@ public List<ApplicationIntermediaryProgressingResponse> getIntermediaryProgressi
public List<ApplicationVolunteerCompletedResponse> getVolunteerCompletedApplications(Long volunteerId, Pageable pageable) {
return queryFactory
.select(Projections.constructor(ApplicationVolunteerCompletedResponse.class,
post.id, postImage.image, post.departureLoc, post.arrivalLoc, post.startDate, post.endDate,
intermediary.name, post.isKennel, review.id, dogStatus.id))
post.id, postImage.image, post.departureLoc, post.arrivalLoc,
post.startDate, post.endDate, post.pickUpTime,
intermediary.name, post.isKennel, review.id))
.from(application)
.join(application.post, post)
.join(application.post.intermediary, intermediary)
.join(application.post.mainImage, postImage)
.leftJoin(review).on(post.id.eq(review.post.id))
.leftJoin(dogStatus).on(post.id.eq(dogStatus.post.id))
.where(application.status.eq(ApplicationStatus.COMPLETED)
.and(application.volunteer.id.eq(volunteerId)))
.orderBy(application.modifiedDate.desc()) // 신청 봉사완료 최신순
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ void setUp() {
LocalDate startDate = LocalDate.of(2023, 10, 2);
LocalDate endDate = LocalDate.of(2023, 11, 7);
response.add(new ApplicationVolunteerWaitingResponse(1L, "image1", "서울시 성북구", "서울시 중랑구",
startDate, endDate, "이동봉사 중개", true, 1L));
startDate, endDate, "13:00","이동봉사 중개", true, 1L));
response.add(new ApplicationVolunteerWaitingResponse(2L, "image2", "서울시 성북구", "서울시 중랑구",
startDate, endDate, "이동봉사 중개", false, 2L));
startDate, endDate, "13:00","이동봉사 중개", false, 2L));

//when
given(applicationService.getVolunteerWaitingApplications(anyString(), any())).willReturn(response);
Expand All @@ -99,9 +99,9 @@ void setUp() {
LocalDate startDate = LocalDate.of(2023, 10, 2);
LocalDate endDate = LocalDate.of(2023, 11, 7);
response.add(new ApplicationVolunteerProgressingResponse(1L, "image1", "서울시 성북구", "서울시 중랑구",
startDate, endDate, "이동봉사 중개", true));
startDate, endDate, "13:00", "이동봉사 중개", true));
response.add(new ApplicationVolunteerProgressingResponse(2L, "image2", "서울시 성북구", "서울시 중랑구",
startDate, endDate, "이동봉사 중개", false));
startDate, endDate, "13:00", "이동봉사 중개", false));

//when
given(applicationService.getVolunteerProgressingApplications(anyString(), any())).willReturn(response);
Expand Down Expand Up @@ -238,9 +238,9 @@ void setUp() {
LocalDate startDate = LocalDate.of(2023, 10, 2);
LocalDate endDate = LocalDate.of(2023, 11, 7);
response.add(new ApplicationVolunteerCompletedResponse(1L, "image1", "서울시 성북구", "서울시 중랑구",
startDate, endDate, "이동봉사 중개", true, 1L, null));
startDate, endDate, "13:00", "이동봉사 중개", true, 1L));
response.add(new ApplicationVolunteerCompletedResponse(2L, "image2", "서울시 성북구", "서울시 중랑구",
startDate, endDate, "이동봉사 중개", false, null, null));
startDate, endDate, "13:00","이동봉사 중개", false, null));

//when
given(applicationService.getVolunteerCompletedApplications(anyString(), any())).willReturn(response);
Expand Down

0 comments on commit e32f45f

Please sign in to comment.