Adds various team endpoints

This commit is contained in:
2026-05-12 10:10:55 -05:00
parent 46a78bfc08
commit fd754a7ee7
13 changed files with 182 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
package net.halfbinary.scavengerhuntapi.model
enum class FoundStatus {
NOT_FOUND,
SUBMITTED,
APPROVED,
REJECTED,

View File

@@ -7,4 +7,6 @@ typealias HuntId = UUID
typealias HunterId = UUID
typealias ItemId = UUID
typealias TeamId = UUID
typealias RefreshId = UUID
typealias RefreshId = UUID
typealias TeamHuntId = UUID
typealias PhotoId = UUID

View File

@@ -0,0 +1,16 @@
package net.halfbinary.scavengerhuntapi.model.converter
import net.halfbinary.scavengerhuntapi.model.domain.Team
import net.halfbinary.scavengerhuntapi.model.domain.TeamHunt
import net.halfbinary.scavengerhuntapi.model.record.TeamHuntRecord
import net.halfbinary.scavengerhuntapi.model.record.TeamRecord
import net.halfbinary.scavengerhuntapi.model.request.TeamRequest
import net.halfbinary.scavengerhuntapi.model.response.TeamResponse
fun TeamHunt.toRecord(): TeamHuntRecord {
return TeamHuntRecord(id, teamId, huntId)
}
fun TeamHuntRecord.toDomain(): TeamHunt {
return TeamHunt(id, teamId, huntId)
}

View File

@@ -0,0 +1,12 @@
package net.halfbinary.scavengerhuntapi.model.domain
import net.halfbinary.scavengerhuntapi.model.HuntId
import net.halfbinary.scavengerhuntapi.model.TeamHuntId
import net.halfbinary.scavengerhuntapi.model.TeamId
import java.util.UUID
data class TeamHunt(
val id: TeamHuntId = TeamHuntId.randomUUID(),
val teamId: TeamId,
val huntId: HuntId
)

View File

@@ -4,6 +4,7 @@ import jakarta.persistence.Entity
import jakarta.persistence.Id
import jakarta.persistence.Table
import net.halfbinary.scavengerhuntapi.model.HuntId
import net.halfbinary.scavengerhuntapi.model.TeamHuntId
import net.halfbinary.scavengerhuntapi.model.TeamId
import java.util.*
@@ -11,7 +12,7 @@ import java.util.*
@Table(name = "team_hunt")
data class TeamHuntRecord(
@Id
val id: UUID,
val id: TeamHuntId,
val teamId: TeamId,
val huntId: HuntId
)

View File

@@ -0,0 +1,9 @@
package net.halfbinary.scavengerhuntapi.model.request
import jakarta.validation.constraints.NotBlank
import net.halfbinary.scavengerhuntapi.model.TeamId
data class JoinTeamRequest(
@field:NotBlank
val teamId: TeamId
)

View File

@@ -0,0 +1,10 @@
package net.halfbinary.scavengerhuntapi.model.response
import net.halfbinary.scavengerhuntapi.model.PhotoId
import java.time.LocalDateTime
data class PhotoResponse(
val id: PhotoId,
val hunterName: String,
val photoUploadDateTime: LocalDateTime
)

View File

@@ -0,0 +1,11 @@
package net.halfbinary.scavengerhuntapi.model.response
import net.halfbinary.scavengerhuntapi.model.FoundStatus
import net.halfbinary.scavengerhuntapi.model.ItemId
data class TeamItemResponse(
val id: ItemId,
val itemName: String,
val hunterName: String,
val itemFoundStatus: FoundStatus
)