diff --git a/core/domain/build.gradle.kts b/core/domain/build.gradle.kts index 5623df11..b65accdf 100644 --- a/core/domain/build.gradle.kts +++ b/core/domain/build.gradle.kts @@ -8,6 +8,8 @@ plugins { android.namespace = "club.nito.core.domain" kotlin { + explicitApi() + sourceSets { commonMain { dependencies { diff --git a/core/domain/src/androidMain/kotlin/club/nito/core/domain/Platform.android.kt b/core/domain/src/androidMain/kotlin/club/nito/core/domain/Platform.android.kt deleted file mode 100644 index ba54a21a..00000000 --- a/core/domain/src/androidMain/kotlin/club/nito/core/domain/Platform.android.kt +++ /dev/null @@ -1,7 +0,0 @@ -package club.nito.core.domain - -class AndroidPlatform : Platform { - override val name: String = "Android ${android.os.Build.VERSION.SDK_INT}" -} - -actual fun getPlatform(): Platform = AndroidPlatform() \ No newline at end of file diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/GetParticipantScheduleListUseCase.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/GetParticipantScheduleListUseCase.kt index c3c7c378..d1fa5176 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/GetParticipantScheduleListUseCase.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/GetParticipantScheduleListUseCase.kt @@ -15,11 +15,11 @@ import kotlinx.coroutines.flow.flow /** * スケジュール一覧を取得するユースケース */ -sealed interface GetParticipantScheduleListUseCase { - operator fun invoke(): Flow> +public sealed interface GetParticipantScheduleListUseCase { + public operator fun invoke(): Flow> } -class GetParticipantScheduleListExecutor( +public class GetParticipantScheduleListExecutor( private val scheduleRepository: ScheduleRepository, private val participantRepository: ParticipantRepository, private val userRepository: UserRepository, diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/GetRecentScheduleUseCase.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/GetRecentScheduleUseCase.kt index cd082be8..8ce9c296 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/GetRecentScheduleUseCase.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/GetRecentScheduleUseCase.kt @@ -17,11 +17,11 @@ import kotlinx.datetime.Clock /** * 直近のスケジュールを取得するユースケース */ -sealed interface GetRecentScheduleUseCase { - operator fun invoke(): Flow> +public sealed interface GetRecentScheduleUseCase { + public operator fun invoke(): Flow> } -class GetRecentScheduleExecutor( +public class GetRecentScheduleExecutor( private val scheduleRepository: ScheduleRepository, private val participantRepository: ParticipantRepository, private val userRepository: UserRepository, diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/Greeting.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/Greeting.kt deleted file mode 100644 index 7e8e272e..00000000 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/Greeting.kt +++ /dev/null @@ -1,9 +0,0 @@ -package club.nito.core.domain - -class Greeting { - private val platform: Platform = getPlatform() - - fun greet(): String { - return "Hello, ${platform.name}!" - } -} \ No newline at end of file diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/ModifyPasswordUseCase.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/ModifyPasswordUseCase.kt index 89f150b6..887bec10 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/ModifyPasswordUseCase.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/ModifyPasswordUseCase.kt @@ -8,14 +8,14 @@ import club.nito.core.model.runExecuting /** * 直近のスケジュールを取得するユースケース */ -sealed interface ModifyPasswordUseCase { - suspend operator fun invoke(password: String): ExecuteResult +public sealed interface ModifyPasswordUseCase { + public suspend operator fun invoke(password: String): ExecuteResult } -class ModifyPasswordExecutor( +public class ModifyPasswordExecutor( private val authRepository: AuthRepository, ) : ModifyPasswordUseCase { - override suspend fun invoke(password: String) = runExecuting { + override suspend fun invoke(password: String): ExecuteResult = runExecuting { authRepository.modifyAuthUser( email = null, password = password, diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/ObserveAuthStatusUseCase.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/ObserveAuthStatusUseCase.kt index fb640b9d..8685ff40 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/ObserveAuthStatusUseCase.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/ObserveAuthStatusUseCase.kt @@ -8,11 +8,11 @@ import kotlinx.coroutines.flow.Flow /** * 認証状態を購読するユースケース */ -sealed interface ObserveAuthStatusUseCase { - operator fun invoke(): Flow> +public sealed interface ObserveAuthStatusUseCase { + public operator fun invoke(): Flow> } -class ObserveAuthStatusExecutor( +public class ObserveAuthStatusExecutor( private val authRepository: AuthRepository, ) : ObserveAuthStatusUseCase { override fun invoke(): Flow> = authRepository.authStatus diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/ParticipateUseCase.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/ParticipateUseCase.kt index 03d7c261..345c71a3 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/ParticipateUseCase.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/ParticipateUseCase.kt @@ -6,11 +6,11 @@ import club.nito.core.model.ExecuteResult /** * 参加表明するユースケース */ -sealed interface ParticipateUseCase { - suspend operator fun invoke(scheduleId: String, comment: String): ExecuteResult +public sealed interface ParticipateUseCase { + public suspend operator fun invoke(scheduleId: String, comment: String): ExecuteResult } -class ParticipateExecutor( +public class ParticipateExecutor( private val participantRepository: ParticipantRepository, ) : ParticipateUseCase { override suspend fun invoke(scheduleId: String, comment: String): ExecuteResult { diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/Platform.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/Platform.kt deleted file mode 100644 index aaf593ff..00000000 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/Platform.kt +++ /dev/null @@ -1,7 +0,0 @@ -package club.nito.core.domain - -interface Platform { - val name: String -} - -expect fun getPlatform(): Platform \ No newline at end of file diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/SignInUseCase.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/SignInUseCase.kt index aebc7295..af831999 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/SignInUseCase.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/SignInUseCase.kt @@ -7,11 +7,11 @@ import club.nito.core.model.runExecuting /** * 直近のスケジュールを取得するユースケース */ -sealed interface SignInUseCase { - suspend operator fun invoke(email: String, password: String): ExecuteResult +public sealed interface SignInUseCase { + public suspend operator fun invoke(email: String, password: String): ExecuteResult } -class SignInExecutor( +public class SignInExecutor( private val authRepository: AuthRepository, ) : SignInUseCase { override suspend fun invoke(email: String, password: String): ExecuteResult = runExecuting { diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/SignOutUseCase.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/SignOutUseCase.kt index 55f36dcf..1ca4bc29 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/SignOutUseCase.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/SignOutUseCase.kt @@ -7,11 +7,11 @@ import club.nito.core.model.runExecuting /** * 直近のスケジュールを取得するユースケース */ -sealed interface SignOutUseCase { - suspend operator fun invoke(): ExecuteResult +public sealed interface SignOutUseCase { + public suspend operator fun invoke(): ExecuteResult } -class SignOutExecutor( +public class SignOutExecutor( private val authRepository: AuthRepository, ) : SignOutUseCase { override suspend fun invoke(): ExecuteResult = runExecuting { diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/di/useCaseModule.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/di/UseCaseModule.kt similarity index 96% rename from core/domain/src/commonMain/kotlin/club/nito/core/domain/di/useCaseModule.kt rename to core/domain/src/commonMain/kotlin/club/nito/core/domain/di/UseCaseModule.kt index caef27cf..f44c8c52 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/di/useCaseModule.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/di/UseCaseModule.kt @@ -19,7 +19,7 @@ import org.koin.core.module.dsl.singleOf import org.koin.dsl.bind import org.koin.dsl.module -val useCaseModule: Module = module { +public val useCaseModule: Module = module { singleOf(::ObserveAuthStatusExecutor) bind ObserveAuthStatusUseCase::class singleOf(::SignInExecutor) bind SignInUseCase::class singleOf(::ModifyPasswordExecutor) bind ModifyPasswordUseCase::class diff --git a/core/domain/src/commonMain/kotlin/club/nito/core/domain/model/ParticipantSchedule.kt b/core/domain/src/commonMain/kotlin/club/nito/core/domain/model/ParticipantSchedule.kt index 14326e9c..216aa14c 100644 --- a/core/domain/src/commonMain/kotlin/club/nito/core/domain/model/ParticipantSchedule.kt +++ b/core/domain/src/commonMain/kotlin/club/nito/core/domain/model/ParticipantSchedule.kt @@ -3,7 +3,7 @@ package club.nito.core.domain.model import club.nito.core.model.UserProfile import kotlinx.datetime.Instant -data class ParticipantSchedule( +public data class ParticipantSchedule( val id: String, val scheduledAt: Instant, val metAt: Instant, diff --git a/core/domain/src/iosMain/kotlin/club/nito/core/domain/Platform.ios.kt b/core/domain/src/iosMain/kotlin/club/nito/core/domain/Platform.ios.kt deleted file mode 100644 index 20db3fae..00000000 --- a/core/domain/src/iosMain/kotlin/club/nito/core/domain/Platform.ios.kt +++ /dev/null @@ -1,9 +0,0 @@ -package club.nito.core.domain - -import platform.UIKit.UIDevice - -class IOSPlatform: Platform { - override val name: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion -} - -actual fun getPlatform(): Platform = IOSPlatform() \ No newline at end of file