Skip to content

Commit

Permalink
Remove support for delegate channels
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Sep 11, 2023
1 parent 001bcce commit 5ac7973
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 26 deletions.
33 changes: 14 additions & 19 deletions core/models/channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,20 @@ const (
type Channel struct {
// inner struct for privacy and so we don't collide with method names
c struct {
ID ChannelID `json:"id"`
UUID assets.ChannelUUID `json:"uuid"`
OrgID OrgID `json:"org_id"`
Parent *assets.ChannelReference `json:"parent"`
Name string `json:"name"`
Address string `json:"address"`
ChannelType ChannelType `json:"channel_type"`
TPS int `json:"tps"`
Country null.String `json:"country"`
Schemes []string `json:"schemes"`
Roles []assets.ChannelRole `json:"roles"`
MatchPrefixes []string `json:"match_prefixes"`
AllowInternational bool `json:"allow_international"`
MachineDetection bool `json:"machine_detection"`
Config map[string]any `json:"config"`
ID ChannelID `json:"id"`
UUID assets.ChannelUUID `json:"uuid"`
OrgID OrgID `json:"org_id"`
Name string `json:"name"`
Address string `json:"address"`
ChannelType ChannelType `json:"channel_type"`
TPS int `json:"tps"`
Country null.String `json:"country"`
Schemes []string `json:"schemes"`
Roles []assets.ChannelRole `json:"roles"`
MatchPrefixes []string `json:"match_prefixes"`
AllowInternational bool `json:"allow_international"`
MachineDetection bool `json:"machine_detection"`
Config map[string]any `json:"config"`
}
}

Expand Down Expand Up @@ -99,9 +98,6 @@ func (c *Channel) AllowInternational() bool { return c.c.AllowInternational }
// MachineDetection returns whether this channel should do answering machine detection (only applies to IVR)
func (c *Channel) MachineDetection() bool { return c.c.MachineDetection }

// Parent returns a reference to the parent channel of this channel (if any)
func (c *Channel) Parent() *assets.ChannelReference { return c.c.Parent }

// Config returns the config for this channel
func (c *Channel) Config() map[string]any { return c.c.Config }

Expand Down Expand Up @@ -197,7 +193,6 @@ SELECT ROW_TO_JSON(r) FROM (SELECT
c.id as id,
c.uuid as uuid,
c.org_id as org_id,
(SELECT ROW_TO_JSON(p) FROM (SELECT uuid, name FROM channels_channel cc where cc.id = c.parent_id) p) as parent,
c.name as name,
c.channel_type as channel_type,
COALESCE(c.tps, 10) as tps,
Expand Down
1 change: 0 additions & 1 deletion core/models/channels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,5 @@ func TestChannels(t *testing.T) {
assert.Equal(t, tc.Schemes, channel.Schemes())
assert.Equal(t, tc.Prefixes, channel.MatchPrefixes())
assert.Equal(t, tc.AllowInternational, channel.AllowInternational())
assert.Equal(t, tc.Parent, channel.Parent())
}
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ require (
github.com/jmoiron/sqlx v1.3.5
github.com/lib/pq v1.10.9
github.com/nyaruka/ezconf v0.2.1
github.com/nyaruka/gocommon v1.41.1
github.com/nyaruka/goflow v0.193.1
github.com/nyaruka/gocommon v1.41.2
github.com/nyaruka/goflow v0.194.0
github.com/nyaruka/logrus_sentry v0.8.2-0.20190129182604-c2962b80ba7d
github.com/nyaruka/null/v3 v3.0.0
github.com/nyaruka/redisx v0.5.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ github.com/naoina/toml v0.1.1 h1:PT/lllxVVN0gzzSqSlHEmP8MJB4MY2U7STGxiouV4X8=
github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E=
github.com/nyaruka/ezconf v0.2.1 h1:TDXWoqjqYya1uhou1mAJZg7rgFYL98EB0Tb3+BWtUh0=
github.com/nyaruka/ezconf v0.2.1/go.mod h1:ey182kYkw2MIi4XiWe1FR/mzI33WCmTWuceDYYxgnQw=
github.com/nyaruka/gocommon v1.41.1 h1:SpIXqLCBF3Un/AjzIiqC/DO4jU7Zt7SyDh/t9SyjIrQ=
github.com/nyaruka/gocommon v1.41.1/go.mod h1:cJ2XmEX+FDOzBvE19IW+hG8EFVsSrNgCp7NrxAlP4Xg=
github.com/nyaruka/goflow v0.193.1 h1:CDkf5DP4pT432LeKkJ6lnwNGWPfskWJyLKn4guysXf0=
github.com/nyaruka/goflow v0.193.1/go.mod h1:RAH+Mpv+oaKdmcC3hceeiQ9fKV9enONY0y5b8LJZcdU=
github.com/nyaruka/gocommon v1.41.2 h1:eGHOJMu9VZhnHri7XzQQax/sW5SSGS2qwS1ORt6idEo=
github.com/nyaruka/gocommon v1.41.2/go.mod h1:cJ2XmEX+FDOzBvE19IW+hG8EFVsSrNgCp7NrxAlP4Xg=
github.com/nyaruka/goflow v0.194.0 h1:7LV/f/IiGe5YXAASy10JhH4Jho6i1IYyp2xfyDaLjhE=
github.com/nyaruka/goflow v0.194.0/go.mod h1:ZC+XSZMA+R1HV3C7mfcrEYUb/SyF5BnjnonRBEPA8gM=
github.com/nyaruka/librato v1.0.0 h1:Vznj9WCeC1yZXbBYyYp40KnbmXLbEkjKmHesV/v2SR0=
github.com/nyaruka/librato v1.0.0/go.mod h1:pkRNLFhFurOz0QqBz6/DuTFhHHxAubWxs4Jx+J7yUgg=
github.com/nyaruka/logrus_sentry v0.8.2-0.20190129182604-c2962b80ba7d h1:hyp9u36KIwbTCo2JAJ+TuJcJBc+UZzEig7RI/S5Dvkc=
Expand Down

0 comments on commit 5ac7973

Please sign in to comment.