fix recurrents
This commit is contained in:
@@ -11,9 +11,10 @@ data class Category(
|
||||
val id: String? = null,
|
||||
@DBRef var space: Space? = null,
|
||||
var type: CategoryType,
|
||||
val name: String,
|
||||
val description: String? = null,
|
||||
val icon: String? = null
|
||||
var name: String,
|
||||
var description: String? = null,
|
||||
var icon: String? = null,
|
||||
var tags: MutableSet<CategoryTag> = mutableSetOf(),
|
||||
)
|
||||
|
||||
|
||||
@@ -21,3 +22,28 @@ data class CategoryType(
|
||||
val code: String,
|
||||
val name: String? = null
|
||||
)
|
||||
|
||||
data class CategoryTag (
|
||||
val code: String,
|
||||
val name: String,
|
||||
|
||||
|
||||
) {
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as CategoryTag
|
||||
|
||||
if (code != other.code) return false
|
||||
if (name != other.name) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = code.hashCode()
|
||||
result = 31 * result + name.hashCode()
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
16
src/main/kotlin/space/luminic/budgerapp/models/Tag.kt
Normal file
16
src/main/kotlin/space/luminic/budgerapp/models/Tag.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
package space.luminic.budgerapp.models
|
||||
|
||||
import org.springframework.data.annotation.Id
|
||||
import org.springframework.data.mongodb.core.mapping.DBRef
|
||||
import org.springframework.data.mongodb.core.mapping.Document
|
||||
|
||||
|
||||
|
||||
|
||||
@Document(collection = "tags")
|
||||
data class Tag(
|
||||
@Id var id: String? = null,
|
||||
@DBRef var space: Space? = null,
|
||||
var code: String,
|
||||
var name: String,
|
||||
)
|
||||
Reference in New Issue
Block a user