Implements adding an item to a hunt
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user