Files
luminic-space-back-v2/src/main/kotlin/space/luminic/finance/models/Space.kt
2025-10-16 15:06:20 +03:00

36 lines
1.1 KiB
Kotlin

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
}