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

Conversation

OddTomBrooks
Copy link
Contributor

@OddTomBrooks OddTomBrooks commented Jul 2, 2024

EASI-4473

Description

  • SQL Store methods
  • GQL
  • Added activity type
  • Unit test (activity)
  • Unit test (email)
  • Seeding test / email dispatch
  • Router helper function for integration with data exchange implementation

How to test this change

  • Validate unit tests by running scripts/dev test:go
  • Validate footers for email recipients and no footers for MINT Team email
  • Use Get Notification endpoint on Postman to validate Notification data

PR Author Checklist

  • I have provided a detailed description of the changes in this PR.
  • I have provided clear instructions on how to test the changes in this PR.
  • I have updated tests or written new tests as appropriate in this PR.
  • Updated the Postman Collection if necessary.

PR Reviewer Guidelines

  • It's best to pull the branch locally and test it, rather than just looking at the code online!
  • When approving a PR, provide a reason why you're approving it
    • e.g. "Approving because I tested it locally and all functionality works as expected"
    • e.g. "Approving because the change is simple and matches the Figma design"
  • Don't be afraid to leave comments or ask questions, especially if you don't understand why something was done! (This is often a great time to suggest code comments or documentation updates)
  • Check that all code is adequately covered by tests - if it isn't feel free to suggest the addition of tests.

@OddTomBrooks OddTomBrooks marked this pull request as ready for review July 7, 2024 05:47
@OddTomBrooks OddTomBrooks requested review from a team as code owners July 7, 2024 05:47
@OddTomBrooks OddTomBrooks requested review from StevenWadeOddball and patrickseguraoddball and removed request for a team July 7, 2024 05:47
@OddTomBrooks
Copy link
Contributor Author

Do not merge until frontend implementation is integrated into this PR

Failed tests are due to pending frontend implementation

pkg/models/data_exchange_approach.go Outdated Show resolved Hide resolved
pkg/models/data_exchange_approach.go Show resolved Hide resolved
pkg/graph/schema/types/activity.graphql Outdated Show resolved Hide resolved
pkg/graph/resolvers/data_exchange_approach_helper.go Outdated Show resolved Hide resolved
MINT.postman_collection.json Show resolved Hide resolved
@StevenWadeOddball
Copy link
Contributor

I forgot to note! I also verified the email and it looks good, thanks @OddTomBrooks!

@OddTomBrooks OddTomBrooks changed the base branch from main to NOREF/data_exchange_approach July 12, 2024 03:46
@OddTomBrooks OddTomBrooks merged commit 3d4e8b1 into NOREF/data_exchange_approach Jul 16, 2024
8 of 11 checks passed
@OddTomBrooks OddTomBrooks deleted the feature/EASI-4473_notif_data_exchange_approach_complete branch July 16, 2024 09:47
Copy link
Contributor

@StevenWadeOddball StevenWadeOddball left a comment

Choose a reason for hiding this comment

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

Thanks Tom, I added a couple notes about the notification that can be picked up when this is handled again. I don't think it makes sense to implement anything until the final designs are complete, but I wanted to note this feedback for when it is picked up again.

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)

