Skip to content

Commit

Permalink
feat: isArchived --> inAppSent
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWadeOddball committed Feb 19, 2024
1 parent afa561e commit 0cf49cc
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions MINT.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"info": {
"_postman_id": "ee2ccc00-fbb9-4598-ac85-34095be5a1bd",
"_postman_id": "32329f70-986e-430d-8a0b-4509ca71dab1",
"name": "MINT",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "20435042"
"_exporter_id": "20320964"
},
"item": [
{
Expand Down Expand Up @@ -2024,7 +2024,7 @@
]
},
{
"name": "Notifications",
"name": "Notfications",
"item": [
{
"name": "GetNotifications",
Expand Down Expand Up @@ -2055,7 +2055,7 @@
"body": {
"mode": "graphql",
"graphql": {
"query": "query currentUser {\n currentUser {\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n isArchived\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n discussionID\n replyID\n content\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"query": "query currentUser {\n currentUser {\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n inAppSent\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n discussionID\n replyID\n content\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"variables": ""
}
},
Expand Down Expand Up @@ -2200,7 +2200,7 @@
"body": {
"mode": "graphql",
"graphql": {
"query": "query currentUser {\n currentUser {\n launchDarkly {\n userKey\n }\n account {\n commonName\n email\n }\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n isArchived\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n discussionID\n replyID\n content\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"query": "query currentUser {\n currentUser {\n launchDarkly {\n userKey\n }\n account {\n commonName\n email\n }\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n inAppSent\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n discussionID\n replyID\n content\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"variables": "{}"
}
},
Expand Down Expand Up @@ -2232,7 +2232,7 @@
"body": {
"mode": "graphql",
"graphql": {
"query": "mutation NotificationPreferencesUpdate {\nupdateUserNotificationPreferences( changes:{\n dailyDigestComplete: IN_APP_ONLY\n \n addedAsCollaborator: ALL\n\n taggedInDiscussion: ALL\n\n taggedInDiscussionReply: ALL\n\n newDiscussionReply: ALL\n\n modelPlanShared: ALL\n\n \n\n}) {\n\n # notificationPreferences {\n dailyDigestComplete\n\n addedAsCollaborator\n\n taggedInDiscussion\n\n taggedInDiscussionReply\n\n newDiscussionReply\n\n modelPlanShared\n\n \n }\n}\n",
"query": "mutation NotificationUpdate {\nupdateUserNotificationPreferences( changes:{\n dailyDigestComplete: IN_APP_ONLY\n \n addedAsCollaborator: ALL\n\n taggedInDiscussion: ALL\n\n taggedInDiscussionReply: ALL\n\n newDiscussionReply: ALL\n\n modelPlanShared: ALL\n\n \n\n}) {\n\n dailyDigestComplete\n\n addedAsCollaborator\n\n taggedInDiscussion\n\n taggedInDiscussionReply\n\n newDiscussionReply\n\n modelPlanShared\n\n \n }\n}\n",
"variables": ""
}
},
Expand Down
2 changes: 1 addition & 1 deletion migrations/V148__Add_Notification_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ CREATE TABLE user_notification (
activity_id UUID NOT NULL REFERENCES activity(id), --foreign key to user table
user_id UUID NOT NULL REFERENCES user_account(id),
is_read BOOLEAN NOT NULL DEFAULT FALSE,
is_archived BOOLEAN NOT NULL DEFAULT FALSE,
in_app_sent BOOLEAN NOT NULL,
email_sent BOOLEAN NOT NULL,

--META DATA
Expand Down
38 changes: 19 additions & 19 deletions pkg/graph/generated/generated.go

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

2 changes: 1 addition & 1 deletion pkg/graph/schema/types/user_notification.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type UserNotification {
# activityType: ActivityType #TODO EASI-3925 #Maybe add this on this level so the FE doesn't need to query it? //TODO EASI-3925
userID: UUID! #probably not needed, it should be only visible for the user
isRead: Boolean!
isArchived: Boolean!
inAppSent: Boolean!
emailSent: Boolean!
activity: Activity! # should we nest this?
content: UserNotificationContent!
Expand Down
4 changes: 2 additions & 2 deletions pkg/models/user_notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type UserNotification struct {
// The if of the entity this notification is about
ActivityID uuid.UUID `json:"activityID" db:"activity_id"`
IsRead bool `json:"isRead" db:"is_read"`
IsArchived bool `json:"isArchived" db:"is_archived"` //TODO: EASI-3925 Switch to in_App_sent
InAppSent bool `json:"inAppSent" db:"in_app_sent"` //TODO: EASI-3925 Switch to in_App_sent
EmailSent bool `json:"emailSent" db:"email_sent"`
}

Expand All @@ -30,7 +30,7 @@ func NewUserNotification(
baseStruct: NewBaseStruct(userID),
ActivityID: activityID,
IsRead: !inAppNotification, // set to read if user doesn't want notifications
IsArchived: !inAppNotification, // set to archived if user doesn't want notifications
InAppSent: inAppNotification, // set to archived if user doesn't want notifications
EmailSent: emailNotification, // set that an email should be sent for this
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SELECT
activity_id,
user_id,
is_read,
is_archived,
in_app_sent,
email_sent,
created_by,
created_dts,
Expand Down
6 changes: 3 additions & 3 deletions pkg/sqlqueries/SQL/user_notification/create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ INSERT INTO public.user_notification(
activity_id,
user_id,
is_read,
is_archived,
in_app_sent,
email_sent,
created_by
)
Expand All @@ -12,7 +12,7 @@ VALUES (
:activity_id,
:user_id,
:is_read,
:is_archived,
:in_app_sent,
:email_sent,
:created_by
)
Expand All @@ -21,7 +21,7 @@ id,
activity_id,
user_id,
is_read,
is_archived,
in_app_sent,
email_sent,
created_by,
created_dts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ id,
activity_id,
user_id,
is_read,
is_archived,
in_app_sent,
email_sent,
created_by,
created_dts,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ id,
activity_id,
user_id,
is_read,
is_archived,
in_app_sent,
email_sent,
created_by,
created_dts,
Expand Down
2 changes: 1 addition & 1 deletion src/gql/gen/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,7 @@ export type UserNotification = {
createdDts: Scalars['Time']['output'];
emailSent: Scalars['Boolean']['output'];
id: Scalars['UUID']['output'];
isArchived: Scalars['Boolean']['output'];
inAppSent: Scalars['Boolean']['output'];
isRead: Scalars['Boolean']['output'];
modifiedBy?: Maybe<Scalars['UUID']['output']>;
modifiedByUserAccount?: Maybe<UserAccount>;
Expand Down

0 comments on commit 0cf49cc

Please sign in to comment.