diff --git a/client/src/jsMain/kotlin/dev/inmo/postssystem/client/JSDI.kt b/client/src/jsMain/kotlin/dev/inmo/postssystem/client/JSDI.kt index 8fd6dd5a..e08d7513 100644 --- a/client/src/jsMain/kotlin/dev/inmo/postssystem/client/JSDI.kt +++ b/client/src/jsMain/kotlin/dev/inmo/postssystem/client/JSDI.kt @@ -8,7 +8,6 @@ import dev.inmo.postssystem.features.auth.client.ui.* import dev.inmo.postssystem.features.common.common.baseKoin import dev.inmo.postssystem.features.common.common.getAllDistinct import dev.inmo.postssystem.features.common.common.ui.fsm.UIFSMHandler -import dev.inmo.postssystem.features.common.common.ui.fsm.UIFSMStateSerializer import dev.inmo.postssystem.services.posts.client.ui.list.PostsListUIFSMState import dev.inmo.postssystem.services.posts.client.ui.list.PostsListUIState import kotlinx.browser.* @@ -29,8 +28,7 @@ val defaultTypedSerializer = TypedSerializer( "Short" to Short.serializer(), "Byte" to Byte.serializer(), "Float" to Float.serializer(), - "Double" to Double.serializer(), - "UIFSMState" to UIFSMStateSerializer + "Double" to Double.serializer() ) val defaultSerialFormat = Json { ignoreUnknownKeys = true diff --git a/features/auth/client/src/commonMain/kotlin/dev/inmo/postssystem/features/auth/client/ui/AuthUIState.kt b/features/auth/client/src/commonMain/kotlin/dev/inmo/postssystem/features/auth/client/ui/AuthUIState.kt index 10ad4677..5ea6e228 100644 --- a/features/auth/client/src/commonMain/kotlin/dev/inmo/postssystem/features/auth/client/ui/AuthUIState.kt +++ b/features/auth/client/src/commonMain/kotlin/dev/inmo/postssystem/features/auth/client/ui/AuthUIState.kt @@ -4,9 +4,9 @@ import kotlinx.serialization.Serializable @Serializable sealed interface AuthUIError { - @Serializable +// @Serializable object ServerUnavailable : AuthUIError - @Serializable +// @Serializable object AuthIncorrect : AuthUIError } @@ -14,9 +14,9 @@ sealed interface AuthUIError { sealed interface AuthUIState { @Serializable data class Init(val showError: AuthUIError? = null) : AuthUIState - @Serializable +// @Serializable object Loading : AuthUIState - @Serializable +// @Serializable object Authorized : AuthUIState companion object { diff --git a/features/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/features/posts/common/Post.kt b/features/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/features/posts/common/Post.kt index aa2a6f84..00007290 100644 --- a/features/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/features/posts/common/Post.kt +++ b/features/posts/common/src/commonMain/kotlin/dev/inmo/postssystem/features/posts/common/Post.kt @@ -25,8 +25,8 @@ typealias ContentIds = List * @see RegisteredPost */ @Serializable -sealed class Post { - abstract val content: ContentIds +sealed interface Post { + val content: ContentIds } /** @@ -35,7 +35,7 @@ sealed class Post { @Serializable data class NewPost( override val content: ContentIds -) : Post() +) : Post /** * Registered [Post] @@ -46,12 +46,12 @@ data class RegisteredPost( override val content: ContentIds, @Serializable(DateTimeSerializer::class) val creationDate: DateTime -) : Post() +) : Post @Serializable data class PostWithContent( val post: Post, - val content: List + val content: List<@Polymorphic Content> ) @Serializable diff --git a/services/posts/client/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/client/ui/create/PostCreateUIState.kt b/services/posts/client/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/client/ui/create/PostCreateUIState.kt index 46925eed..be84d18c 100644 --- a/services/posts/client/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/client/ui/create/PostCreateUIState.kt +++ b/services/posts/client/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/client/ui/create/PostCreateUIState.kt @@ -3,14 +3,14 @@ package dev.inmo.postssystem.services.posts.client.ui.create import kotlinx.serialization.Serializable @Serializable -sealed class PostCreateUIState { - @Serializable - object Init : PostCreateUIState() - @Serializable - object Uploading : PostCreateUIState() - @Serializable - object Fail : PostCreateUIState() - @Serializable - object Completed : PostCreateUIState() +sealed interface PostCreateUIState { +// @Serializable + object Init : PostCreateUIState +// @Serializable + object Uploading : PostCreateUIState +// @Serializable + object Fail : PostCreateUIState +// @Serializable + object Completed : PostCreateUIState } diff --git a/services/posts/client/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/client/ui/list/PostsListUIState.kt b/services/posts/client/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/client/ui/list/PostsListUIState.kt index 82e61f3d..53eeab72 100644 --- a/services/posts/client/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/client/ui/list/PostsListUIState.kt +++ b/services/posts/client/src/commonMain/kotlin/dev/inmo/postssystem/services/posts/client/ui/list/PostsListUIState.kt @@ -4,13 +4,13 @@ import dev.inmo.postssystem.features.posts.common.RegisteredPostWithContent import kotlinx.serialization.Serializable @Serializable -sealed class PostsListUIState { - @Serializable - object Loading : PostsListUIState() +sealed interface PostsListUIState { +// @Serializable + object Loading : PostsListUIState @Serializable data class Show( val posts: List - ) : PostsListUIState() + ) : PostsListUIState }