Skip to content

Commit 7dd2b72

Browse files
committed
Update OuraUser
1 parent 3ff14d0 commit 7dd2b72

File tree

1 file changed

+3
-1
lines changed
  • oura-library/src/main/kotlin/org/radarbase/oura/user

1 file changed

+3
-1
lines changed

oura-library/src/main/kotlin/org/radarbase/oura/user/OuraUser.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ data class OuraUser(
1818
@JsonProperty("startDate") override val startDate: Instant,
1919
@JsonProperty("endDate") override val endDate: Instant,
2020
@JsonProperty("version") override val version: String? = null,
21-
@JsonProperty("serviceUserId") override val serviceUserId: String? = null,
21+
@JsonProperty("serviceUserId") override val serviceUserId: String,
2222
) : User {
2323
override val observationKey: ObservationKey = ObservationKey(projectId, userId, sourceId)
2424
override val versionedId: String = "$id${version?.let { "#$it" } ?: ""}"
25+
26+
fun isComplete() = isAuthorized && startDate.isBefore(endDate)
2527
}

0 commit comments

Comments
 (0)