fix recurrents

This commit is contained in:
xds
2025-02-21 01:44:03 +03:00
parent bf2dfca1cc
commit 363d926443
17 changed files with 618 additions and 1034 deletions

View File

@@ -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
}
}

View 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,
)