This commit is contained in:
xds
2025-10-16 15:06:20 +03:00
commit 040da34ff7
78 changed files with 3934 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
package space.luminic.finance.dtos
import space.luminic.finance.models.Account
import space.luminic.finance.models.Category
import space.luminic.finance.models.Transaction.TransactionKind
import space.luminic.finance.models.Transaction.TransactionType
import space.luminic.finance.models.User
import java.math.BigDecimal
import java.time.Instant
data class TransactionDTO(
val id: String? = null,
var parentId: String? = null,
val type: TransactionType = TransactionType.EXPENSE,
val kind: TransactionKind = TransactionKind.INSTANT,
val categoryId: String,
val category: CategoryDTO? = null,
val comment: String,
val amount: BigDecimal,
val fees: BigDecimal = BigDecimal.ZERO,
val fromAccount: AccountDTO? = null,
val toAccount: AccountDTO? = null,
val date: Instant,
val createdBy: String? = null,
val updatedBy: String? = null,
) {
data class CreateTransactionDTO(
val type: TransactionType = TransactionType.EXPENSE,
val kind: TransactionKind = TransactionKind.INSTANT,
val categoryId: String,
val comment: String,
val amount: BigDecimal,
val fees: BigDecimal = BigDecimal.ZERO,
val fromAccountId: String,
val toAccountId: String? = null,
val date: Instant
)
data class UpdateTransactionDTO(
val id: String,
val type: TransactionType = TransactionType.EXPENSE,
val kind: TransactionKind = TransactionKind.INSTANT,
val category: String,
val comment: String,
val amount: BigDecimal,
val fees: BigDecimal = BigDecimal.ZERO,
val fromAccountId: String,
val toAccountId: String? = null,
val date: Instant
)
}