From d302e6eb55f648144339260bd678b4e3195eb3bd Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 14 Sep 2023 18:16:58 +0200 Subject: [PATCH] NSC: fix sync of recordonly boluses --- .../info/nightscout/interfaces/pump/DetailedBolusInfo.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt index a79a7a2fda..ef312238e2 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt +++ b/core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt @@ -5,6 +5,7 @@ import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.pump.defs.PumpType class DetailedBolusInfo { @@ -97,6 +98,9 @@ class DetailedBolusInfo { glucoseType = glucoseType?.toDbMeterType() ) + /** + * Used for create record going directly to db (record only) + */ fun createBolus(): Bolus = if (insulin != 0.0) Bolus( @@ -104,6 +108,7 @@ class DetailedBolusInfo { amount = insulin, type = bolusType.toDBbBolusType(), notes = notes, + interfaceIDs_backing = InterfaceIDs(pumpId = timestamp) ) else throw IllegalStateException("insulin == 0.0") @@ -113,7 +118,7 @@ class DetailedBolusInfo { timestamp = carbsTimestamp ?: timestamp, amount = carbs, duration = carbsDuration, - notes = notes, + notes = notes ) else throw IllegalStateException("carbs == 0.0")