Rename Label->Version, add version meta field
This commit is contained in:
@@ -43,13 +43,13 @@ sealed class ProjectEvent {
|
||||
data class Updated(val changes: HomeResponse.ProjectSummary) : ProjectEvent()
|
||||
|
||||
@Serializable
|
||||
data class NewLabel(val label: LabelResponse) : ProjectEvent()
|
||||
data class NewVersion(val label: VersionResponse) : ProjectEvent()
|
||||
|
||||
@Serializable
|
||||
data class LabelChanged(val label: LabelResponse) : ProjectEvent()
|
||||
data class VersionChanged(val label: VersionResponse) : ProjectEvent()
|
||||
|
||||
@Serializable
|
||||
data class LabelDeleted(val id: Uuid) : ProjectEvent()
|
||||
data class VersionDeleted(val id: Uuid) : ProjectEvent()
|
||||
|
||||
@Serializable
|
||||
data class NewEntry(val entry: EntryResponse) : ProjectEvent()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.jaytux.phoebench.common
|
||||
|
||||
import kotlinx.datetime.LocalDateTime
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlin.time.Instant
|
||||
import kotlin.uuid.Uuid
|
||||
@@ -23,10 +22,10 @@ data class RefreshRequest(val refreshToken: Uuid)
|
||||
data class ProjectRequest(val name: String, var isPublic: Boolean)
|
||||
|
||||
@Serializable @ToPartialize
|
||||
data class LabelRequest(val name: String, val color: String, val projectId: Uuid)
|
||||
data class VersionRequest(val name: String, val color: String, val meta: String, val projectId: Uuid)
|
||||
|
||||
@Serializable @ToPartialize
|
||||
data class EntryRequest(val label: Uuid, val timestamp: Instant, val projectId: Uuid, val warmups: List<Float>,
|
||||
data class EntryRequest(val version: Uuid, val timestamp: Instant, val projectId: Uuid, val warmups: List<Float>,
|
||||
val measurements: List<Float>, val unit: TimeUnit, val input: String, val hardware: String)
|
||||
|
||||
@Serializable
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
package com.jaytux.phoebench.common
|
||||
|
||||
import kotlinx.datetime.LocalDateTime
|
||||
import kotlinx.datetime.TimeZone
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.descriptors.PrimitiveKind
|
||||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
import kotlin.time.Instant
|
||||
import kotlin.uuid.Uuid
|
||||
|
||||
@@ -47,10 +39,10 @@ data class HomeResponse(val username: String, val isAdmin: Boolean, val projectL
|
||||
|
||||
@Serializable
|
||||
data class ProjectResponse(val id: Uuid, val name: String, val owner: NamedID, val isPublic: Boolean, val isEditable: Boolean,
|
||||
val usedLabels: List<LabelResponse>, val entries: List<EntryResponse>)
|
||||
val usedLabels: List<VersionResponse>, val entries: List<EntryResponse>)
|
||||
|
||||
@Serializable
|
||||
data class LabelResponse(val id: Uuid, val name: String, val color: String)
|
||||
data class VersionResponse(val id: Uuid, val name: String, val color: String, val meta: String)
|
||||
|
||||
@Serializable
|
||||
data class EntryResponse(val id: Uuid, val labelId: Uuid, val timestamp: Instant, val warmups: List<Float>,
|
||||
|
||||
@@ -30,10 +30,10 @@ object Routes {
|
||||
val delete = ApiRoute.deleteUuidNoRes("/project", Elevation.AUTH)
|
||||
}
|
||||
|
||||
object Label {
|
||||
val new = ApiRoute.post<LabelRequest, LabelResponse>("/label", Elevation.AUTH)
|
||||
val update = ApiRoute.patchUuidNoRes<PartialLabelRequest>("/label", Elevation.AUTH)
|
||||
val delete = ApiRoute.deleteUuidNoRes("/label", Elevation.AUTH)
|
||||
object Version {
|
||||
val new = ApiRoute.post<VersionRequest, VersionResponse>("/version", Elevation.AUTH)
|
||||
val update = ApiRoute.patchUuidNoRes<PartialVersionRequest>("/version", Elevation.AUTH)
|
||||
val delete = ApiRoute.deleteUuidNoRes("/version", Elevation.AUTH)
|
||||
}
|
||||
|
||||
object Entry {
|
||||
|
||||
Reference in New Issue
Block a user