Implements adding an item to a hunt

This commit is contained in:
2026-05-13 15:47:03 -05:00
parent 46132bb4fd
commit 30c66527b9
7 changed files with 76 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
package net.halfbinary.scavengerhuntapi.model.converter
import net.halfbinary.scavengerhuntapi.model.domain.HuntItem
import net.halfbinary.scavengerhuntapi.model.record.HuntItemRecord
fun HuntItem.toRecord() = HuntItemRecord(id = id, huntId = huntId, itemId = itemId)
fun HuntItemRecord.toDomain() = HuntItem(id = id, huntId = huntId, itemId = itemId)

View File

@@ -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)