14 lines
596 B
Kotlin
14 lines
596 B
Kotlin
package net.halfbinary.scavengerhuntapi.model.converter
|
|
|
|
import net.halfbinary.scavengerhuntapi.model.domain.Item
|
|
import net.halfbinary.scavengerhuntapi.model.record.ItemRecord
|
|
import net.halfbinary.scavengerhuntapi.model.request.ItemRequest
|
|
import net.halfbinary.scavengerhuntapi.model.response.ItemResponse
|
|
|
|
fun ItemRequest.toDomain() = Item(name = name, points = points)
|
|
|
|
fun Item.toRecord() = ItemRecord(id = id, name = name, points = points)
|
|
|
|
fun ItemRecord.toDomain() = Item(id = id, name = name, points = points)
|
|
|
|
fun Item.toResponse() = ItemResponse(id = id, name = name, points = points) |