init
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package space.luminic.finance.mappers
|
||||
|
||||
import space.luminic.finance.dtos.TransactionDTO
|
||||
import space.luminic.finance.dtos.TransactionDTO.CreateTransactionDTO
|
||||
import space.luminic.finance.dtos.TransactionDTO.UpdateTransactionDTO
|
||||
import space.luminic.finance.mappers.AccountMapper.toDto
|
||||
import space.luminic.finance.mappers.CategoryMapper.toDto
|
||||
import space.luminic.finance.mappers.UserMapper.toDto
|
||||
import space.luminic.finance.models.Transaction
|
||||
|
||||
object TransactionMapper {
|
||||
fun Transaction.toDto() = TransactionDTO(
|
||||
id = this.id,
|
||||
parentId = this.parentId,
|
||||
type = this.type,
|
||||
kind = this.kind,
|
||||
categoryId = this.categoryId,
|
||||
category = this.category?.toDto(),
|
||||
comment = this.comment,
|
||||
amount = this.amount,
|
||||
fees = this.fees,
|
||||
fromAccount = this.fromAccount?.toDto(),
|
||||
toAccount = this.toAccount?.toDto(),
|
||||
date = this.date,
|
||||
createdBy = this.createdBy?.username,
|
||||
updatedBy = this.updatedBy?.username,
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user