diff --git a/app/src/main/java/com/yapp/attendance/di/DataModule.kt b/app/src/main/java/com/yapp/attendance/di/DataModule.kt index 27c378df..4080eb88 100644 --- a/app/src/main/java/com/yapp/attendance/di/DataModule.kt +++ b/app/src/main/java/com/yapp/attendance/di/DataModule.kt @@ -14,7 +14,6 @@ import com.yapp.domain.repository.RemoteConfigRepository import com.yapp.domain.repository.SessionRepository import com.yapp.domain.repository.TeamRepository import com.yapp.domain.util.DateParser -import com.yapp.domain.util.RenewDateUtil import dagger.Module import dagger.Provides import dagger.hilt.InstallIn diff --git a/domain/src/main/java/com/yapp/domain/usecases/CheckQrAuthTimeUseCase.kt b/domain/src/main/java/com/yapp/domain/usecases/CheckQrAuthTimeUseCase.kt index ba33e73b..2e425a41 100644 --- a/domain/src/main/java/com/yapp/domain/usecases/CheckQrAuthTimeUseCase.kt +++ b/domain/src/main/java/com/yapp/domain/usecases/CheckQrAuthTimeUseCase.kt @@ -2,13 +2,13 @@ package com.yapp.domain.usecases import com.yapp.domain.model.Session import com.yapp.domain.repository.RemoteConfigRepository -import com.yapp.domain.util.RenewDateUtil +import com.yapp.domain.util.DateUtil import javax.inject.Inject class CheckQrAuthTimeUseCase @Inject constructor( private val remoteConfigRepository: RemoteConfigRepository, - private val dateUtil: RenewDateUtil + private val dateUtil: DateUtil ) { companion object { diff --git a/domain/src/main/java/com/yapp/domain/usecases/GetUpcomingSessionUseCase.kt b/domain/src/main/java/com/yapp/domain/usecases/GetUpcomingSessionUseCase.kt index d440f43e..03faee88 100644 --- a/domain/src/main/java/com/yapp/domain/usecases/GetUpcomingSessionUseCase.kt +++ b/domain/src/main/java/com/yapp/domain/usecases/GetUpcomingSessionUseCase.kt @@ -8,7 +8,7 @@ import javax.inject.Inject class GetUpcomingSessionUseCase @Inject constructor( private val remoteConfigRepository: RemoteConfigRepository, - private val dateUtil: RenewDateUtil + private val dateUtil: DateUtil ) { suspend operator fun invoke(): Result { diff --git a/domain/src/main/java/com/yapp/domain/usecases/MarkAttendanceUseCase.kt b/domain/src/main/java/com/yapp/domain/usecases/MarkAttendanceUseCase.kt index 7eb22642..66635b40 100644 --- a/domain/src/main/java/com/yapp/domain/usecases/MarkAttendanceUseCase.kt +++ b/domain/src/main/java/com/yapp/domain/usecases/MarkAttendanceUseCase.kt @@ -4,13 +4,13 @@ import com.yapp.domain.model.Attendance import com.yapp.domain.model.Session import com.yapp.domain.repository.LocalRepository import com.yapp.domain.repository.MemberRepository -import com.yapp.domain.util.RenewDateUtil +import com.yapp.domain.util.DateUtil import javax.inject.Inject class MarkAttendanceUseCase @Inject constructor( private val localRepository: LocalRepository, private val memberRepository: MemberRepository, - private val dateUtil: RenewDateUtil + private val dateUtil: DateUtil ) { suspend operator fun invoke(checkedSession: Session): Result { diff --git a/domain/src/main/java/com/yapp/domain/util/RenewDateUtil.kt b/domain/src/main/java/com/yapp/domain/util/DateUtil.kt similarity index 97% rename from domain/src/main/java/com/yapp/domain/util/RenewDateUtil.kt rename to domain/src/main/java/com/yapp/domain/util/DateUtil.kt index 7cd21966..e9c2d6d9 100644 --- a/domain/src/main/java/com/yapp/domain/util/RenewDateUtil.kt +++ b/domain/src/main/java/com/yapp/domain/util/DateUtil.kt @@ -7,7 +7,7 @@ import javax.inject.Inject typealias Minute = Long -class RenewDateUtil @Inject constructor() { +class DateUtil @Inject constructor() { fun getCurrentTime(): LocalDateTime { return LocalDateTime.now() diff --git a/domain/src/test/java/DateUtilTest.kt b/domain/src/test/java/DateUtilTest.kt index e5108d11..d8c3d268 100644 --- a/domain/src/test/java/DateUtilTest.kt +++ b/domain/src/test/java/DateUtilTest.kt @@ -1,11 +1,11 @@ import com.yapp.domain.util.DateParser -import com.yapp.domain.util.RenewDateUtil +import com.yapp.domain.util.DateUtil import io.kotest.core.spec.style.BehaviorSpec import io.kotest.matchers.shouldBe class DateUtilTest : BehaviorSpec({ val dateParser = DateParser() - val dateUtil = RenewDateUtil() + val dateUtil = DateUtil() given("[세션시간]과 그로 부터 [30분 전 시간]이 주어진 경우") { val currentTime = dateParser.parse(rawDate = "2024-01-04 14:00:00") diff --git a/presentation/src/main/java/com/yapp/presentation/ui/admin/main/AdminMainViewModel.kt b/presentation/src/main/java/com/yapp/presentation/ui/admin/main/AdminMainViewModel.kt index 31880f3a..786e0c3c 100644 --- a/presentation/src/main/java/com/yapp/presentation/ui/admin/main/AdminMainViewModel.kt +++ b/presentation/src/main/java/com/yapp/presentation/ui/admin/main/AdminMainViewModel.kt @@ -2,11 +2,10 @@ package com.yapp.presentation.ui.admin.main import androidx.lifecycle.viewModelScope import com.yapp.common.base.BaseViewModel -import com.yapp.domain.model.Session import com.yapp.domain.model.collections.AttendanceList import com.yapp.domain.usecases.GetSessionListUseCase import com.yapp.domain.usecases.GetUpcomingSessionUseCase -import com.yapp.domain.util.RenewDateUtil +import com.yapp.domain.util.DateUtil import com.yapp.presentation.ui.admin.main.AdminMainContract.AdminMainUiEvent import com.yapp.presentation.ui.admin.main.AdminMainContract.AdminMainUiSideEffect import com.yapp.presentation.ui.admin.main.AdminMainContract.AdminMainUiState @@ -18,7 +17,7 @@ import javax.inject.Inject class AdminMainViewModel @Inject constructor( private val getSessionListUseCase: GetSessionListUseCase, private val getUpcomingSessionUseCase: GetUpcomingSessionUseCase, - private val dateUtil: RenewDateUtil + private val dateUtil: DateUtil ) : BaseViewModel( AdminMainUiState() ) { diff --git a/presentation/src/main/java/com/yapp/presentation/ui/member/score/MemberScore.kt b/presentation/src/main/java/com/yapp/presentation/ui/member/score/MemberScore.kt index 56225c9d..02ba5e17 100644 --- a/presentation/src/main/java/com/yapp/presentation/ui/member/score/MemberScore.kt +++ b/presentation/src/main/java/com/yapp/presentation/ui/member/score/MemberScore.kt @@ -59,7 +59,7 @@ import com.yapp.common.yds.YDSProgressBar import com.yapp.domain.model.Attendance import com.yapp.domain.model.Session import com.yapp.domain.model.types.NeedToAttendType -import com.yapp.domain.util.RenewDateUtil +import com.yapp.domain.util.DateUtil import com.yapp.presentation.R import com.yapp.presentation.util.attendance.checkSessionAttendance @@ -337,7 +337,7 @@ private fun AttendUserSession( attendanceInfo: Pair, navigateToSessionDetail: (Int) -> Unit ) { - val dateUtil = remember { RenewDateUtil() } + val dateUtil = remember { DateUtil() } val session = attendanceInfo.first val attendance = attendanceInfo.second diff --git a/presentation/src/main/java/com/yapp/presentation/ui/member/score/MemberScoreViewModel.kt b/presentation/src/main/java/com/yapp/presentation/ui/member/score/MemberScoreViewModel.kt index 12e75b39..4efc118c 100644 --- a/presentation/src/main/java/com/yapp/presentation/ui/member/score/MemberScoreViewModel.kt +++ b/presentation/src/main/java/com/yapp/presentation/ui/member/score/MemberScoreViewModel.kt @@ -3,7 +3,7 @@ package com.yapp.presentation.ui.member.score import androidx.lifecycle.viewModelScope import com.yapp.common.base.BaseViewModel import com.yapp.domain.usecases.GetMemberAttendanceListUseCase -import com.yapp.domain.util.RenewDateUtil +import com.yapp.domain.util.DateUtil import com.yapp.presentation.ui.member.score.MemberScoreContract.MemberScoreUiEvent import com.yapp.presentation.ui.member.score.MemberScoreContract.MemberScoreUiSideEffect import com.yapp.presentation.ui.member.score.MemberScoreContract.MemberScoreUiState @@ -15,7 +15,7 @@ import javax.inject.Inject @HiltViewModel class MemberScoreViewModel @Inject constructor( private val getMemberAttendanceListUseCase: GetMemberAttendanceListUseCase, - private val dateUtil: RenewDateUtil + private val dateUtil: DateUtil ) : BaseViewModel(initialState = MemberScoreUiState()) { init { diff --git a/presentation/src/main/java/com/yapp/presentation/ui/member/score/detail/SessionDetail.kt b/presentation/src/main/java/com/yapp/presentation/ui/member/score/detail/SessionDetail.kt index 64af21ee..b0a7c57a 100644 --- a/presentation/src/main/java/com/yapp/presentation/ui/member/score/detail/SessionDetail.kt +++ b/presentation/src/main/java/com/yapp/presentation/ui/member/score/detail/SessionDetail.kt @@ -29,7 +29,7 @@ import com.yapp.common.yds.YDSAttendanceType import com.yapp.common.yds.YDSEmptyScreen import com.yapp.common.yds.YDSProgressBar import com.yapp.domain.model.Session -import com.yapp.domain.util.RenewDateUtil +import com.yapp.domain.util.DateUtil import com.yapp.presentation.util.attendance.checkSessionAttendance @Composable @@ -37,7 +37,7 @@ fun SessionDetail( viewModel: SessionDetailViewModel = hiltViewModel(), onClickBackButton: () -> Unit, ) { - val dateUtil = remember { RenewDateUtil() } + val dateUtil = remember { DateUtil() } val uiState by viewModel.uiState.collectAsState() val session: Session? = uiState.session?.first val attendance = checkSessionAttendance(session!!, uiState.session!!.second, isPastSession = dateUtil.isPastDate(session.date)) diff --git a/presentation/src/main/java/com/yapp/presentation/ui/member/signup/password/Password.kt b/presentation/src/main/java/com/yapp/presentation/ui/member/signup/password/Password.kt index 892ac145..b44fd3c3 100644 --- a/presentation/src/main/java/com/yapp/presentation/ui/member/signup/password/Password.kt +++ b/presentation/src/main/java/com/yapp/presentation/ui/member/signup/password/Password.kt @@ -51,7 +51,6 @@ import com.yapp.common.theme.Light_Gray_200 import com.yapp.common.util.rememberKeyboardVisible import com.yapp.common.yds.YDSAppBar import com.yapp.domain.util.DateParser -import com.yapp.domain.util.RenewDateUtil import com.yapp.presentation.R import com.yapp.presentation.common.AttendanceBundle import com.yapp.presentation.ui.member.signup.name.OnKeyboardNextButton