With the #93 the model PumpHistoryEvent is modified to add external insulin Type and a isExternalInsulin boolean :
struct
type
However, when a external insulin is added with the interface, only the externalInsulin bool is defined to true (the type = bolus and no externalInsulin) :
I also found a function never used by any code where isExternalInsulin = true
My proposal will be to remove the externalInsulin Type in Event Type and create a specific type enum for NS, avoid to have inconsistent between type and isExtrernalInsulin attribue.
With the #93 the model PumpHistoryEvent is modified to add external insulin Type and a isExternalInsulin boolean :
However, when a external insulin is added with the interface, only the externalInsulin bool is defined to true (the type = bolus and no externalInsulin) :![CleanShot 2024-04-14 at 11 24 50](https://github.com/nightscout/Open-iAPS/assets/4339604/0a728382-f8f1-4c04-90d8-e8a8bb71fb19)
I also found a function never used by any code where isExternalInsulin = true![CleanShot 2024-04-14 at 11 22 52](https://github.com/nightscout/Open-iAPS/assets/4339604/64f8d4d2-4592-45b7-bec6-93aa569589bc)
The externalInsulinType is used by NS (and only by NS) to build a nightscoutTreatement object with a function to deduce the type : https://github.com/nightscout/Open-iAPS/blob/8ebd52a69612977cf705c5843d71250eb23bb009/FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift#L260
My proposal will be to remove the externalInsulin Type in Event Type and create a specific type enum for NS, avoid to have inconsistent between type and isExtrernalInsulin attribue.