Skip to content

Commit

Permalink
Fix validating start date of goal logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mkSpace committed Dec 21, 2023
1 parent a91f423 commit 8caafd4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class BettingApplicationService(
}

private fun Betting.validateStartDate() {
if (goalService.loadById(goalId).startDate > LocalDateTime.now()) {
val now = LocalDateTime.now()
val goalStartDate = goalService.loadById(goalId).startDate
if (now.toLocalDate() >= goalStartDate.toLocalDate()) {
throw BaseException.of(ExceptionCode.E400_BAD_REQUEST, "이미 시작한 내기 입니다.")
}
}
Expand Down

0 comments on commit 8caafd4

Please sign in to comment.