22 lines
619 B
Kotlin
22 lines
619 B
Kotlin
package net.halfbinary.scavengerhuntapi.model.converter
|
|
|
|
import net.halfbinary.scavengerhuntapi.model.domain.Hunter
|
|
import net.halfbinary.scavengerhuntapi.model.record.HunterRecord
|
|
import net.halfbinary.scavengerhuntapi.model.request.HunterSignupRequest
|
|
|
|
fun HunterSignupRequest.toDomain(): Hunter {
|
|
return Hunter(
|
|
email = email,
|
|
name = name,
|
|
password = password,
|
|
isAdmin = false
|
|
)
|
|
}
|
|
|
|
fun Hunter.toRecord(): HunterRecord {
|
|
return HunterRecord(id, email, name, password, isAdmin)
|
|
}
|
|
|
|
fun HunterRecord.toDomain(): Hunter {
|
|
return Hunter(id, email, name, password, isAdmin)
|
|
} |