diff --git a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/MutablePostsAPI.kt b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/MutablePostsAPI.kt new file mode 100644 index 00000000..847c527f --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/api/MutablePostsAPI.kt @@ -0,0 +1,15 @@ +package com.github.insanusmokrassar.postssystem.core.api + +import com.github.insanusmokrassar.postssystem.core.post.* +import kotlinx.coroutines.flow.Flow + +interface MutablePostsAPI { + val postCreatedFlow: Flow + val postDeletedFlow: Flow + val postUpdatedFlow: Flow + + suspend fun createPost(content: PostContents): Post? + suspend fun deletePost(id: PostId): Boolean + + suspend fun updatePostContent(postId: PostId, content: PostContents): Boolean +} \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/Post.kt b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/Post.kt index 08a0e98f..82588238 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/Post.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/postssystem/core/post/Post.kt @@ -3,10 +3,11 @@ package com.github.insanusmokrassar.postssystem.core.post import com.github.insanusmokrassar.postssystem.core.content.Content typealias PostId = String +typealias PostContents = List interface Post { val id: PostId - val content: List + val content: PostContents val meta: PostMetaInfo } \ No newline at end of file