wishlists + statics + some fixes
This commit is contained in:
39
src/main/kotlin/space/luminic/budgerapp/models/WishList.kt
Normal file
39
src/main/kotlin/space/luminic/budgerapp/models/WishList.kt
Normal file
@@ -0,0 +1,39 @@
|
||||
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
|
||||
import java.time.LocalDateTime
|
||||
|
||||
@Document(collection = "wishlists")
|
||||
data class WishList(
|
||||
@Id val id: String? = null,
|
||||
@DBRef var space: Space? = null,
|
||||
var name: String,
|
||||
var description: String,
|
||||
var isPrivate: Boolean,
|
||||
@DBRef var owner: User? = null,
|
||||
@DBRef var items: MutableList<WishListItem> = mutableListOf(),
|
||||
var updatedAt: LocalDateTime = LocalDateTime.now(),
|
||||
val createdAt: LocalDateTime = LocalDateTime.now()
|
||||
)
|
||||
|
||||
|
||||
@Document(collection = "wishlistItems")
|
||||
data class WishListItem(
|
||||
@Id val id: String? = null,
|
||||
var name: String,
|
||||
var description: String,
|
||||
var price: Double,
|
||||
var link: String,
|
||||
var images: MutableList<String> = mutableListOf(),
|
||||
var reservedBy: Reserve? = null,
|
||||
var updatedAt: LocalDateTime = LocalDateTime.now(),
|
||||
var createdAt: LocalDateTime = LocalDateTime.now()
|
||||
)
|
||||
|
||||
data class Reserve(
|
||||
val aid: String,
|
||||
val name: String? = null,
|
||||
|
||||
)
|
||||
Reference in New Issue
Block a user