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 = 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? = null @ReadOnlyProperty var createdBy: User? = null @ReadOnlyProperty var updatedBy: User? = null }