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.LocalDate import java.time.LocalDateTime import kotlin.collections.mutableListOf data class BudgetDTO( var id: String? = null, var space: Space? = null, var name: String, var dateFrom: LocalDate, var dateTo: LocalDate, val createdAt: LocalDateTime = LocalDateTime.now(), var plannedExpenses: MutableList? = null, var plannedIncomes: MutableList? = null, var categories: MutableList = mutableListOf(), var incomeCategories: MutableList = mutableListOf(), var transactions: MutableList? = null, ) @Document("budgets") data class Budget( @Id var id: String? = null, @DBRef var space: Space? = null, var name: String, var dateFrom: LocalDate, var dateTo: LocalDate, val createdAt: LocalDateTime = LocalDateTime.now(), var categories: MutableList = mutableListOf(), var incomeCategories: MutableList = mutableListOf(), ) data class BudgetCategory( @Transient var currentSpent: Double? = null, var currentLimit: Double, @Transient var currentPlanned: Double? = null, @DBRef var category: Category ) class BudgetNotFoundException(message: String) : NotFoundException(message)