Adds login ability, error handling, and logging (#1)

Reviewed-on: #1
Co-authored-by: aarbit <aarbit@gmail.com>
Co-committed-by: aarbit <aarbit@gmail.com>
This commit was merged in pull request #1.
This commit is contained in:
2025-12-19 05:15:18 +00:00
committed by aarbit
parent 302feeab1e
commit 04b61485ea
13 changed files with 155 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ 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
import net.halfbinary.scavengerhuntapi.model.response.LoginResponse
fun HunterSignupRequest.toDomain(): Hunter {
return Hunter(
@@ -15,4 +16,12 @@ fun HunterSignupRequest.toDomain(): Hunter {
fun Hunter.toRecord(): HunterRecord {
return HunterRecord(id, email, name, password, isAdmin)
}
fun HunterRecord.toDomain(): Hunter {
return Hunter(id, email, name, password, isAdmin)
}
fun Hunter.toLoginResponse(): LoginResponse {
return LoginResponse(email, name)
}

View File

@@ -0,0 +1,8 @@
package net.halfbinary.scavengerhuntapi.model.converter
import net.halfbinary.scavengerhuntapi.model.domain.Login
import net.halfbinary.scavengerhuntapi.model.request.LoginRequest
fun LoginRequest.toDomain(): Login {
return Login(email, password)
}