diff --git a/data/types/settings/pump/pump.go b/data/types/settings/pump/pump.go index 9bbaed686..7b09e2a95 100644 --- a/data/types/settings/pump/pump.go +++ b/data/types/settings/pump/pump.go @@ -263,6 +263,9 @@ func (p *Pump) Normalize(normalizer data.Normalizer) { if p.OverridePresets != nil { p.OverridePresets.Normalize(normalizer.WithReference("overridePresets"), unitsBloodGlucose) } + if p.SleepSchedules != nil { + p.SleepSchedules.Normalize(normalizer.WithReference("sleepSchedules")) + } if p.Units != nil { p.Units.Normalize(normalizer.WithReference("units")) } diff --git a/data/types/settings/pump/sleep_schedule.go b/data/types/settings/pump/sleep_schedule.go index 4608eabf4..0da251b14 100644 --- a/data/types/settings/pump/sleep_schedule.go +++ b/data/types/settings/pump/sleep_schedule.go @@ -3,9 +3,9 @@ package pump import ( "sort" + "github.com/tidepool-org/platform/data" "github.com/tidepool-org/platform/data/types/common" "github.com/tidepool-org/platform/structure" - structureValidator "github.com/tidepool-org/platform/structure/validator" ) @@ -46,6 +46,8 @@ func (s *SleepScheduleMap) Validate(validator structure.Validator) { } } +func (s *SleepScheduleMap) Normalize(normalizer data.Normalizer) {} + func (s *SleepScheduleMap) Get(name string) *SleepSchedule { if datum, exists := (*s)[name]; exists { return datum @@ -103,3 +105,5 @@ func (s *SleepSchedule) Validate(validator structure.Validator) { } } } + +func (s *SleepSchedule) Normalize(normalizer data.Normalizer) {} diff --git a/data/types/settings/pump/sleep_schedule_test.go b/data/types/settings/pump/sleep_schedule_test.go index 2aa630452..3c0f2d7b3 100644 --- a/data/types/settings/pump/sleep_schedule_test.go +++ b/data/types/settings/pump/sleep_schedule_test.go @@ -8,10 +8,9 @@ import ( dataTypesCommon "github.com/tidepool-org/platform/data/types/common" dataTypesSettingsPump "github.com/tidepool-org/platform/data/types/settings/pump" - "github.com/tidepool-org/platform/pointer" - dataTypesSettingsPumpTest "github.com/tidepool-org/platform/data/types/settings/pump/test" errorsTest "github.com/tidepool-org/platform/errors/test" + "github.com/tidepool-org/platform/pointer" structureValidator "github.com/tidepool-org/platform/structure/validator" "github.com/tidepool-org/platform/test" ) diff --git a/data/types/settings/pump/test/sleep_scheduled.go b/data/types/settings/pump/test/sleep_schedule.go similarity index 99% rename from data/types/settings/pump/test/sleep_scheduled.go rename to data/types/settings/pump/test/sleep_schedule.go index 66c4112bc..bc8c54799 100644 --- a/data/types/settings/pump/test/sleep_scheduled.go +++ b/data/types/settings/pump/test/sleep_schedule.go @@ -3,9 +3,8 @@ package test import ( "fmt" - dataTypesSettingsPump "github.com/tidepool-org/platform/data/types/settings/pump" - dataTypesCommon "github.com/tidepool-org/platform/data/types/common" + dataTypesSettingsPump "github.com/tidepool-org/platform/data/types/settings/pump" "github.com/tidepool-org/platform/pointer" "github.com/tidepool-org/platform/test" )