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

[MINT-2550] Data Exchange Approach Marked Complete Notification #1403

Merged
merged 68 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
742589f
feat: added feature migration, data models, gql
OddTomBrooks Jul 2, 2024
eed69df
chore: updated sql queries
OddTomBrooks Jul 2, 2024
729ce45
feat: several major improvements to first semi-functional data exchan…
OddTomBrooks Jul 3, 2024
343a984
chore: updated postman collection to get all notifications
OddTomBrooks Jul 3, 2024
58ab8f4
chore: updated frontend gql and backend gql for user notification pre…
OddTomBrooks Jul 3, 2024
0706fae
chore: added simple resolver helper to dispatch emails and email test…
OddTomBrooks Jul 3, 2024
95f07f9
chore: removed resolved question
OddTomBrooks Jul 5, 2024
54daae0
chore: Reset all frontend files to main branch as we split the fronte…
OddTomBrooks Jul 5, 2024
d113b08
chore: reran gql gen
OddTomBrooks Jul 5, 2024
6395210
fix: forcing a commit for rebasing purposes
OddTomBrooks Jul 5, 2024
9d4d41c
chore: removed tmp file
OddTomBrooks Jul 5, 2024
3d4e8b1
[EASI-4473] Notification: Data Exchange Approach Completed (#1209)
OddTomBrooks Jul 16, 2024
c1412b7
Merge branch 'main' into feature/MINT-2720_data_exchange_approach
OddTomBrooks Sep 17, 2024
2c829f4
chore: updated migration version
OddTomBrooks Sep 19, 2024
e02d09c
Merge branch 'NOREF/data_exchange_approach' into feature/MINT-2720_da…
OddTomBrooks Sep 20, 2024
6c72a54
wip: data exchange approach
OddTomBrooks Sep 24, 2024
6084f0a
wip: data exchange approach gql, store, and resolvers
OddTomBrooks Sep 25, 2024
ade1e73
feat: working data exchange approach creation and updates
OddTomBrooks Sep 26, 2024
7ec9c2a
feat: several feedback elements implemented
OddTomBrooks Sep 26, 2024
1b03e5f
chore: implementing PR feedback
OddTomBrooks Sep 27, 2024
5bc49a9
chore: implementing PR feedback
OddTomBrooks Sep 27, 2024
13ebcf1
wip: marked complete by user account and dts tracking
OddTomBrooks Sep 27, 2024
ae1095d
feat: first working version of plan data exchange approach
OddTomBrooks Sep 27, 2024
6297312
Merge branch 'main' into feature/MINT-2720_data_exchange_approach
OddTomBrooks Sep 30, 2024
5b11b33
chore: ran linter and fixed cache helper reference
OddTomBrooks Sep 30, 2024
e6ce2e5
run eslint
ClayBenson94 Sep 30, 2024
058e8aa
fix: corrected cyclic dependency and several linter guidances
OddTomBrooks Sep 30, 2024
a53d106
Merge branch 'feature/MINT-2720_data_exchange_approach' of github.com…
OddTomBrooks Sep 30, 2024
0b9ad42
merging changes
OddTomBrooks Sep 30, 2024
b3a1c47
ran sql fluff linter on migrations
StevenWadeOddball Sep 30, 2024
779970a
Merge branch 'feature/MINT-2720_data_exchange_approach' of https://gi…
StevenWadeOddball Sep 30, 2024
70c8856
run lint
ClayBenson94 Sep 30, 2024
ba212c3
fix: restructed logic for is marked complete to utilize null state of…
OddTomBrooks Sep 30, 2024
d4d3adb
Merge branch 'feature/MINT-2720_data_exchange_approach' of github.com…
OddTomBrooks Sep 30, 2024
5051a64
feat: added status handling
OddTomBrooks Oct 1, 2024
e0c358e
chore: corrected file name
OddTomBrooks Oct 1, 2024
a8c58d6
chore: removed old debug print
OddTomBrooks Oct 1, 2024
a3ab8fb
fix: fixed lagging status
OddTomBrooks Oct 1, 2024
7920d75
fix: added status to sql queries
OddTomBrooks Oct 1, 2024
5ffbb51
fix: corrected enum references from COMPLETE to COMPELETED
OddTomBrooks Oct 1, 2024
4a71ec1
chore: removed delete logic for dea
OddTomBrooks Oct 1, 2024
dfe0f74
chore: refactored IsDataExchangeApproachComplete resolver
OddTomBrooks Oct 2, 2024
1c369a7
chore: updated enum to READY to conform more closely with other task …
OddTomBrooks Oct 2, 2024
d6d4e3a
feat: email notification for plan data exchange approach marked complete
OddTomBrooks Oct 7, 2024
fa451aa
fix: corrected ID from existing DEA to model ID
OddTomBrooks Oct 7, 2024
393c14e
chore: updated postman collection
OddTomBrooks Oct 7, 2024
3c9be49
Merge branch 'main' into task/MINT-2550_dea_notif
OddTomBrooks Oct 7, 2024
d8df549
manual merge
OddTomBrooks Oct 8, 2024
7cff784
chore: simplified store method per PR feedback
OddTomBrooks Oct 9, 2024
a65bf54
chore: getting model plan using loader per PR review
OddTomBrooks Oct 9, 2024
ce0d251
fix: corrected accidentally switched footers
OddTomBrooks Oct 9, 2024
6a0835a
fix: corrected id assignment in notification metadata
OddTomBrooks Oct 9, 2024
db1ae1a
fix: referencing UTC Now cache var in test
OddTomBrooks Oct 9, 2024
e05f7e9
chore: PR feedback
OddTomBrooks Oct 9, 2024
5a53fc9
chore: PR feedback
OddTomBrooks Oct 9, 2024
bb4ac22
chore: PR feedback
OddTomBrooks Oct 10, 2024
d825193
chore: fix tx usage for rollback
OddTomBrooks Oct 11, 2024
607f753
chore: PR feedback
OddTomBrooks Oct 11, 2024
e370e3b
Merge feature
ClayBenson94 Oct 11, 2024
190cea3
Update data exchange notification logic to only attempt to send if em…
ClayBenson94 Oct 11, 2024
5a011d0
chore: PR feedback to remove redundant DISTINCT call
OddTomBrooks Oct 14, 2024
2b8f0ac
Merge branch 'task/MINT-2550_dea_notif' of github.com:CMSgov/mint-app…
OddTomBrooks Oct 14, 2024
9df42df
chore: PR feedback to send batch emails by BCC
OddTomBrooks Oct 14, 2024
4ed9435
Merge branch 'feature/MINT-2720_data_exchange' into task/MINT-2550_de…
OddTomBrooks Oct 14, 2024
219009d
Update postman collection with ability to update notification prefere…
ClayBenson94 Oct 15, 2024
1d3a4c3
Merge branch 'feature/MINT-2720_data_exchange' into task/MINT-2550_de…
ClayBenson94 Oct 15, 2024
6735eed
Merge branch 'feature/MINT-2720_data_exchange' into task/MINT-2550_de…
ClayBenson94 Oct 15, 2024
97e3cb3
Merge branch 'feature/MINT-2720_data_exchange' into task/MINT-2550_de…
ClayBenson94 Oct 15, 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
4 changes: 2 additions & 2 deletions cmd/dbseed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ func (s *Seeder) SeedData() {
"cmmiGroups": []string{"PATIENT_CARE_MODELS_GROUP", "SEAMLESS_CARE_MODELS_GROUP"},
"completeICIP": "2020-05-13T20:47:50.12Z",
"phasedIn": true,
"clearanceStarts": time.Now().AddDate(0, 3, 0),
"clearanceStarts": now.AddDate(0, 3, 0),
"highLevelNote": "Some high level note",
},
)
Expand All @@ -461,7 +461,7 @@ func (s *Seeder) SeedData() {
// Use a test user to mark the data exchange approach as complete
testUser := s.getTestPrincipalByUsername("BTAL")

err = resolvers.SendDataExchangeApproachCompletedNotification(
err = resolvers.SendDataExchangeApproachMarkedCompleteNotification(
s.Config.Context,
s.Config.EmailService,
s.Config.EmailTemplateService,
Expand Down
6 changes: 3 additions & 3 deletions cmd/test_email/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func main() {
sendModelPlanShareTest(emailService, templateService, addressBook)
sendDateChangedEmailsTest(emailService, templateService, addressBook)
sendCollaboratorAddedEmailTest(emailService, templateService, addressBook)
sendDataExchangeApproachCompletedEmailNotificationTest(emailService, templateService, addressBook)
sendDataExchangeApproachMarkedCompleteEmailNotificationTest(emailService, templateService, addressBook)
sendFeedbackEmail(emailService, templateService, addressBook)
reportAProblemEmail(emailService, templateService, addressBook)

Expand Down Expand Up @@ -397,7 +397,7 @@ func sendCollaboratorAddedEmailTest(
noErr(err)
}

func sendDataExchangeApproachCompletedEmailNotificationTest(
func sendDataExchangeApproachMarkedCompleteEmailNotificationTest(
emailService oddmail.EmailService,
templateService email.TemplateService,
addressBook email.AddressBook,
Expand All @@ -408,7 +408,7 @@ func sendDataExchangeApproachCompletedEmailNotificationTest(
"Retcon Plan",
)

err := resolvers.SendDataExchangeApproachCompletedEmailNotification(
err := resolvers.SendDataExchangeApproachMarkedCompleteEmailNotification(
emailService,
templateService,
addressBook,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TYPE DATA_EXCHANGE_APPROACH_MARKED_COMPLETE_NOTIFICATION_TYPE as enum (
'ALL_MODELS',
'FOLLOWED_MODELS',
'MY_MODELS'
);


ALTER TYPE ACTIVITY_TYPE
ADD VALUE 'DATA_EXCHANGE_APPROACH_MARKED_COMPLETE' AFTER 'NEW_MODEL_PLAN';

ALTER TABLE user_notification_preferences
ADD COLUMN data_exchange_approach_marked_complete USER_NOTIFICATION_PREFERENCE_FLAG[] DEFAULT '{}'::USER_NOTIFICATION_PREFERENCE_FLAG[],
ADD COLUMN data_exchange_approach_marked_complete_notification_type DATES_CHANGED_NOTIFICATION_TYPE DEFAULT NULL;
OddTomBrooks marked this conversation as resolved.
Show resolved Hide resolved

COMMENT ON COLUMN user_notification_preferences.data_exchange_approach_marked_complete IS 'Notification preference for when a data exchange approach is marked complete';
8 changes: 4 additions & 4 deletions pkg/email/data_exchange_approach_completed.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package email

// DataExchangeApproachCompletedSubjectContent defines the parameters necessary for the corresponding email subject
type DataExchangeApproachCompletedSubjectContent struct {
// DataExchangeApproachMarkedCompleteSubjectContent defines the parameters necessary for the corresponding email subject
type DataExchangeApproachMarkedCompleteSubjectContent struct {
ModelName string
}

// DataExchangeApproachCompletedBodyContent defines the parameters necessary for the corresponding email body
type DataExchangeApproachCompletedBodyContent struct {
// DataExchangeApproachMarkedCompleteBodyContent defines the parameters necessary for the corresponding email body
type DataExchangeApproachMarkedCompleteBodyContent struct {
ClientAddress string
ModelName string
ModelID string
Expand Down
14 changes: 7 additions & 7 deletions pkg/email/template_service_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ var modelPlanSuggestedPhaseSubjectTemplate string
//go:embed templates/model_plan_suggested_phase_body.html
var modelPlanSuggestedPhaseBodyTemplate string

// DataExchangeApproachCompletedTemplateName is the template name for the data exchange approach completed email
const DataExchangeApproachCompletedTemplateName string = "data_exchange_approach_completed"
// DataExchangeApproachMarkedCompleteTemplateName is the template name for the data exchange approach completed email
const DataExchangeApproachMarkedCompleteTemplateName string = "data_exchange_approach_marked_complete"

//go:embed templates/data_exchange_approach_completed_body.html
var dataExchangeApproachCompletedBodyTemplate string
//go:embed templates/data_exchange_approach_marked_complete_body.html
var dataExchangeApproachMarkedCompleteBodyTemplate string

//go:embed templates/data_exchange_approach_completed_subject.html
var dataExchangeApproachCompletedSubjectTemplate string
//go:embed templates/data_exchange_approach_marked_complete_subject.html
var dataExchangeApproachMarkedCompleteSubjectTemplate string

// TemplateServiceImpl is an implementation-specific structure loading all resources necessary for server execution
type TemplateServiceImpl struct {
Expand Down Expand Up @@ -249,7 +249,7 @@ func (t *TemplateServiceImpl) Load() error {
return err
}

err = t.loadEmailTemplate(DataExchangeApproachCompletedTemplateName, dataExchangeApproachCompletedSubjectTemplate, dataExchangeApproachCompletedBodyTemplate)
err = t.loadEmailTemplate(DataExchangeApproachMarkedCompleteTemplateName, dataExchangeApproachMarkedCompleteSubjectTemplate, dataExchangeApproachMarkedCompleteBodyTemplate)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{template "shared_header.html" "Data exchange approach complete:"}}

<h3>{{.ModelName}}</h3>
<p>Marked complete by {{.MarkedCompletedByUserCommonName}}</p>
<br/>
<p>
<a href="{{.ClientAddress}}/models/{{.ModelID}}/read-view/data-exchange-approach">View data exchange approach</a>
</p>
<br/>

{{if .ShowFooter}}
<hr>
<br/>
<p>
You are currently subscribed to notifications when data exchange approaches are completed. If you no longer wish to receive these email notifications, please <a href="{{.ClientAddress}}/notifications/settings?unsubscribe_email=DATA_EXCHANGE_APPROACH_MARKED_COMPLETE">unsubscribe</a> or change your <a href="{{.ClientAddress}}/notifications/settings">notification settings</a>.
</p>
{{end}}

{{template "shared_footer.html"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Data exchange approach complete: {{.ModelName}}
Loading
Loading