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(destinations): expose destination guid #1096

Merged
merged 2 commits into from
Feb 28, 2024
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
6 changes: 6 additions & 0 deletions pkg/notifications/destinations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var (
user = "test-user"
accountId = 1
id = "7463c367-6d61-416b-9aac-47f4a285fe5a"
guid = "MXxBSU9QU3xERVNUSU5BVElPTnw3NDYzYzM2Ny02ZDYxLTQxNmItOWFhYy00N2Y0YTI4NWZlNWE="
name = "test-notification-destination-1"

testCreateDestinationResponseJSON = `{
Expand All @@ -33,6 +34,7 @@ var (
},
"createdAt": "2022-07-10T11:10:43.123715Z",
"id": "7463c367-6d61-416b-9aac-47f4a285fe5a",
"guid": "MXxBSU9QU3xERVNUSU5BVElPTnw3NDYzYzM2Ny02ZDYxLTQxNmItOWFhYy00N2Y0YTI4NWZlNWE=",
"isUserAuthenticated": false,
"lastSent": "2022-07-10T11:10:43.123715Z",
"name": "test-notification-destination-1",
Expand Down Expand Up @@ -79,6 +81,7 @@ var (
},
"createdAt": "2022-07-10T11:10:43.123715Z",
"id": "7463c367-6d61-416b-9aac-47f4a285fe5a",
"guid": "MXxBSU9QU3xERVNUSU5BVElPTnw3NDYzYzM2Ny02ZDYxLTQxNmItOWFhYy00N2Y0YTI4NWZlNWE=",
"isUserAuthenticated": false,
"lastSent": "2022-07-10T11:10:43.123715Z",
"name": "test-notification-destination-1",
Expand Down Expand Up @@ -143,6 +146,7 @@ func TestCreateDestination(t *testing.T) {
Auth: auth,
CreatedAt: timestamp,
ID: id,
GUID: EntityGUID(guid),
IsUserAuthenticated: false,
LastSent: timestamp,
Name: "test-notification-destination-1",
Expand Down Expand Up @@ -188,6 +192,7 @@ func TestGetDestinations(t *testing.T) {
Auth: auth,
CreatedAt: timestamp,
ID: id,
GUID: EntityGUID(guid),
IsUserAuthenticated: false,
LastSent: timestamp,
Name: "test-notification-destination-1",
Expand Down Expand Up @@ -242,6 +247,7 @@ func TestGetDestinationsByName(t *testing.T) {
Auth: auth,
CreatedAt: timestamp,
ID: id,
GUID: EntityGUID(guid),
IsUserAuthenticated: false,
LastSent: timestamp,
Name: "test-notification-destination-1",
Expand Down
3 changes: 3 additions & 0 deletions pkg/notifications/notifications_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/notifications/notifications_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestNotificationMutationDestination(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, getDestinationResult)
assert.Equal(t, 1, getDestinationResult.TotalCount)
require.NotEmpty(t, getDestinationResult.Entities[0].GUID)

// Test: Update Destination
updateDestination := AiNotificationsDestinationUpdate{}
Expand Down
5 changes: 5 additions & 0 deletions pkg/notifications/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ type AiNotificationsDestination struct {
CreatedAt nrtime.DateTime `json:"createdAt"`
// Destination id
ID string `json:"id"`
// Entity Id of the destination
GUID EntityGUID `json:"guid"`
// Indicates whether the user is authenticated with the destination
IsUserAuthenticated bool `json:"isUserAuthenticated"`
// Last time a notification was sent
Expand All @@ -712,6 +714,9 @@ type AiNotificationsDestination struct {
UpdatedBy int `json:"updatedBy"`
}

// EntityGUID - An encoded Entity GUID
type EntityGUID string

// AiNotificationsDestinationFilter - Filter destination object
type AiNotificationsDestinationFilter struct {
// active
Expand Down
Loading