Skip to content

Commit

Permalink
Career의 endDate를 nullable로 변경 (#60)
Browse files Browse the repository at this point in the history
* endDate를 nullable로 변경하고 null일경우 임의의값을 넣도록하였습니다.

* LocalDate null 대체 값을 util로 관리

* 패키지 이동

* 전역 상수 네이밍 변경
  • Loading branch information
hajeu committed Nov 14, 2023
1 parent 3bda22d commit ef97e07
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package team.themoment.gsmNetworking.common.util

import java.time.LocalDate

class DateValueUtil {

companion object{
val VALUE_TO_REPLACE_NULL = LocalDate.of(9999, 12, 31)!!
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Career(
@Column(nullable = false)
val startDate: LocalDate,

@Column(nullable = false)
@Column(nullable = true)
val endDate: LocalDate,

@Column(nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ data class MentorCareerDto(
@field:NotBlank
val startDate: LocalDate,

@field:NotBlank
val endDate: LocalDate,
val endDate: LocalDate?,

val isWorking: Boolean?
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import team.themoment.gsmNetworking.domain.user.dto.UserRegistrationDto
import team.themoment.gsmNetworking.domain.user.service.UserRegistrationService
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import team.themoment.gsmNetworking.common.util.DateValueUtil

/**
* 멘토를 저장하는 로직이 담긴 서비스 클래스 입니다.
Expand Down Expand Up @@ -43,7 +44,7 @@ class MentorRegistrationService(
companyUrl = it.companyUrl ?: "",
position = it.position,
startDate = it.startDate,
endDate = it.endDate,
endDate = it.endDate ?: DateValueUtil.VALUE_TO_REPLACE_NULL,
isWorking = it.isWorking ?: false
)
}
Expand Down

0 comments on commit ef97e07

Please sign in to comment.