Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Remove Notify out of Device DTO/Model #807

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dtos/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ type UpdateDevice struct {
Location interface{} `json:"location"`
AutoEvents []AutoEvent `json:"autoEvents" validate:"dive"`
Protocols map[string]ProtocolProperties `json:"protocols" validate:"omitempty,gt=0"`
Notify *bool `json:"notify"`
Tags map[string]any `json:"tags"`
Properties map[string]any `json:"properties"`
}
Expand Down Expand Up @@ -102,7 +101,6 @@ func FromDeviceModelToUpdateDTO(d models.Device) UpdateDevice {
AutoEvents: FromAutoEventModelsToDTOs(d.AutoEvents),
Protocols: FromProtocolModelsToDTOs(d.Protocols),
Labels: d.Labels,
Notify: &d.Notify,
Tags: d.Tags,
Properties: d.Properties,
}
Expand Down
3 changes: 0 additions & 3 deletions dtos/requests/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ func ReplaceDeviceModelFieldsWithDTO(device *models.Device, patch dtos.UpdateDev
if patch.Protocols != nil {
device.Protocols = dtos.ToProtocolModels(patch.Protocols)
}
if patch.Notify != nil {
device.Notify = *patch.Notify
}
if patch.Tags != nil {
device.Tags = patch.Tags
}
Expand Down
1 change: 0 additions & 1 deletion dtos/requests/device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ func TestUpdateDeviceRequest_UnmarshalJSON_NilField(t *testing.T) {
assert.Nil(t, req.Device.Location)
assert.Nil(t, req.Device.AutoEvents)
assert.Nil(t, req.Device.Protocols)
assert.Nil(t, req.Device.Notify)
assert.Nil(t, req.Device.Tags)
assert.Nil(t, req.Device.Properties)
}
Expand Down
1 change: 0 additions & 1 deletion models/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type Device struct {
ServiceName string
ProfileName string
AutoEvents []AutoEvent
Notify bool
Tags map[string]any
Properties map[string]any
}
Expand Down