update duration requirement
This commit is contained in:
parent
763c0bb766
commit
82cce81d0b
2 changed files with 2 additions and 2 deletions
|
@ -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