init
This commit is contained in:
36
src/main/kotlin/space/luminic/finance/models/Space.kt
Normal file
36
src/main/kotlin/space/luminic/finance/models/Space.kt
Normal file
@@ -0,0 +1,36 @@
|
||||
package space.luminic.finance.models
|
||||
|
||||
import org.springframework.data.annotation.CreatedBy
|
||||
import org.springframework.data.annotation.CreatedDate
|
||||
import org.springframework.data.annotation.Id
|
||||
import org.springframework.data.annotation.LastModifiedBy
|
||||
import org.springframework.data.annotation.LastModifiedDate
|
||||
import org.springframework.data.annotation.ReadOnlyProperty
|
||||
import org.springframework.data.mongodb.core.mapping.Document
|
||||
import org.springframework.data.annotation.Transient
|
||||
import java.time.Instant
|
||||
|
||||
|
||||
@Document(collection = "spaces")
|
||||
data class Space (
|
||||
@Id val id: String? = null,
|
||||
val name: String,
|
||||
val ownerId: String,
|
||||
val participantsIds: List<String> = emptyList(),
|
||||
var isDeleted: Boolean = false,
|
||||
@CreatedBy val createdById: String? = null,
|
||||
@CreatedDate val createdAt: Instant? = null,
|
||||
@LastModifiedBy val updatedById: String? = null,
|
||||
@LastModifiedDate var updatedAt: Instant? = null,
|
||||
) {
|
||||
@ReadOnlyProperty var owner: User? = null
|
||||
|
||||
@ReadOnlyProperty var participants: List<User>? = null
|
||||
|
||||
@ReadOnlyProperty var createdBy: User? = null
|
||||
|
||||
@ReadOnlyProperty var updatedBy: User? = null
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user