Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-bate committed Nov 8, 2023
1 parent f075c22 commit 589783f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions data/types/settings/pump/pump.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down
6 changes: 5 additions & 1 deletion data/types/settings/pump/sleep_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -103,3 +105,5 @@ func (s *SleepSchedule) Validate(validator structure.Validator) {
}
}
}

func (s *SleepSchedule) Normalize(normalizer data.Normalizer) {}
3 changes: 1 addition & 2 deletions data/types/settings/pump/sleep_schedule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down

0 comments on commit 589783f

Please sign in to comment.