@@ -63,7 +62,7 @@ func (r *userNotificationPreferencesResolver) DatesChanged(ctx context.Context,

// DataExchangeApproachCompleted is the resolver for the dataExchangeApproachCompleted field.
func (r *userNotificationPreferencesResolver) DataExchangeApproachCompleted(ctx context.Context, obj *models.UserNotificationPreferences) ([]models.UserNotificationPreferenceFlag, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably get some attention when it is picked up again. I'm not sure why it should be creating a resolver instead of auto mapping... 🤔

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.

OddTomBrooks added a commit that referenced this pull request Oct 2, 2024
* feat: added feature migration, data models, gql

* chore: updated sql queries

* feat: several major improvements to first semi-functional data exchange approach in-app notification

* chore: updated postman collection to get all notifications

* chore: updated frontend gql and backend gql for user notification preferences

* chore: added simple resolver helper to dispatch emails and email test to validate email templates

* chore: removed resolved question

* chore: Reset all frontend files to main branch as we split the frontend work to EASI-4491

* chore: reran gql gen

* fix: forcing a commit for rebasing purposes

* chore: removed tmp file

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

* feat: added feature migration, data models, gql

* chore: updated sql queries

* feat: several major improvements to first semi-functional data exchange approach in-app notification

* chore: updated postman collection to get all notifications

* chore: updated frontend gql and backend gql for user notification preferences

* chore: added simple resolver helper to dispatch emails and email test to validate email templates

* chore: removed resolved question

* chore: Reset all frontend files to main branch as we split the frontend work to EASI-4491

* chore: reran gql gen

* chore: email unit test for data exchange approach completed

* chore: removed unnecessary Scan and Value methods

* chore: added unit test for activity data exchange complete notification

* chore: implemented resolver for data exchange approach completed notification preferences

* fix: updated various test definitions to match new user account preferences spec

* chore: removed outdated comment

* chore: updated postman collection renaming markedCompletedBy -> markedCompleteBy

* chore: converted data exchange approach complete meta to id

* chore: updated migration version

* wip: data exchange approach

* wip: data exchange approach gql, store, and resolvers

* feat: working data exchange approach creation and updates

* feat: several feedback elements implemented

* chore: implementing PR feedback

* chore: implementing PR feedback

* wip: marked complete by user account and dts tracking

* feat: first working version of plan data exchange approach

* chore: ran linter and fixed cache helper reference

* run eslint

* fix: corrected cyclic dependency and several linter guidances

* merging changes

* ran sql fluff linter on migrations

* run lint

* fix: restructed logic for is marked complete to utilize null state of MarkedByDts rather than explicit boolean field

* feat: added status handling

* chore: corrected file name

* chore: removed old debug print

* fix: fixed lagging status

* fix: added status to sql queries

* fix: corrected enum references from COMPLETE to COMPELETED

* chore: removed delete logic for dea

* chore: refactored IsDataExchangeApproachComplete resolver

* chore: updated enum to READY to conform more closely with other task list sections

---------

Co-authored-by: ClayBenson94 <clay.benson@oddball.io>
Co-authored-by: Steven Wade <steven.wade@oddball.io>
patrickseguraoddball added a commit that referenced this pull request Oct 3, 2024
* feat: added feature migration, data models, gql

* chore: updated sql queries

* feat: several major improvements to first semi-functional data exchange approach in-app notification

* chore: updated postman collection to get all notifications

* chore: updated frontend gql and backend gql for user notification preferences

* chore: added simple resolver helper to dispatch emails and email test to validate email templates

* chore: removed resolved question

* chore: Reset all frontend files to main branch as we split the frontend work to EASI-4491

* chore: reran gql gen

* fix: forcing a commit for rebasing purposes

* chore: removed tmp file

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

* feat: added feature migration, data models, gql

* chore: updated sql queries

* feat: several major improvements to first semi-functional data exchange approach in-app notification

* chore: updated postman collection to get all notifications

* chore: updated frontend gql and backend gql for user notification preferences

* chore: added simple resolver helper to dispatch emails and email test to validate email templates

* chore: removed resolved question

* chore: Reset all frontend files to main branch as we split the frontend work to EASI-4491

* chore: reran gql gen

* chore: email unit test for data exchange approach completed

* chore: removed unnecessary Scan and Value methods

* chore: added unit test for activity data exchange complete notification

* chore: implemented resolver for data exchange approach completed notification preferences

* fix: updated various test definitions to match new user account preferences spec

* chore: removed outdated comment

* chore: updated postman collection renaming markedCompletedBy -> markedCompleteBy

* chore: converted data exchange approach complete meta to id

* chore: updated migration version

* wip: data exchange approach

* wip: data exchange approach gql, store, and resolvers

* feat: working data exchange approach creation and updates

* feat: several feedback elements implemented

* chore: implementing PR feedback

* chore: implementing PR feedback

* wip: marked complete by user account and dts tracking

* feat: first working version of plan data exchange approach

* chore: ran linter and fixed cache helper reference

* run eslint

* fix: corrected cyclic dependency and several linter guidances

* merging changes

* ran sql fluff linter on migrations

* run lint

* fix: restructed logic for is marked complete to utilize null state of MarkedByDts rather than explicit boolean field

* feat: added status handling

* chore: corrected file name

* chore: removed old debug print

* fix: fixed lagging status

* fix: added status to sql queries

* Init dea query

* fix: corrected enum references from COMPLETE to COMPELETED

* Added card and translations

* chore: removed delete logic for dea

* chore: refactored IsDataExchangeApproachComplete resolver

* chore: updated enum to READY to conform more closely with other task list sections

* Added status enum change update

* Added start approach button

* Added unit test

---------

Co-authored-by: Tom Brooks <tom.brooks@oddball.io>
Co-authored-by: Tom Brooks <100007843+OddTomBrooks@users.noreply.github.com>
Co-authored-by: ClayBenson94 <clay.benson@oddball.io>
Co-authored-by: Steven Wade <steven.wade@oddball.io>
OddTomBrooks added a commit that referenced this pull request Oct 15, 2024
* feat: added feature migration, data models, gql

* chore: updated sql queries

* feat: several major improvements to first semi-functional data exchange approach in-app notification

* chore: updated postman collection to get all notifications

* chore: updated frontend gql and backend gql for user notification preferences

* chore: added simple resolver helper to dispatch emails and email test to validate email templates

* chore: removed resolved question

* chore: Reset all frontend files to main branch as we split the frontend work to EASI-4491

* chore: reran gql gen

* fix: forcing a commit for rebasing purposes

* chore: removed tmp file

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

* feat: added feature migration, data models, gql

* chore: updated sql queries

* feat: several major improvements to first semi-functional data exchange approach in-app notification

* chore: updated postman collection to get all notifications

* chore: updated frontend gql and backend gql for user notification preferences

* chore: added simple resolver helper to dispatch emails and email test to validate email templates

* chore: removed resolved question

* chore: Reset all frontend files to main branch as we split the frontend work to EASI-4491

* chore: reran gql gen

* chore: email unit test for data exchange approach completed

* chore: removed unnecessary Scan and Value methods

* chore: added unit test for activity data exchange complete notification

* chore: implemented resolver for data exchange approach completed notification preferences

* fix: updated various test definitions to match new user account preferences spec

* chore: removed outdated comment

* chore: updated postman collection renaming markedCompletedBy -> markedCompleteBy

* chore: converted data exchange approach complete meta to id

* chore: updated migration version

* wip: data exchange approach

* wip: data exchange approach gql, store, and resolvers

* feat: working data exchange approach creation and updates

* feat: several feedback elements implemented

* chore: implementing PR feedback

* chore: implementing PR feedback

* wip: marked complete by user account and dts tracking

* feat: first working version of plan data exchange approach

* chore: ran linter and fixed cache helper reference

* run eslint

* fix: corrected cyclic dependency and several linter guidances

* merging changes

* ran sql fluff linter on migrations

* run lint

* fix: restructed logic for is marked complete to utilize null state of MarkedByDts rather than explicit boolean field

* feat: added status handling

* chore: corrected file name

* chore: removed old debug print

* fix: fixed lagging status

* fix: added status to sql queries

* fix: corrected enum references from COMPLETE to COMPELETED

* chore: removed delete logic for dea

* chore: refactored IsDataExchangeApproachComplete resolver

* chore: updated enum to READY to conform more closely with other task list sections

* feat: email notification for plan data exchange approach marked complete

* fix: corrected ID from existing DEA to model ID

* chore: updated postman collection

* chore: simplified store method per PR feedback

* chore: getting model plan using loader per PR review

* fix: corrected accidentally switched footers

* fix: corrected id assignment in notification metadata

* fix: referencing UTC Now cache var in test

* chore: PR feedback

* chore: PR feedback

* chore: PR feedback

* chore: fix tx usage for rollback

* chore: PR feedback

* Update data exchange notification logic to only attempt to send if email services are non-nil

* chore: PR feedback to remove redundant DISTINCT call

* chore: PR feedback to send batch emails by BCC

* Update postman collection with ability to update notification preferences for data Exchange

---------

Co-authored-by: ClayBenson94 <clay.benson@oddball.io>
Co-authored-by: Steven Wade <steven.wade@oddball.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants