From e5312f59b70ee5401a07f4fcd0de3a32c8990be8 Mon Sep 17 00:00:00 2001 From: yang Date: Mon, 18 Mar 2024 23:37:26 +0900 Subject: [PATCH 1/7] =?UTF-8?q?RAC-325=20fix:=20=EC=9E=AC=EB=B0=9C?= =?UTF-8?q?=EA=B8=89=20=ED=86=A0=ED=81=B0=20=EC=A0=80=EC=9E=A5=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/adminMain.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/resources/templates/adminMain.html b/src/main/resources/templates/adminMain.html index 6899511f..8d84756e 100644 --- a/src/main/resources/templates/adminMain.html +++ b/src/main/resources/templates/adminMain.html @@ -15,9 +15,7 @@ diff --git a/src/main/resources/templates/adminPayment.html b/src/main/resources/templates/adminPayment.html index 6d96a756..ab554f2b 100644 --- a/src/main/resources/templates/adminPayment.html +++ b/src/main/resources/templates/adminPayment.html @@ -26,6 +26,7 @@ 전화번호 결제일시 멘토링정보 + 환불/취소 결제상태 @@ -36,6 +37,7 @@ phoneNumber createdAt + status From 69fecd2cbe76c401dc0f8ef9c69a6e10a7751b2b Mon Sep 17 00:00:00 2001 From: yang Date: Tue, 19 Mar 2024 02:29:53 +0900 Subject: [PATCH 7/7] =?UTF-8?q?RAC-325=20fix=20:=20=EC=A0=95=EC=82=B0=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adminssr/application/usecase/AdminSalaryUseCase.java | 2 +- .../adminssr/application/usecase/AdminSeniorUseCase.java | 2 +- .../domain/salary/domain/service/SalaryGetService.java | 6 ++++++ .../domain/senior/presentation/SeniorControllerTest.java | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminSalaryUseCase.java b/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminSalaryUseCase.java index 56b991de..e386a9d1 100644 --- a/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminSalaryUseCase.java +++ b/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminSalaryUseCase.java @@ -44,7 +44,7 @@ public List salaryInfos() { public SalaryInfo seniorSalary(Long seniorId) { Senior senior = seniorGetService.bySeniorId(seniorId); - Salary salary = salaryGetService.bySenior(senior); + Salary salary = salaryGetService.bySeniorLastWeek(senior); SalaryStatus status = getStatus(salary); if (status != YET) throw new SalaryNotYetException(); diff --git a/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminSeniorUseCase.java b/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminSeniorUseCase.java index f1d276ce..d2fe6c0b 100644 --- a/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminSeniorUseCase.java +++ b/src/main/java/com/postgraduate/domain/adminssr/application/usecase/AdminSeniorUseCase.java @@ -36,7 +36,7 @@ public List allSenior() { List seniors = seniorGetService.allSeniorId(); return seniors.stream() .map(senior -> { - Salary salary = salaryGetService.bySenior(senior); + Salary salary = salaryGetService.bySeniorLastWeek(senior); SalaryStatus salaryStatus = getStatus(salary); Optional wish = wishGetService.byUser(senior.getUser()); return mapToSeniorInfo(senior, salaryStatus, wish.isPresent()); diff --git a/src/main/java/com/postgraduate/domain/salary/domain/service/SalaryGetService.java b/src/main/java/com/postgraduate/domain/salary/domain/service/SalaryGetService.java index dfba9da4..1958dd83 100644 --- a/src/main/java/com/postgraduate/domain/salary/domain/service/SalaryGetService.java +++ b/src/main/java/com/postgraduate/domain/salary/domain/service/SalaryGetService.java @@ -30,6 +30,12 @@ public Salary bySalaryId(Long salaryId) { } public Salary bySenior(Senior senior) { + LocalDate salaryDate = SalaryUtil.getSalaryDate(); + return salaryRepository.findBySeniorAndSalaryDate(senior, salaryDate) + .orElseThrow(SalaryNotFoundException::new); + } + + public Salary bySeniorLastWeek(Senior senior) { LocalDate salaryDate = SalaryUtil.getSalaryDate().minusDays(7); return salaryRepository.findBySeniorAndSalaryDate(senior, salaryDate) .orElseThrow(SalaryNotFoundException::new); diff --git a/src/test/java/com/postgraduate/domain/senior/presentation/SeniorControllerTest.java b/src/test/java/com/postgraduate/domain/senior/presentation/SeniorControllerTest.java index 405d88f0..c074fcac 100644 --- a/src/test/java/com/postgraduate/domain/senior/presentation/SeniorControllerTest.java +++ b/src/test/java/com/postgraduate/domain/senior/presentation/SeniorControllerTest.java @@ -9,6 +9,7 @@ import com.postgraduate.domain.available.domain.repository.AvailableRepository; import com.postgraduate.domain.salary.domain.entity.Salary; import com.postgraduate.domain.salary.domain.repository.SalaryRepository; +import com.postgraduate.domain.salary.util.SalaryUtil; import com.postgraduate.domain.senior.application.dto.req.*; import com.postgraduate.domain.senior.domain.entity.Info; import com.postgraduate.domain.senior.domain.entity.Profile; @@ -31,12 +32,14 @@ import org.junit.jupiter.params.provider.EmptySource; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.NullAndEmptySource; +import org.mockito.BDDMockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; import org.springframework.security.test.context.support.WithMockUser; import java.io.IOException; +import java.time.LocalDate; import java.util.ArrayList; import java.util.List; @@ -47,6 +50,7 @@ import static java.lang.Boolean.TRUE; import static java.time.LocalDateTime.now; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.doNothing; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;