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

[EASI-4473] Notification: Data Exchange Approach Completed #1209

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d5928f8
feat: added feature migration, data models, gql
OddTomBrooks Jul 2, 2024
c82e948
chore: updated sql queries
OddTomBrooks Jul 2, 2024
a3600a7
feat: several major improvements to first semi-functional data exchan…
OddTomBrooks Jul 3, 2024
aee9a0f
chore: updated postman collection to get all notifications
OddTomBrooks Jul 3, 2024
d01f101
chore: updated frontend gql and backend gql for user notification pre…
OddTomBrooks Jul 3, 2024
d52fdee
chore: added simple resolver helper to dispatch emails and email test…
OddTomBrooks Jul 3, 2024
db22226
chore: removed resolved question
OddTomBrooks Jul 5, 2024
a8dab47
chore: Reset all frontend files to main branch as we split the fronte…
OddTomBrooks Jul 5, 2024
58a62c2
chore: reran gql gen
OddTomBrooks Jul 5, 2024
ac4cb5b
Merge branch 'main' into feature/EASI-4473_notif_data_exchange_approa…
OddTomBrooks Jul 5, 2024
a86a8c9
chore: email unit test for data exchange approach completed
OddTomBrooks Jul 5, 2024
d97ab3c
Merge branch 'feature/EASI-4473_notif_data_exchange_approach_complete…
OddTomBrooks Jul 5, 2024
2e81438
chore: removed unnecessary Scan and Value methods
OddTomBrooks Jul 10, 2024
834c34d
chore: added unit test for activity data exchange complete notification
OddTomBrooks Jul 11, 2024
e401f1d
chore: implemented resolver for data exchange approach completed noti…
OddTomBrooks Jul 11, 2024
52ceb84
fix: updated various test definitions to match new user account prefe…
OddTomBrooks Jul 11, 2024
8a9d37c
chore: removed outdated comment
OddTomBrooks Jul 12, 2024
2e42900
chore: updated postman collection renaming markedCompletedBy -> marke…
OddTomBrooks Jul 12, 2024
cff7c48
chore: converted data exchange approach complete meta to id
OddTomBrooks Jul 16, 2024
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
1,540 changes: 295 additions & 1,245 deletions pkg/graph/generated/generated.go

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions pkg/graph/resolvers/activity.resolvers.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/resolvers/data_exchange_approach_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func SendDataExchangeApproachCompletedNotification(
actorID,
np,
inAppPreferences,
approach,
approach.ID,
markedCompletedBy,
)
if err != nil {
Expand Down
18 changes: 1 addition & 17 deletions pkg/graph/schema/types/activity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -114,26 +114,10 @@ type DatesChangedActivityMeta {
dateChanges: [DateChange!]!
}

# TODO: Change from this dummy type to the actual type when it is defined
type DataExchangeApproach {
id: UUID!
name: String!
description: String
isComplete: Boolean!
modelPlanID: UUID!
modelPlan: ModelPlan!
createdBy: UUID!
createdByUserAccount: UserAccount!
createdDts: Time!
modifiedBy: UUID
modifiedByUserAccount: UserAccount
modifiedDts: Time
}

type DataExchangeApproachCompletedActivityMeta {
version: Int!
type: ActivityType!
dataExchangeApproach: DataExchangeApproach!
dataExchangeApproachID: UUID!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for this meta, we'd want both the ID, and the dataloader result to return the actually approach. Might be good to just add as a todo in the feature branch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(so that the front end can access the actual data if needed)

markedCompleteBy: UUID!
markedCompleteByUserAccount: UserAccount!
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/models/data_exchange_approach_completed_activity_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ import (
// is relevant to completing a Data Exchange Approach
type DataExchangeApproachCompletedActivityMeta struct {
ActivityMetaBaseStruct
DataExchangeApproach *DataExchangeApproach `json:"dataExchangeApproach"`
MarkedCompleteBy uuid.UUID `json:"markedCompleteBy"`
DataExchangeApproachID uuid.UUID `json:"dataExchangeApproachID"`
MarkedCompleteBy uuid.UUID `json:"markedCompleteBy"`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note I think we probably want to the model_plan_id stored here too.


// newDataExchangeApproachCompletedActivityMeta creates a new DataExchangeApproachCompletedActivityMeta
func newDataExchangeApproachCompletedActivityMeta(
dataExchangeApproach *DataExchangeApproach,
dataExchangeApproachID uuid.UUID,
markedCompleteBy uuid.UUID,
) *DataExchangeApproachCompletedActivityMeta {
version := 0 // iterate this if this type ever updates
return &DataExchangeApproachCompletedActivityMeta{
ActivityMetaBaseStruct: NewActivityMetaBaseStruct(ActivityDataExchangeApproachCompleted, version),
DataExchangeApproach: dataExchangeApproach,
DataExchangeApproachID: dataExchangeApproachID,
MarkedCompleteBy: markedCompleteBy,
}
}

// NewDataExchangeApproachCompletedActivity creates a new Data Exchange Approach Complete type of Activity
func NewDataExchangeApproachCompletedActivity(
actorID uuid.UUID,
dataExchangeApproach *DataExchangeApproach,
dataExchangeApproachID uuid.UUID,
markedCompleteBy uuid.UUID,
) *Activity {
return &Activity{
Expand All @@ -39,7 +39,7 @@ func NewDataExchangeApproachCompletedActivity(
EntityID: markedCompleteBy,
ActivityType: ActivityDataExchangeApproachCompleted,
MetaData: newDataExchangeApproachCompletedActivityMeta(
dataExchangeApproach,
dataExchangeApproachID,
markedCompleteBy,
),
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/notifications/data_exchange_approach_completed.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ func ActivityDataExchangeApproachCompletedCreate(
actorID uuid.UUID,
np sqlutils.NamedPreparer,
receivers []*models.UserAccountAndNotificationPreferences,
approach *models.DataExchangeApproach,
approachID uuid.UUID,
markedCompletedBy uuid.UUID,
) (*models.Activity, error) {

activity := models.NewDataExchangeApproachCompletedActivity(
actorID,
approach,
approachID,
markedCompletedBy,
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/notifications/data_exchange_approach_completed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (suite *NotificationsSuite) TestActivityDataExchangeApproachCompletedCreate
actorID,
suite.testConfigs.Store,
receivers,
approach,
approach.ID,
approachMarkedCompleteBy.Account().ID,
)

Expand Down
18 changes: 1 addition & 17 deletions src/gql/gen/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,25 +292,9 @@ export type DailyDigestCompleteActivityMeta = {
version: Scalars['Int']['output'];
};

export type DataExchangeApproach = {
__typename: 'DataExchangeApproach';
createdBy: Scalars['UUID']['output'];
createdByUserAccount: UserAccount;
createdDts: Scalars['Time']['output'];
description?: Maybe<Scalars['String']['output']>;
id: Scalars['UUID']['output'];
isComplete: Scalars['Boolean']['output'];
modelPlan: ModelPlan;
modelPlanID: Scalars['UUID']['output'];
modifiedBy?: Maybe<Scalars['UUID']['output']>;
modifiedByUserAccount?: Maybe<UserAccount>;
modifiedDts?: Maybe<Scalars['Time']['output']>;
name: Scalars['String']['output'];
};

export type DataExchangeApproachCompletedActivityMeta = {
__typename: 'DataExchangeApproachCompletedActivityMeta';
dataExchangeApproach: DataExchangeApproach;
dataExchangeApproachID: Scalars['UUID']['output'];
markedCompleteBy: Scalars['UUID']['output'];
markedCompleteByUserAccount: UserAccount;
type: ActivityType;
Expand Down
Loading