Skip to content

Commit

Permalink
fix : planReview condition 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sycuuui committed Sep 24, 2024
1 parent 95f5faa commit 3f6390d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


public interface PlanReviewRepository extends JpaRepository<PlanReview,Long> {
boolean existsAllByPlan(Plan plan);
boolean existsAllByPlanAndDeletedAtIsNull(Plan plan);
@Query("SELECT EXISTS (" +
"SELECT 1 FROM PlanReview pr " +
"WHERE pr.plan = :plan AND (pr.report IS NULL OR pr.report = false))")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public void savePlanReview(Member member, Long planId, PlanReviewReq planReviewR
if(plan == null){
throw new ApplicationException(ErrorCode.NOT_FOUND_EXCEPTION);
}
if(planReviewRepository.existsAllByPlan(plan)){
if(planReviewRepository.existsAllByPlanAndDeletedAtIsNull(plan)){
throw new ApplicationException(ErrorCode.ALREADY_EXIST_EXCEPTION);
}
//Business
Expand Down Expand Up @@ -317,7 +317,7 @@ public List<MyPlanRes> findMyPlans(Member member) {
String remainDate = null;
Boolean hasReview = null;
if (LocalDate.now().isAfter(plan.getEndDate())){
hasReview = planReviewRepository.existsAllByPlanAndReportFilter(plan);
hasReview = planReviewRepository.existsAllByPlanAndDeletedAtIsNull(plan);
}else if ((LocalDate.now().isEqual(plan.getStartDate()) || LocalDate.now().isAfter(plan.getStartDate())) && (LocalDate.now().isEqual(plan.getEndDate()) || LocalDate.now().isBefore(plan.getEndDate()))){
remainDate="D-DAY";
}else if (LocalDate.now().isBefore(plan.getStartDate())){
Expand Down

0 comments on commit 3f6390d

Please sign in to comment.