Skip to content

Commit

Permalink
Create common interface named Source for Feed and FeedGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Apr 13, 2024
1 parent 15f0b21 commit d36c3eb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import kotlinx.datetime.Instant

@Immutable
data class Feed(
val id: String,
override val id: String,
val name: String,
val icon: String,
val description: String,
Expand All @@ -31,4 +31,5 @@ data class Feed(
val lastCleanUpAt: Instant? = null,
val numberOfUnreadPosts: Long = 0L,
val alwaysFetchSourceArticle: Boolean = false,
)
override val sourceType: SourceType = SourceType.Feed
) : Source
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package dev.sasikanth.rss.reader.core.model.local
import kotlinx.datetime.Instant

data class FeedGroup(
val id: String,
override val id: String,
val name: String,
val feedIds: Set<String>,
val feedIcons: Set<String>,
val createdAt: Instant,
val updatedAt: Instant,
)
override val sourceType: SourceType = SourceType.FeedGroup
) : Source
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2024 Sasikanth Miriyampalli
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package dev.sasikanth.rss.reader.core.model.local

interface Source {
val id: String
val sourceType: SourceType
}

enum class SourceType {
Feed,
FeedGroup
}

0 comments on commit d36c3eb

Please sign in to comment.