update duration requirement
This commit is contained in:
parent
763c0bb766
commit
82cce81d0b
|
@ -45,8 +45,7 @@ data class TemporaryBasal(
|
||||||
) : TraceableDBEntry, DBEntryWithTimeAndDuration {
|
) : TraceableDBEntry, DBEntryWithTimeAndDuration {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
if (duration <= 0)
|
require(duration > 0)
|
||||||
require(duration > 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class Type {
|
enum class Type {
|
||||||
|
|
|
@ -8,6 +8,7 @@ var DBEntryWithTimeAndDuration.end
|
||||||
get() = timestamp + duration
|
get() = timestamp + duration
|
||||||
set(value) {
|
set(value) {
|
||||||
duration = value - timestamp
|
duration = value - timestamp
|
||||||
|
require(duration > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
|
|
Loading…
Reference in a new issue