init
This commit is contained in:
52
src/main/kotlin/space/luminic/finance/dtos/TransactionDTO.kt
Normal file
52
src/main/kotlin/space/luminic/finance/dtos/TransactionDTO.kt
Normal 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
|
||||
)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user