From d5928f81b0a0e07b088016587cd1a7ac00d3e027 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Tue, 2 Jul 2024 14:54:24 -0400 Subject: [PATCH 01/17] feat: added feature migration, data models, gql --- ...change_Approach_Completed_Notification.sql | 7 + pkg/graph/generated/generated.go | 1728 +++++++++++++++-- pkg/graph/resolvers/activity.resolvers.go | 22 + pkg/graph/schema/types/activity.graphql | 27 +- pkg/models/activity.go | 17 +- pkg/models/data_exchange_approach.go | 38 + ...change_approach_completed_activity_meta.go | 65 + pkg/models/user_notification_preferences.go | 19 +- pkg/notifications/activity.go | 8 + src/gql/gen/graphql.ts | 30 +- 10 files changed, 1744 insertions(+), 217 deletions(-) create mode 100644 migrations/V162__Add_Data_Exchange_Approach_Completed_Notification.sql create mode 100644 pkg/models/data_exchange_approach.go create mode 100644 pkg/models/data_exchange_approach_completed_activity_meta.go diff --git a/migrations/V162__Add_Data_Exchange_Approach_Completed_Notification.sql b/migrations/V162__Add_Data_Exchange_Approach_Completed_Notification.sql new file mode 100644 index 0000000000..3856bbd120 --- /dev/null +++ b/migrations/V162__Add_Data_Exchange_Approach_Completed_Notification.sql @@ -0,0 +1,7 @@ +ALTER TYPE ACTIVITY_TYPE + ADD VALUE 'DATA_EXCHANGE_APPROACH_COMPLETED' AFTER 'NEW_MODEL_PLAN'; + +ALTER TABLE user_notification_preferences + ADD COLUMN data_exchange_approach_completed user_notification_preference_flag[] DEFAULT '{}'::user_notification_preference_flag[]; + +COMMENT ON COLUMN user_notification_preferences.data_exchange_approach_completed IS 'Notification preference for when a data exchange approach is completed'; diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go index a57962aae5..a711d5c5b2 100644 --- a/pkg/graph/generated/generated.go +++ b/pkg/graph/generated/generated.go @@ -47,6 +47,8 @@ type ResolverRoot interface { AuditChange() AuditChangeResolver CurrentUser() CurrentUserResolver DailyDigestCompleteActivityMeta() DailyDigestCompleteActivityMetaResolver + DataExchangeApproach() DataExchangeApproachResolver + DataExchangeApproachCompletedActivityMeta() DataExchangeApproachCompletedActivityMetaResolver DatesChangedActivityMeta() DatesChangedActivityMetaResolver DiscussionReply() DiscussionReplyResolver ExistingModelLink() ExistingModelLinkResolver @@ -195,6 +197,29 @@ type ComplexityRoot struct { Version func(childComplexity int) int } + DataExchangeApproach struct { + CreatedBy func(childComplexity int) int + CreatedByUserAccount func(childComplexity int) int + CreatedDts func(childComplexity int) int + Description func(childComplexity int) int + ID func(childComplexity int) int + IsComplete func(childComplexity int) int + ModelPlan func(childComplexity int) int + ModelPlanID func(childComplexity int) int + ModifiedBy func(childComplexity int) int + ModifiedByUserAccount func(childComplexity int) int + ModifiedDts func(childComplexity int) int + Name func(childComplexity int) int + } + + DataExchangeApproachCompletedActivityMeta struct { + DataExchangeApproach func(childComplexity int) int + MarkedCompleteBy func(childComplexity int) int + MarkedCompleteByUserAccount func(childComplexity int) int + Type func(childComplexity int) int + Version func(childComplexity int) int + } + DateChange struct { Field func(childComplexity int) int IsChanged func(childComplexity int) int @@ -1278,6 +1303,12 @@ type CurrentUserResolver interface { type DailyDigestCompleteActivityMetaResolver interface { AnalyzedAudits(ctx context.Context, obj *models.DailyDigestCompleteActivityMeta) ([]*models.AnalyzedAudit, error) } +type DataExchangeApproachResolver interface { + ModelPlan(ctx context.Context, obj *models.DataExchangeApproach) (*models.ModelPlan, error) +} +type DataExchangeApproachCompletedActivityMetaResolver interface { + MarkedCompleteByUserAccount(ctx context.Context, obj *models.DataExchangeApproachCompletedActivityMeta) (*authentication.UserAccount, error) +} type DatesChangedActivityMetaResolver interface { ModelPlan(ctx context.Context, obj *models.DatesChangedActivityMeta) (*models.ModelPlan, error) } @@ -2065,6 +2096,125 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.DailyDigestCompleteActivityMeta.Version(childComplexity), true + case "DataExchangeApproach.createdBy": + if e.complexity.DataExchangeApproach.CreatedBy == nil { + break + } + + return e.complexity.DataExchangeApproach.CreatedBy(childComplexity), true + + case "DataExchangeApproach.createdByUserAccount": + if e.complexity.DataExchangeApproach.CreatedByUserAccount == nil { + break + } + + return e.complexity.DataExchangeApproach.CreatedByUserAccount(childComplexity), true + + case "DataExchangeApproach.createdDts": + if e.complexity.DataExchangeApproach.CreatedDts == nil { + break + } + + return e.complexity.DataExchangeApproach.CreatedDts(childComplexity), true + + case "DataExchangeApproach.description": + if e.complexity.DataExchangeApproach.Description == nil { + break + } + + return e.complexity.DataExchangeApproach.Description(childComplexity), true + + case "DataExchangeApproach.id": + if e.complexity.DataExchangeApproach.ID == nil { + break + } + + return e.complexity.DataExchangeApproach.ID(childComplexity), true + + case "DataExchangeApproach.isComplete": + if e.complexity.DataExchangeApproach.IsComplete == nil { + break + } + + return e.complexity.DataExchangeApproach.IsComplete(childComplexity), true + + case "DataExchangeApproach.modelPlan": + if e.complexity.DataExchangeApproach.ModelPlan == nil { + break + } + + return e.complexity.DataExchangeApproach.ModelPlan(childComplexity), true + + case "DataExchangeApproach.modelPlanID": + if e.complexity.DataExchangeApproach.ModelPlanID == nil { + break + } + + return e.complexity.DataExchangeApproach.ModelPlanID(childComplexity), true + + case "DataExchangeApproach.modifiedBy": + if e.complexity.DataExchangeApproach.ModifiedBy == nil { + break + } + + return e.complexity.DataExchangeApproach.ModifiedBy(childComplexity), true + + case "DataExchangeApproach.modifiedByUserAccount": + if e.complexity.DataExchangeApproach.ModifiedByUserAccount == nil { + break + } + + return e.complexity.DataExchangeApproach.ModifiedByUserAccount(childComplexity), true + + case "DataExchangeApproach.modifiedDts": + if e.complexity.DataExchangeApproach.ModifiedDts == nil { + break + } + + return e.complexity.DataExchangeApproach.ModifiedDts(childComplexity), true + + case "DataExchangeApproach.name": + if e.complexity.DataExchangeApproach.Name == nil { + break + } + + return e.complexity.DataExchangeApproach.Name(childComplexity), true + + case "DataExchangeApproachCompletedActivityMeta.dataExchangeApproach": + if e.complexity.DataExchangeApproachCompletedActivityMeta.DataExchangeApproach == nil { + break + } + + return e.complexity.DataExchangeApproachCompletedActivityMeta.DataExchangeApproach(childComplexity), true + + case "DataExchangeApproachCompletedActivityMeta.markedCompleteBy": + if e.complexity.DataExchangeApproachCompletedActivityMeta.MarkedCompleteBy == nil { + break + } + + return e.complexity.DataExchangeApproachCompletedActivityMeta.MarkedCompleteBy(childComplexity), true + + case "DataExchangeApproachCompletedActivityMeta.markedCompleteByUserAccount": + if e.complexity.DataExchangeApproachCompletedActivityMeta.MarkedCompleteByUserAccount == nil { + break + } + + return e.complexity.DataExchangeApproachCompletedActivityMeta.MarkedCompleteByUserAccount(childComplexity), true + + case "DataExchangeApproachCompletedActivityMeta.type": + if e.complexity.DataExchangeApproachCompletedActivityMeta.Type == nil { + break + } + + return e.complexity.DataExchangeApproachCompletedActivityMeta.Type(childComplexity), true + + case "DataExchangeApproachCompletedActivityMeta.version": + if e.complexity.DataExchangeApproachCompletedActivityMeta.Version == nil { + break + } + + return e.complexity.DataExchangeApproachCompletedActivityMeta.Version(childComplexity), true + case "DateChange.field": if e.complexity.DateChange.Field == nil { break @@ -8928,6 +9078,7 @@ enum ActivityType { MODEL_PLAN_SHARED NEW_MODEL_PLAN DATES_CHANGED + DATA_EXCHANGE_APPROACH_COMPLETED } enum DateChangeFieldType { @@ -8942,7 +9093,7 @@ enum DateChangeFieldType { """ ActivityMetaData is a type that represents all the data that can be captured in an Activity """ -union ActivityMetaData = TaggedInPlanDiscussionActivityMeta | TaggedInDiscussionReplyActivityMeta | DailyDigestCompleteActivityMeta | NewDiscussionRepliedActivityMeta | AddedAsCollaboratorMeta | ModelPlanSharedActivityMeta | NewModelPlanActivityMeta | DatesChangedActivityMeta +union ActivityMetaData = TaggedInPlanDiscussionActivityMeta | TaggedInDiscussionReplyActivityMeta | DailyDigestCompleteActivityMeta | NewDiscussionRepliedActivityMeta | AddedAsCollaboratorMeta | ModelPlanSharedActivityMeta | NewModelPlanActivityMeta | DatesChangedActivityMeta | DataExchangeApproachCompletedActivityMeta type AddedAsCollaboratorMeta { version: Int! @@ -9031,6 +9182,30 @@ 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! + markedCompleteBy: UUID! + markedCompleteByUserAccount: UserAccount! +} + """ Activity represents an event that happened in the application that could result in a notification. """ @@ -9523,9 +9698,6 @@ extend type ModelPlan { } type ModelPlanAndOperationalSolution { - # TODO -- we can uncomment these if we want? - # modelPlanID: UUID! - # operationalSolutionID: UUID! operationalSolution: OperationalSolution! modelPlan: ModelPlan! } @@ -16423,9 +16595,917 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta_type(ctx context.Co return ec.marshalNActivityType2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐActivityType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DailyDigestCompleteActivityMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type ActivityType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DailyDigestCompleteActivityMeta_modelPlanIDs(ctx context.Context, field graphql.CollectedField, obj *models.DailyDigestCompleteActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DailyDigestCompleteActivityMeta_modelPlanIDs(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ModelPlanIDs, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]uuid.UUID) + fc.Result = res + return ec.marshalNUUID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_modelPlanIDs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DailyDigestCompleteActivityMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UUID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DailyDigestCompleteActivityMeta_analyzedAudits(ctx context.Context, field graphql.CollectedField, obj *models.DailyDigestCompleteActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DailyDigestCompleteActivityMeta_analyzedAudits(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.DailyDigestCompleteActivityMeta().AnalyzedAudits(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*models.AnalyzedAudit) + fc.Result = res + return ec.marshalNAnalyzedAudit2ᚕᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐAnalyzedAuditᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_analyzedAudits(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DailyDigestCompleteActivityMeta", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_AnalyzedAudit_id(ctx, field) + case "modelPlanID": + return ec.fieldContext_AnalyzedAudit_modelPlanID(ctx, field) + case "modelName": + return ec.fieldContext_AnalyzedAudit_modelName(ctx, field) + case "date": + return ec.fieldContext_AnalyzedAudit_date(ctx, field) + case "changes": + return ec.fieldContext_AnalyzedAudit_changes(ctx, field) + case "createdBy": + return ec.fieldContext_AnalyzedAudit_createdBy(ctx, field) + case "createdByUserAccount": + return ec.fieldContext_AnalyzedAudit_createdByUserAccount(ctx, field) + case "createdDts": + return ec.fieldContext_AnalyzedAudit_createdDts(ctx, field) + case "modifiedBy": + return ec.fieldContext_AnalyzedAudit_modifiedBy(ctx, field) + case "modifiedByUserAccount": + return ec.fieldContext_AnalyzedAudit_modifiedByUserAccount(ctx, field) + case "modifiedDts": + return ec.fieldContext_AnalyzedAudit_modifiedDts(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AnalyzedAudit", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DailyDigestCompleteActivityMeta_userID(ctx context.Context, field graphql.CollectedField, obj *models.DailyDigestCompleteActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DailyDigestCompleteActivityMeta_userID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UserID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(uuid.UUID) + fc.Result = res + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_userID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DailyDigestCompleteActivityMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UUID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DailyDigestCompleteActivityMeta_date(ctx context.Context, field graphql.CollectedField, obj *models.DailyDigestCompleteActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DailyDigestCompleteActivityMeta_date(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Date, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DailyDigestCompleteActivityMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_id(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(uuid.UUID) + fc.Result = res + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UUID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_name(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_description(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_isComplete(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_isComplete(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsComplete, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_isComplete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_modelPlanID(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_modelPlanID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ModelPlanID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(uuid.UUID) + fc.Result = res + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_modelPlanID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UUID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_modelPlan(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_modelPlan(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.DataExchangeApproach().ModelPlan(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*models.ModelPlan) + fc.Result = res + return ec.marshalNModelPlan2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐModelPlan(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_modelPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_ModelPlan_id(ctx, field) + case "modelName": + return ec.fieldContext_ModelPlan_modelName(ctx, field) + case "abbreviation": + return ec.fieldContext_ModelPlan_abbreviation(ctx, field) + case "archived": + return ec.fieldContext_ModelPlan_archived(ctx, field) + case "createdBy": + return ec.fieldContext_ModelPlan_createdBy(ctx, field) + case "createdByUserAccount": + return ec.fieldContext_ModelPlan_createdByUserAccount(ctx, field) + case "createdDts": + return ec.fieldContext_ModelPlan_createdDts(ctx, field) + case "modifiedBy": + return ec.fieldContext_ModelPlan_modifiedBy(ctx, field) + case "modifiedByUserAccount": + return ec.fieldContext_ModelPlan_modifiedByUserAccount(ctx, field) + case "modifiedDts": + return ec.fieldContext_ModelPlan_modifiedDts(ctx, field) + case "basics": + return ec.fieldContext_ModelPlan_basics(ctx, field) + case "generalCharacteristics": + return ec.fieldContext_ModelPlan_generalCharacteristics(ctx, field) + case "participantsAndProviders": + return ec.fieldContext_ModelPlan_participantsAndProviders(ctx, field) + case "beneficiaries": + return ec.fieldContext_ModelPlan_beneficiaries(ctx, field) + case "opsEvalAndLearning": + return ec.fieldContext_ModelPlan_opsEvalAndLearning(ctx, field) + case "collaborators": + return ec.fieldContext_ModelPlan_collaborators(ctx, field) + case "documents": + return ec.fieldContext_ModelPlan_documents(ctx, field) + case "discussions": + return ec.fieldContext_ModelPlan_discussions(ctx, field) + case "payments": + return ec.fieldContext_ModelPlan_payments(ctx, field) + case "status": + return ec.fieldContext_ModelPlan_status(ctx, field) + case "isFavorite": + return ec.fieldContext_ModelPlan_isFavorite(ctx, field) + case "isCollaborator": + return ec.fieldContext_ModelPlan_isCollaborator(ctx, field) + case "crs": + return ec.fieldContext_ModelPlan_crs(ctx, field) + case "tdls": + return ec.fieldContext_ModelPlan_tdls(ctx, field) + case "prepareForClearance": + return ec.fieldContext_ModelPlan_prepareForClearance(ctx, field) + case "nameHistory": + return ec.fieldContext_ModelPlan_nameHistory(ctx, field) + case "operationalNeeds": + return ec.fieldContext_ModelPlan_operationalNeeds(ctx, field) + case "opSolutionLastModifiedDts": + return ec.fieldContext_ModelPlan_opSolutionLastModifiedDts(ctx, field) + case "statusPlannedActiveOrEnded": + return ec.fieldContext_ModelPlan_statusPlannedActiveOrEnded(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ModelPlan", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_createdBy(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_createdBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(uuid.UUID) + fc.Result = res + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UUID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_createdByUserAccount(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_createdByUserAccount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedByUserAccount(ctx), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*authentication.UserAccount) + fc.Result = res + return ec.marshalNUserAccount2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋauthenticationᚐUserAccount(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_createdByUserAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_UserAccount_id(ctx, field) + case "username": + return ec.fieldContext_UserAccount_username(ctx, field) + case "isEUAID": + return ec.fieldContext_UserAccount_isEUAID(ctx, field) + case "commonName": + return ec.fieldContext_UserAccount_commonName(ctx, field) + case "locale": + return ec.fieldContext_UserAccount_locale(ctx, field) + case "email": + return ec.fieldContext_UserAccount_email(ctx, field) + case "givenName": + return ec.fieldContext_UserAccount_givenName(ctx, field) + case "familyName": + return ec.fieldContext_UserAccount_familyName(ctx, field) + case "zoneInfo": + return ec.fieldContext_UserAccount_zoneInfo(ctx, field) + case "hasLoggedIn": + return ec.fieldContext_UserAccount_hasLoggedIn(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserAccount", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_createdDts(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_createdDts(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreatedDts, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_createdDts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_modifiedBy(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_modifiedBy(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ModifiedBy, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*uuid.UUID) + fc.Result = res + return ec.marshalOUUID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_modifiedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UUID does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_modifiedByUserAccount(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_modifiedByUserAccount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ModifiedByUserAccount(ctx), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*authentication.UserAccount) + fc.Result = res + return ec.marshalOUserAccount2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋauthenticationᚐUserAccount(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_modifiedByUserAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_UserAccount_id(ctx, field) + case "username": + return ec.fieldContext_UserAccount_username(ctx, field) + case "isEUAID": + return ec.fieldContext_UserAccount_isEUAID(ctx, field) + case "commonName": + return ec.fieldContext_UserAccount_commonName(ctx, field) + case "locale": + return ec.fieldContext_UserAccount_locale(ctx, field) + case "email": + return ec.fieldContext_UserAccount_email(ctx, field) + case "givenName": + return ec.fieldContext_UserAccount_givenName(ctx, field) + case "familyName": + return ec.fieldContext_UserAccount_familyName(ctx, field) + case "zoneInfo": + return ec.fieldContext_UserAccount_zoneInfo(ctx, field) + case "hasLoggedIn": + return ec.fieldContext_UserAccount_hasLoggedIn(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserAccount", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproach_modifiedDts(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproach_modifiedDts(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ModifiedDts, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*time.Time) + fc.Result = res + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproach_modifiedDts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproach", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_version(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_version(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Version, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataExchangeApproachCompletedActivityMeta", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_type(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(models.ActivityType) + fc.Result = res + return ec.marshalNActivityType2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐActivityType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DailyDigestCompleteActivityMeta", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, IsMethod: false, IsResolver: false, @@ -16436,8 +17516,8 @@ func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_type(ct return fc, nil } -func (ec *executionContext) _DailyDigestCompleteActivityMeta_modelPlanIDs(ctx context.Context, field graphql.CollectedField, obj *models.DailyDigestCompleteActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DailyDigestCompleteActivityMeta_modelPlanIDs(ctx, field) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx, field) if err != nil { return graphql.Null } @@ -16450,7 +17530,7 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta_modelPlanIDs(ctx co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ModelPlanIDs, nil + return obj.DataExchangeApproach, nil }) if err != nil { ec.Error(ctx, err) @@ -16462,94 +17542,52 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta_modelPlanIDs(ctx co } return graphql.Null } - res := resTmp.([]uuid.UUID) + res := resTmp.(models.DataExchangeApproach) fc.Result = res - return ec.marshalNUUID2ᚕgithubᚗcomᚋgoogleᚋuuidᚐUUIDᚄ(ctx, field.Selections, res) + return ec.marshalNDataExchangeApproach2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐDataExchangeApproach(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_modelPlanIDs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DailyDigestCompleteActivityMeta", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, IsMethod: false, IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UUID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DailyDigestCompleteActivityMeta_analyzedAudits(ctx context.Context, field graphql.CollectedField, obj *models.DailyDigestCompleteActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DailyDigestCompleteActivityMeta_analyzedAudits(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.DailyDigestCompleteActivityMeta().AnalyzedAudits(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*models.AnalyzedAudit) - fc.Result = res - return ec.marshalNAnalyzedAudit2ᚕᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐAnalyzedAuditᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_analyzedAudits(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DailyDigestCompleteActivityMeta", - Field: field, - IsMethod: true, - IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_AnalyzedAudit_id(ctx, field) + return ec.fieldContext_DataExchangeApproach_id(ctx, field) + case "name": + return ec.fieldContext_DataExchangeApproach_name(ctx, field) + case "description": + return ec.fieldContext_DataExchangeApproach_description(ctx, field) + case "isComplete": + return ec.fieldContext_DataExchangeApproach_isComplete(ctx, field) case "modelPlanID": - return ec.fieldContext_AnalyzedAudit_modelPlanID(ctx, field) - case "modelName": - return ec.fieldContext_AnalyzedAudit_modelName(ctx, field) - case "date": - return ec.fieldContext_AnalyzedAudit_date(ctx, field) - case "changes": - return ec.fieldContext_AnalyzedAudit_changes(ctx, field) + return ec.fieldContext_DataExchangeApproach_modelPlanID(ctx, field) + case "modelPlan": + return ec.fieldContext_DataExchangeApproach_modelPlan(ctx, field) case "createdBy": - return ec.fieldContext_AnalyzedAudit_createdBy(ctx, field) + return ec.fieldContext_DataExchangeApproach_createdBy(ctx, field) case "createdByUserAccount": - return ec.fieldContext_AnalyzedAudit_createdByUserAccount(ctx, field) + return ec.fieldContext_DataExchangeApproach_createdByUserAccount(ctx, field) case "createdDts": - return ec.fieldContext_AnalyzedAudit_createdDts(ctx, field) + return ec.fieldContext_DataExchangeApproach_createdDts(ctx, field) case "modifiedBy": - return ec.fieldContext_AnalyzedAudit_modifiedBy(ctx, field) + return ec.fieldContext_DataExchangeApproach_modifiedBy(ctx, field) case "modifiedByUserAccount": - return ec.fieldContext_AnalyzedAudit_modifiedByUserAccount(ctx, field) + return ec.fieldContext_DataExchangeApproach_modifiedByUserAccount(ctx, field) case "modifiedDts": - return ec.fieldContext_AnalyzedAudit_modifiedDts(ctx, field) + return ec.fieldContext_DataExchangeApproach_modifiedDts(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type AnalyzedAudit", field.Name) + return nil, fmt.Errorf("no field named %q was found under type DataExchangeApproach", field.Name) }, } return fc, nil } -func (ec *executionContext) _DailyDigestCompleteActivityMeta_userID(ctx context.Context, field graphql.CollectedField, obj *models.DailyDigestCompleteActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DailyDigestCompleteActivityMeta_userID(ctx, field) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx, field) if err != nil { return graphql.Null } @@ -16562,7 +17600,7 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta_userID(ctx context. }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.UserID, nil + return obj.MarkedCompleteBy, nil }) if err != nil { ec.Error(ctx, err) @@ -16579,9 +17617,9 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta_userID(ctx context. return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_userID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DailyDigestCompleteActivityMeta", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, IsMethod: false, IsResolver: false, @@ -16592,8 +17630,8 @@ func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_userID( return fc, nil } -func (ec *executionContext) _DailyDigestCompleteActivityMeta_date(ctx context.Context, field graphql.CollectedField, obj *models.DailyDigestCompleteActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DailyDigestCompleteActivityMeta_date(ctx, field) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx, field) if err != nil { return graphql.Null } @@ -16606,7 +17644,7 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta_date(ctx context.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Date, nil + return ec.resolvers.DataExchangeApproachCompletedActivityMeta().MarkedCompleteByUserAccount(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -16618,19 +17656,41 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta_date(ctx context.Co } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(*authentication.UserAccount) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNUserAccount2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋauthenticationᚐUserAccount(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DailyDigestCompleteActivityMeta", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") + switch field.Name { + case "id": + return ec.fieldContext_UserAccount_id(ctx, field) + case "username": + return ec.fieldContext_UserAccount_username(ctx, field) + case "isEUAID": + return ec.fieldContext_UserAccount_isEUAID(ctx, field) + case "commonName": + return ec.fieldContext_UserAccount_commonName(ctx, field) + case "locale": + return ec.fieldContext_UserAccount_locale(ctx, field) + case "email": + return ec.fieldContext_UserAccount_email(ctx, field) + case "givenName": + return ec.fieldContext_UserAccount_givenName(ctx, field) + case "familyName": + return ec.fieldContext_UserAccount_familyName(ctx, field) + case "zoneInfo": + return ec.fieldContext_UserAccount_zoneInfo(ctx, field) + case "hasLoggedIn": + return ec.fieldContext_UserAccount_hasLoggedIn(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type UserAccount", field.Name) }, } return fc, nil @@ -66715,6 +67775,11 @@ func (ec *executionContext) _ActivityMetaData(ctx context.Context, sel ast.Selec return graphql.Null } return ec._DatesChangedActivityMeta(ctx, sel, obj) + case *models.DataExchangeApproachCompletedActivityMeta: + if obj == nil { + return graphql.Null + } + return ec._DataExchangeApproachCompletedActivityMeta(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -67527,89 +68592,268 @@ func (ec *executionContext) _AnalyzedPlanDiscussions(ctx context.Context, sel as return out } -var analyzedPlanSectionsImplementors = []string{"AnalyzedPlanSections"} +var analyzedPlanSectionsImplementors = []string{"AnalyzedPlanSections"} + +func (ec *executionContext) _AnalyzedPlanSections(ctx context.Context, sel ast.SelectionSet, obj *models.AnalyzedPlanSections) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, analyzedPlanSectionsImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AnalyzedPlanSections") + case "updated": + out.Values[i] = ec._AnalyzedPlanSections_updated(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "readyForReview": + out.Values[i] = ec._AnalyzedPlanSections_readyForReview(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "readyForClearance": + out.Values[i] = ec._AnalyzedPlanSections_readyForClearance(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var auditChangeImplementors = []string{"AuditChange"} + +func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionSet, obj *models.AuditChange) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, auditChangeImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AuditChange") + case "id": + out.Values[i] = ec._AuditChange_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "primaryKey": + out.Values[i] = ec._AuditChange_primaryKey(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "foreignKey": + out.Values[i] = ec._AuditChange_foreignKey(ctx, field, obj) + case "tableName": + out.Values[i] = ec._AuditChange_tableName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "action": + out.Values[i] = ec._AuditChange_action(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "fields": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._AuditChange_fields(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "modifiedBy": + out.Values[i] = ec._AuditChange_modifiedBy(ctx, field, obj) + case "modifiedByUserAccount": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._AuditChange_modifiedByUserAccount(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "modifiedDts": + out.Values[i] = ec._AuditChange_modifiedDts(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var currentUserImplementors = []string{"CurrentUser"} -func (ec *executionContext) _AnalyzedPlanSections(ctx context.Context, sel ast.SelectionSet, obj *models.AnalyzedPlanSections) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, analyzedPlanSectionsImplementors) +func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionSet, obj *models.CurrentUser) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, currentUserImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AnalyzedPlanSections") - case "updated": - out.Values[i] = ec._AnalyzedPlanSections_updated(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "readyForReview": - out.Values[i] = ec._AnalyzedPlanSections_readyForReview(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "readyForClearance": - out.Values[i] = ec._AnalyzedPlanSections_readyForClearance(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ + out.Values[i] = graphql.MarshalString("CurrentUser") + case "launchDarkly": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CurrentUser_launchDarkly(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - atomic.AddInt32(&ec.deferred, int32(len(deferred))) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } - return out -} + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "account": + field := field -var auditChangeImplementors = []string{"AuditChange"} + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CurrentUser_account(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } -func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionSet, obj *models.AuditChange) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, auditChangeImplementors) + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("AuditChange") - case "id": - out.Values[i] = ec._AuditChange_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "primaryKey": - out.Values[i] = ec._AuditChange_primaryKey(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "foreignKey": - out.Values[i] = ec._AuditChange_foreignKey(ctx, field, obj) - case "tableName": - out.Values[i] = ec._AuditChange_tableName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "action": - out.Values[i] = ec._AuditChange_action(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - case "fields": + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "notifications": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -67618,7 +68862,7 @@ func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._AuditChange_fields(ctx, field, obj) + res = ec._CurrentUser_notifications(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -67645,9 +68889,7 @@ func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "modifiedBy": - out.Values[i] = ec._AuditChange_modifiedBy(ctx, field, obj) - case "modifiedByUserAccount": + case "notificationPreferences": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -67656,7 +68898,10 @@ func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._AuditChange_modifiedByUserAccount(ctx, field, obj) + res = ec._CurrentUser_notificationPreferences(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -67680,8 +68925,6 @@ func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "modifiedDts": - out.Values[i] = ec._AuditChange_modifiedDts(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -67705,18 +68948,33 @@ func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionS return out } -var currentUserImplementors = []string{"CurrentUser"} +var dailyDigestCompleteActivityMetaImplementors = []string{"DailyDigestCompleteActivityMeta", "ActivityMetaData"} -func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionSet, obj *models.CurrentUser) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, currentUserImplementors) +func (ec *executionContext) _DailyDigestCompleteActivityMeta(ctx context.Context, sel ast.SelectionSet, obj *models.DailyDigestCompleteActivityMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dailyDigestCompleteActivityMetaImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("CurrentUser") - case "launchDarkly": + out.Values[i] = graphql.MarshalString("DailyDigestCompleteActivityMeta") + case "version": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_version(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "type": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "modelPlanIDs": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_modelPlanIDs(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "analyzedAudits": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -67725,7 +68983,7 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._CurrentUser_launchDarkly(ctx, field, obj) + res = ec._DailyDigestCompleteActivityMeta_analyzedAudits(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -67752,7 +69010,73 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "account": + case "userID": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_userID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "date": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var dataExchangeApproachImplementors = []string{"DataExchangeApproach"} + +func (ec *executionContext) _DataExchangeApproach(ctx context.Context, sel ast.SelectionSet, obj *models.DataExchangeApproach) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dataExchangeApproachImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DataExchangeApproach") + case "id": + out.Values[i] = ec._DataExchangeApproach_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "name": + out.Values[i] = ec._DataExchangeApproach_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + out.Values[i] = ec._DataExchangeApproach_description(ctx, field, obj) + case "isComplete": + out.Values[i] = ec._DataExchangeApproach_isComplete(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "modelPlanID": + out.Values[i] = ec._DataExchangeApproach_modelPlanID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "modelPlan": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -67761,7 +69085,7 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._CurrentUser_account(ctx, field, obj) + res = ec._DataExchangeApproach_modelPlan(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -67788,7 +69112,12 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "notifications": + case "createdBy": + out.Values[i] = ec._DataExchangeApproach_createdBy(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "createdByUserAccount": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -67797,7 +69126,7 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._CurrentUser_notifications(ctx, field, obj) + res = ec._DataExchangeApproach_createdByUserAccount(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -67824,7 +69153,14 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "notificationPreferences": + case "createdDts": + out.Values[i] = ec._DataExchangeApproach_createdDts(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "modifiedBy": + out.Values[i] = ec._DataExchangeApproach_modifiedBy(ctx, field, obj) + case "modifiedByUserAccount": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -67833,10 +69169,7 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._CurrentUser_notificationPreferences(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._DataExchangeApproach_modifiedByUserAccount(ctx, field, obj) return res } @@ -67860,6 +69193,8 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "modifiedDts": + out.Values[i] = ec._DataExchangeApproach_modifiedDts(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -67883,33 +69218,38 @@ func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionS return out } -var dailyDigestCompleteActivityMetaImplementors = []string{"DailyDigestCompleteActivityMeta", "ActivityMetaData"} +var dataExchangeApproachCompletedActivityMetaImplementors = []string{"DataExchangeApproachCompletedActivityMeta", "ActivityMetaData"} -func (ec *executionContext) _DailyDigestCompleteActivityMeta(ctx context.Context, sel ast.SelectionSet, obj *models.DailyDigestCompleteActivityMeta) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, dailyDigestCompleteActivityMetaImplementors) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta(ctx context.Context, sel ast.SelectionSet, obj *models.DataExchangeApproachCompletedActivityMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dataExchangeApproachCompletedActivityMetaImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("DailyDigestCompleteActivityMeta") + out.Values[i] = graphql.MarshalString("DataExchangeApproachCompletedActivityMeta") case "version": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_version(ctx, field, obj) + out.Values[i] = ec._DataExchangeApproachCompletedActivityMeta_version(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } case "type": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_type(ctx, field, obj) + out.Values[i] = ec._DataExchangeApproachCompletedActivityMeta_type(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "modelPlanIDs": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_modelPlanIDs(ctx, field, obj) + case "dataExchangeApproach": + out.Values[i] = ec._DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "analyzedAudits": + case "markedCompleteBy": + out.Values[i] = ec._DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "markedCompleteByUserAccount": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -67918,7 +69258,7 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta(ctx context.Context ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._DailyDigestCompleteActivityMeta_analyzedAudits(ctx, field, obj) + res = ec._DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -67945,16 +69285,6 @@ func (ec *executionContext) _DailyDigestCompleteActivityMeta(ctx context.Context } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "userID": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_userID(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "date": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_date(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -80390,6 +81720,10 @@ func (ec *executionContext) marshalNCurrentUser2ᚖgithubᚗcomᚋcmsgovᚋmint return ec._CurrentUser(ctx, sel, v) } +func (ec *executionContext) marshalNDataExchangeApproach2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐDataExchangeApproach(ctx context.Context, sel ast.SelectionSet, v models.DataExchangeApproach) graphql.Marshaler { + return ec._DataExchangeApproach(ctx, sel, &v) +} + func (ec *executionContext) unmarshalNDataForMonitoringType2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋgraphᚋmodelᚐDataForMonitoringType(ctx context.Context, v interface{}) (model.DataForMonitoringType, error) { var res model.DataForMonitoringType err := res.UnmarshalGQL(v) diff --git a/pkg/graph/resolvers/activity.resolvers.go b/pkg/graph/resolvers/activity.resolvers.go index 1544bbc844..36938d147b 100644 --- a/pkg/graph/resolvers/activity.resolvers.go +++ b/pkg/graph/resolvers/activity.resolvers.go @@ -34,6 +34,16 @@ func (r *dailyDigestCompleteActivityMetaResolver) AnalyzedAudits(ctx context.Con return loaders.AnalyzedAuditGetByModelPlanIDsAndDate(ctx, obj.ModelPlanIDs, obj.Date) } +// ModelPlan is the resolver for the modelPlan field. +func (r *dataExchangeApproachResolver) ModelPlan(ctx context.Context, obj *models.DataExchangeApproach) (*models.ModelPlan, error) { + return ModelPlanGetByIDLOADER(ctx, obj.ModelPlanID) +} + +// MarkedCompleteByUserAccount is the resolver for the markedCompleteByUserAccount field. +func (r *dataExchangeApproachCompletedActivityMetaResolver) MarkedCompleteByUserAccount(ctx context.Context, obj *models.DataExchangeApproachCompletedActivityMeta) (*authentication.UserAccount, error) { + return UserAccountGetByIDLOADER(ctx, obj.MarkedCompleteBy) +} + // ModelPlan is the resolver for the modelPlan field. func (r *datesChangedActivityMetaResolver) ModelPlan(ctx context.Context, obj *models.DatesChangedActivityMeta) (*models.ModelPlan, error) { return ModelPlanGetByIDLOADER(ctx, obj.ModelPlanID) @@ -107,6 +117,16 @@ func (r *Resolver) DailyDigestCompleteActivityMeta() generated.DailyDigestComple return &dailyDigestCompleteActivityMetaResolver{r} } +// DataExchangeApproach returns generated.DataExchangeApproachResolver implementation. +func (r *Resolver) DataExchangeApproach() generated.DataExchangeApproachResolver { + return &dataExchangeApproachResolver{r} +} + +// DataExchangeApproachCompletedActivityMeta returns generated.DataExchangeApproachCompletedActivityMetaResolver implementation. +func (r *Resolver) DataExchangeApproachCompletedActivityMeta() generated.DataExchangeApproachCompletedActivityMetaResolver { + return &dataExchangeApproachCompletedActivityMetaResolver{r} +} + // DatesChangedActivityMeta returns generated.DatesChangedActivityMetaResolver implementation. func (r *Resolver) DatesChangedActivityMeta() generated.DatesChangedActivityMetaResolver { return &datesChangedActivityMetaResolver{r} @@ -140,6 +160,8 @@ func (r *Resolver) TaggedInPlanDiscussionActivityMeta() generated.TaggedInPlanDi type activityResolver struct{ *Resolver } type addedAsCollaboratorMetaResolver struct{ *Resolver } type dailyDigestCompleteActivityMetaResolver struct{ *Resolver } +type dataExchangeApproachResolver struct{ *Resolver } +type dataExchangeApproachCompletedActivityMetaResolver struct{ *Resolver } type datesChangedActivityMetaResolver struct{ *Resolver } type modelPlanSharedActivityMetaResolver struct{ *Resolver } type newDiscussionRepliedActivityMetaResolver struct{ *Resolver } diff --git a/pkg/graph/schema/types/activity.graphql b/pkg/graph/schema/types/activity.graphql index ae2bc9ae56..ca40d05e15 100644 --- a/pkg/graph/schema/types/activity.graphql +++ b/pkg/graph/schema/types/activity.graphql @@ -10,6 +10,7 @@ enum ActivityType { MODEL_PLAN_SHARED NEW_MODEL_PLAN DATES_CHANGED + DATA_EXCHANGE_APPROACH_COMPLETED } enum DateChangeFieldType { @@ -24,7 +25,7 @@ enum DateChangeFieldType { """ ActivityMetaData is a type that represents all the data that can be captured in an Activity """ -union ActivityMetaData = TaggedInPlanDiscussionActivityMeta | TaggedInDiscussionReplyActivityMeta | DailyDigestCompleteActivityMeta | NewDiscussionRepliedActivityMeta | AddedAsCollaboratorMeta | ModelPlanSharedActivityMeta | NewModelPlanActivityMeta | DatesChangedActivityMeta +union ActivityMetaData = TaggedInPlanDiscussionActivityMeta | TaggedInDiscussionReplyActivityMeta | DailyDigestCompleteActivityMeta | NewDiscussionRepliedActivityMeta | AddedAsCollaboratorMeta | ModelPlanSharedActivityMeta | NewModelPlanActivityMeta | DatesChangedActivityMeta | DataExchangeApproachCompletedActivityMeta type AddedAsCollaboratorMeta { version: Int! @@ -113,6 +114,30 @@ 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! + markedCompleteBy: UUID! + markedCompleteByUserAccount: UserAccount! +} + """ Activity represents an event that happened in the application that could result in a notification. """ diff --git a/pkg/models/activity.go b/pkg/models/activity.go index 4eff8cac49..938ee6fadc 100644 --- a/pkg/models/activity.go +++ b/pkg/models/activity.go @@ -9,14 +9,15 @@ type ActivityType string // These constants represent the different values of ActivityType const ( - ActivityDigest ActivityType = "DAILY_DIGEST_COMPLETE" - ActivityAddedAsCollaborator ActivityType = "ADDED_AS_COLLABORATOR" - ActivityTaggedInDiscussion ActivityType = "TAGGED_IN_DISCUSSION" - ActivityTaggedInDiscussionReply ActivityType = "TAGGED_IN_DISCUSSION_REPLY" - ActivityNewDiscussionReply ActivityType = "NEW_DISCUSSION_REPLY" - ActivityModelPlanShared ActivityType = "MODEL_PLAN_SHARED" - ActivityNewModelPlan ActivityType = "NEW_MODEL_PLAN" - ActivityDatesChanged ActivityType = "DATES_CHANGED" + ActivityDigest ActivityType = "DAILY_DIGEST_COMPLETE" + ActivityAddedAsCollaborator ActivityType = "ADDED_AS_COLLABORATOR" + ActivityTaggedInDiscussion ActivityType = "TAGGED_IN_DISCUSSION" + ActivityTaggedInDiscussionReply ActivityType = "TAGGED_IN_DISCUSSION_REPLY" + ActivityNewDiscussionReply ActivityType = "NEW_DISCUSSION_REPLY" + ActivityModelPlanShared ActivityType = "MODEL_PLAN_SHARED" + ActivityNewModelPlan ActivityType = "NEW_MODEL_PLAN" + ActivityDatesChanged ActivityType = "DATES_CHANGED" + ActivityDataExchangeApproachCompleted ActivityType = "DATA_EXCHANGE_APPROACH_COMPLETED" ) // Activity represents a discrete event that has happened in the application that might be notifiable. diff --git a/pkg/models/data_exchange_approach.go b/pkg/models/data_exchange_approach.go new file mode 100644 index 0000000000..69a0eb14de --- /dev/null +++ b/pkg/models/data_exchange_approach.go @@ -0,0 +1,38 @@ +package models + +import ( + "database/sql/driver" + + "github.com/google/uuid" +) + +// TODO: Should this be DataExchange? DataExchangeConcept? How do we want to identify this model? + +// DataExchangeApproach represents the data exchange approach of a model plan +type DataExchangeApproach struct { + baseStruct + modelPlanRelation + Name string `json:"name" db:"name"` + Description *string `json:"description" db:"description"` + IsComplete bool `json:"isComplete" db:"is_complete"` +} + +// NewDataExchangeApproach creates a new DataExchangeApproach with the required fields +func NewDataExchangeApproach(name string, createdBy uuid.UUID, modelPlanID uuid.UUID) *DataExchangeApproach { + return &DataExchangeApproach{ + baseStruct: NewBaseStruct(createdBy), + modelPlanRelation: NewModelPlanRelation(modelPlanID), + Name: name, + IsComplete: false, + } +} + +// Value allows us to satisfy the valuer interface, so we can write to the database +func (d DataExchangeApproach) Value() (driver.Value, error) { + return GenericValue(d) +} + +// Scan implements the scanner interface, so we can translate the JSONb from the db to an object in GO +func (d *DataExchangeApproach) Scan(src interface{}) error { + return GenericScan(src, d) +} diff --git a/pkg/models/data_exchange_approach_completed_activity_meta.go b/pkg/models/data_exchange_approach_completed_activity_meta.go new file mode 100644 index 0000000000..0c480eee9d --- /dev/null +++ b/pkg/models/data_exchange_approach_completed_activity_meta.go @@ -0,0 +1,65 @@ +package models + +import ( + "database/sql/driver" + + "github.com/google/uuid" +) + +// DataExchangeApproachCompletedActivityMeta represents the notification data that +// is relevant to completing a Data Exchange Approach +type DataExchangeApproachCompletedActivityMeta struct { + ActivityMetaBaseStruct + Version int `json:"version"` + Type ActivityType `json:"type"` + DataExchangeApproach DataExchangeApproach `json:"dataExchangeApproach"` + MarkedCompleteBy uuid.UUID `json:"markedCompleteBy"` +} + +// NewDataExchangeApproachCompletedActivityMeta creates a new DataExchangeApproachCompletedActivityMeta +func NewDataExchangeApproachCompletedActivityMeta( + version int, + activityType ActivityType, + dataExchangeApproach DataExchangeApproach, + markedCompleteBy uuid.UUID, +) *DataExchangeApproachCompletedActivityMeta { + return &DataExchangeApproachCompletedActivityMeta{ + ActivityMetaBaseStruct: NewActivityMetaBaseStruct(activityType, version), + Version: version, + Type: activityType, + DataExchangeApproach: dataExchangeApproach, + MarkedCompleteBy: markedCompleteBy, + } +} + +// NewDataExchangeApproachCompletedActivity creates a new Data Exchange Approach Complete type of Activity +func NewDataExchangeApproachCompletedActivity( + actorID uuid.UUID, + version int, + activityType ActivityType, + dataExchangeApproach DataExchangeApproach, + markedCompleteBy uuid.UUID, +) *Activity { + return &Activity{ + baseStruct: NewBaseStruct(actorID), + ActorID: actorID, + EntityID: markedCompleteBy, + ActivityType: activityType, + MetaData: NewDataExchangeApproachCompletedActivityMeta( + version, + activityType, + dataExchangeApproach, + markedCompleteBy, + ), + } +} + +// Value allows us to satisfy the valuer interface so we can write to the database +func (d DataExchangeApproachCompletedActivityMeta) Value() (driver.Value, error) { + return GenericValue(d) +} + +// Scan implements the scanner interface so we can translate the JSONb from the db to an object in GO +func (d *DataExchangeApproachCompletedActivityMeta) Scan(src interface{}) error { + return GenericScan(src, d) +} diff --git a/pkg/models/user_notification_preferences.go b/pkg/models/user_notification_preferences.go index d45aca42f5..a4d77a7cc4 100644 --- a/pkg/models/user_notification_preferences.go +++ b/pkg/models/user_notification_preferences.go @@ -15,15 +15,16 @@ type UserNotificationPreferences struct { // The id of the user this preferences object is for UserID uuid.UUID `json:"userID" db:"user_id"` - DailyDigestComplete UserNotificationPreferenceFlags `json:"dailyDigestComplete" db:"daily_digest_complete"` - AddedAsCollaborator UserNotificationPreferenceFlags `json:"addedAsCollaborator" db:"added_as_collaborator"` - TaggedInDiscussion UserNotificationPreferenceFlags `json:"taggedInDiscussion" db:"tagged_in_discussion"` - TaggedInDiscussionReply UserNotificationPreferenceFlags `json:"taggedInDiscussionReply" db:"tagged_in_discussion_reply"` - NewDiscussionReply UserNotificationPreferenceFlags `json:"newDiscussionReply" db:"new_discussion_reply"` - ModelPlanShared UserNotificationPreferenceFlags `json:"modelPlanShared" db:"model_plan_shared"` - NewModelPlan UserNotificationPreferenceFlags `json:"newModelPlan" db:"new_model_plan"` - DatesChanged UserNotificationPreferenceFlags `json:"datesChanged" db:"dates_changed"` - DatesChangedNotificationType *DatesChangedNotificationType `json:"datesChangedNotificationType" db:"dates_changed_notification_type"` + DailyDigestComplete UserNotificationPreferenceFlags `json:"dailyDigestComplete" db:"daily_digest_complete"` + AddedAsCollaborator UserNotificationPreferenceFlags `json:"addedAsCollaborator" db:"added_as_collaborator"` + TaggedInDiscussion UserNotificationPreferenceFlags `json:"taggedInDiscussion" db:"tagged_in_discussion"` + TaggedInDiscussionReply UserNotificationPreferenceFlags `json:"taggedInDiscussionReply" db:"tagged_in_discussion_reply"` + NewDiscussionReply UserNotificationPreferenceFlags `json:"newDiscussionReply" db:"new_discussion_reply"` + ModelPlanShared UserNotificationPreferenceFlags `json:"modelPlanShared" db:"model_plan_shared"` + NewModelPlan UserNotificationPreferenceFlags `json:"newModelPlan" db:"new_model_plan"` + DatesChanged UserNotificationPreferenceFlags `json:"datesChanged" db:"dates_changed"` + DatesChangedNotificationType *DatesChangedNotificationType `json:"datesChangedNotificationType" db:"dates_changed_notification_type"` + DataExchangeApproachCompleted UserNotificationPreferenceFlags `json:"dataExchangeApproachCompleted" db:"data_exchange_approach_completed"` } // NewUserNotificationPreferences returns a New UserNotificationPreferences diff --git a/pkg/notifications/activity.go b/pkg/notifications/activity.go index 5bcaf095e5..8fea733382 100644 --- a/pkg/notifications/activity.go +++ b/pkg/notifications/activity.go @@ -144,6 +144,14 @@ func parseRawActivityMetaData(activityType models.ActivityType, rawMetaDataJSON } return &meta, nil + case models.ActivityDataExchangeApproachCompleted: + // Deserialize the raw JSON into DataExchangeApproachCompletedActivityMeta + meta := models.DataExchangeApproachCompletedActivityMeta{} + if err := json.Unmarshal(rawData, &meta); err != nil { + return nil, err + } + return &meta, nil + default: // Return a default implementation or handle unsupported types return nil, fmt.Errorf("unsupported activity type: %s", activityType) diff --git a/src/gql/gen/graphql.ts b/src/gql/gen/graphql.ts index d53d8d6b0d..8fefb74e05 100644 --- a/src/gql/gen/graphql.ts +++ b/src/gql/gen/graphql.ts @@ -56,12 +56,13 @@ export type Activity = { }; /** ActivityMetaData is a type that represents all the data that can be captured in an Activity */ -export type ActivityMetaData = AddedAsCollaboratorMeta | DailyDigestCompleteActivityMeta | DatesChangedActivityMeta | ModelPlanSharedActivityMeta | NewDiscussionRepliedActivityMeta | NewModelPlanActivityMeta | TaggedInDiscussionReplyActivityMeta | TaggedInPlanDiscussionActivityMeta; +export type ActivityMetaData = AddedAsCollaboratorMeta | DailyDigestCompleteActivityMeta | DataExchangeApproachCompletedActivityMeta | DatesChangedActivityMeta | ModelPlanSharedActivityMeta | NewDiscussionRepliedActivityMeta | NewModelPlanActivityMeta | TaggedInDiscussionReplyActivityMeta | TaggedInPlanDiscussionActivityMeta; /** ActivityType represents the possible activities that happen in application that might result in a notification */ export enum ActivityType { ADDED_AS_COLLABORATOR = 'ADDED_AS_COLLABORATOR', DAILY_DIGEST_COMPLETE = 'DAILY_DIGEST_COMPLETE', + DATA_EXCHANGE_APPROACH_COMPLETED = 'DATA_EXCHANGE_APPROACH_COMPLETED', DATES_CHANGED = 'DATES_CHANGED', MODEL_PLAN_SHARED = 'MODEL_PLAN_SHARED', NEW_DISCUSSION_REPLY = 'NEW_DISCUSSION_REPLY', @@ -291,6 +292,31 @@ export type DailyDigestCompleteActivityMeta = { version: Scalars['Int']['output']; }; +export type DataExchangeApproach = { + __typename: 'DataExchangeApproach'; + createdBy: Scalars['UUID']['output']; + createdByUserAccount: UserAccount; + createdDts: Scalars['Time']['output']; + description?: Maybe; + id: Scalars['UUID']['output']; + isComplete: Scalars['Boolean']['output']; + modelPlan: ModelPlan; + modelPlanID: Scalars['UUID']['output']; + modifiedBy?: Maybe; + modifiedByUserAccount?: Maybe; + modifiedDts?: Maybe; + name: Scalars['String']['output']; +}; + +export type DataExchangeApproachCompletedActivityMeta = { + __typename: 'DataExchangeApproachCompletedActivityMeta'; + dataExchangeApproach: DataExchangeApproach; + markedCompleteBy: Scalars['UUID']['output']; + markedCompleteByUserAccount: UserAccount; + type: ActivityType; + version: Scalars['Int']['output']; +}; + export enum DataForMonitoringType { CLINICAL_DATA = 'CLINICAL_DATA', ENCOUNTER_DATA = 'ENCOUNTER_DATA', @@ -3683,7 +3709,7 @@ export type GetNotificationSettingsQuery = { __typename: 'Query', currentUser: { export type GetNotificationsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetNotificationsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notifications: { __typename: 'UserNotifications', numUnreadNotifications: number, notifications: Array<{ __typename: 'UserNotification', id: UUID, isRead: boolean, inAppSent: boolean, emailSent: boolean, createdDts: Time, activity: { __typename: 'Activity', activityType: ActivityType, entityID: UUID, actorID: UUID, actorUserAccount: { __typename: 'UserAccount', commonName: string }, metaData: { __typename: 'AddedAsCollaboratorMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'DailyDigestCompleteActivityMeta', version: number, type: ActivityType, modelPlanIDs: Array, date: Time, analyzedAudits: Array<{ __typename: 'AnalyzedAudit', id: UUID, modelPlanID: UUID, modelName: string, date: Time, changes: { __typename: 'AnalyzedAuditChange', modelPlan?: { __typename: 'AnalyzedModelPlan', oldName?: string | null, statusChanges?: Array | null } | null, documents?: { __typename: 'AnalyzedDocuments', count?: number | null } | null, crTdls?: { __typename: 'AnalyzedCrTdls', activity?: boolean | null } | null, planSections?: { __typename: 'AnalyzedPlanSections', updated: Array, readyForReview: Array, readyForClearance: Array } | null, modelLeads?: { __typename: 'AnalyzedModelLeads', added: Array<{ __typename: 'AnalyzedModelLeadInfo', id: UUID, commonName: string }> } | null, planDiscussions?: { __typename: 'AnalyzedPlanDiscussions', activity?: boolean | null } | null } }> } | { __typename: 'DatesChangedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string }, dateChanges: Array<{ __typename: 'DateChange', isChanged: boolean, field: DateChangeFieldType, isRange: boolean, oldDate?: Time | null, newDate?: Time | null, oldRangeStart?: Time | null, oldRangeEnd?: Time | null, newRangeStart?: Time | null, newRangeEnd?: Time | null }> } | { __typename: 'ModelPlanSharedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, optionalMessage?: string | null, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewDiscussionRepliedActivityMeta', version: number, type: ActivityType, discussionID: UUID, replyID: UUID, modelPlanID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewModelPlanActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInDiscussionReplyActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, replyID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInPlanDiscussionActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } } }> } } }; +export type GetNotificationsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notifications: { __typename: 'UserNotifications', numUnreadNotifications: number, notifications: Array<{ __typename: 'UserNotification', id: UUID, isRead: boolean, inAppSent: boolean, emailSent: boolean, createdDts: Time, activity: { __typename: 'Activity', activityType: ActivityType, entityID: UUID, actorID: UUID, actorUserAccount: { __typename: 'UserAccount', commonName: string }, metaData: { __typename: 'AddedAsCollaboratorMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'DailyDigestCompleteActivityMeta', version: number, type: ActivityType, modelPlanIDs: Array, date: Time, analyzedAudits: Array<{ __typename: 'AnalyzedAudit', id: UUID, modelPlanID: UUID, modelName: string, date: Time, changes: { __typename: 'AnalyzedAuditChange', modelPlan?: { __typename: 'AnalyzedModelPlan', oldName?: string | null, statusChanges?: Array | null } | null, documents?: { __typename: 'AnalyzedDocuments', count?: number | null } | null, crTdls?: { __typename: 'AnalyzedCrTdls', activity?: boolean | null } | null, planSections?: { __typename: 'AnalyzedPlanSections', updated: Array, readyForReview: Array, readyForClearance: Array } | null, modelLeads?: { __typename: 'AnalyzedModelLeads', added: Array<{ __typename: 'AnalyzedModelLeadInfo', id: UUID, commonName: string }> } | null, planDiscussions?: { __typename: 'AnalyzedPlanDiscussions', activity?: boolean | null } | null } }> } | { __typename: 'DataExchangeApproachCompletedActivityMeta' } | { __typename: 'DatesChangedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string }, dateChanges: Array<{ __typename: 'DateChange', isChanged: boolean, field: DateChangeFieldType, isRange: boolean, oldDate?: Time | null, newDate?: Time | null, oldRangeStart?: Time | null, oldRangeEnd?: Time | null, newRangeStart?: Time | null, newRangeEnd?: Time | null }> } | { __typename: 'ModelPlanSharedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, optionalMessage?: string | null, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewDiscussionRepliedActivityMeta', version: number, type: ActivityType, discussionID: UUID, replyID: UUID, modelPlanID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewModelPlanActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInDiscussionReplyActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, replyID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInPlanDiscussionActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } } }> } } }; export type GetPollNotificationsQueryVariables = Exact<{ [key: string]: never; }>; From c82e9487e99ef728b08f856bb0608956abbdaea5 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Tue, 2 Jul 2024 15:40:03 -0400 Subject: [PATCH 02/17] chore: updated sql queries --- pkg/sqlqueries/SQL/user_notification_preferences/create.sql | 3 +++ .../SQL/user_notification_preferences/get_by_user_id.sql | 1 + .../user_notification_preferences/get_by_user_id_loader.sql | 1 + pkg/sqlqueries/SQL/user_notification_preferences/update.sql | 2 ++ 4 files changed, 7 insertions(+) diff --git a/pkg/sqlqueries/SQL/user_notification_preferences/create.sql b/pkg/sqlqueries/SQL/user_notification_preferences/create.sql index 45ce0bd0b6..7db18c55b2 100644 --- a/pkg/sqlqueries/SQL/user_notification_preferences/create.sql +++ b/pkg/sqlqueries/SQL/user_notification_preferences/create.sql @@ -10,6 +10,7 @@ INSERT INTO public.user_notification_preferences( new_model_plan, dates_changed, dates_changed_notification_type, + data_exchange_approach_completed, created_by ) VALUES ( @@ -24,6 +25,7 @@ VALUES ( :new_model_plan, :dates_changed, :dates_changed_notification_type, + :data_exchange_approach_completed, :created_by ) RETURNING @@ -38,6 +40,7 @@ model_plan_shared, new_model_plan, dates_changed, dates_changed_notification_type, +data_exchange_approach_completed, created_by, created_dts, modified_by, diff --git a/pkg/sqlqueries/SQL/user_notification_preferences/get_by_user_id.sql b/pkg/sqlqueries/SQL/user_notification_preferences/get_by_user_id.sql index a759fdb15c..0973be8b23 100644 --- a/pkg/sqlqueries/SQL/user_notification_preferences/get_by_user_id.sql +++ b/pkg/sqlqueries/SQL/user_notification_preferences/get_by_user_id.sql @@ -10,6 +10,7 @@ SELECT new_model_plan, dates_changed, dates_changed_notification_type, + data_exchange_approach_completed, created_by, created_dts, modified_by, diff --git a/pkg/sqlqueries/SQL/user_notification_preferences/get_by_user_id_loader.sql b/pkg/sqlqueries/SQL/user_notification_preferences/get_by_user_id_loader.sql index 3ef3d5d8d5..d3a2d7982c 100644 --- a/pkg/sqlqueries/SQL/user_notification_preferences/get_by_user_id_loader.sql +++ b/pkg/sqlqueries/SQL/user_notification_preferences/get_by_user_id_loader.sql @@ -18,6 +18,7 @@ SELECT UNP.new_model_plan, UNP.dates_changed, UNP.dates_changed_notification_type, + UNP.data_exchange_approach_completed, UNP.created_by, UNP.created_dts, UNP.modified_by, diff --git a/pkg/sqlqueries/SQL/user_notification_preferences/update.sql b/pkg/sqlqueries/SQL/user_notification_preferences/update.sql index f11555b3cf..96d8b5c96c 100644 --- a/pkg/sqlqueries/SQL/user_notification_preferences/update.sql +++ b/pkg/sqlqueries/SQL/user_notification_preferences/update.sql @@ -9,6 +9,7 @@ SET new_model_plan = :new_model_plan, dates_changed = :dates_changed, dates_changed_notification_type = :dates_changed_notification_type, + data_exchange_approach_completed = :data_exchange_approach_completed, modified_by = :modified_by, modified_dts = CURRENT_TIMESTAMP WHERE @@ -25,6 +26,7 @@ model_plan_shared, new_model_plan, dates_changed, dates_changed_notification_type, +data_exchange_approach_completed, created_by, created_dts, modified_by, From a3600a7e443cc75e1b81291e87368cd43052a441 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Wed, 3 Jul 2024 11:02:45 -0400 Subject: [PATCH 03/17] feat: several major improvements to first semi-functional data exchange approach in-app notification --- cmd/dbseed/main.go | 24 ++++++++++ pkg/graph/generated/generated.go | 14 ++++-- ...change_approach_completed_activity_meta.go | 31 +++++-------- pkg/notifications/activity.go | 1 + .../data_exchange_approach_completed.go | 46 +++++++++++++++++++ src/i18n/en-US/notifications.ts | 18 +++++++- src/views/Notifications/Settings/index.tsx | 16 +++++-- 7 files changed, 122 insertions(+), 28 deletions(-) create mode 100644 pkg/notifications/data_exchange_approach_completed.go diff --git a/cmd/dbseed/main.go b/cmd/dbseed/main.go index 3df21fe161..4979afc717 100644 --- a/cmd/dbseed/main.go +++ b/cmd/dbseed/main.go @@ -5,6 +5,9 @@ import ( "fmt" "time" + "github.com/cmsgov/mint-app/pkg/notifications" + "github.com/cmsgov/mint-app/pkg/storage/loaders" + "github.com/google/uuid" "github.com/lib/pq" @@ -258,6 +261,27 @@ func (s *Seeder) SeedData() { }, }, ) + + // Send a notification for Data Exchange Approach Completed + dataExchangeApproach := models.NewDataExchangeApproach( + "Data Exchange Approach", + planWithDocuments.CreatedBy, + planWithDocuments.ID, + ) + + // create an actor principal for testing notifications + + actorPrincipal := s.getTestPrincipalByUsername("MINT") + + _, err = notifications.ActivityDataExchangeApproachCompletedCreate( + s.Config.Context, + actorPrincipal.UserAccount.ID, + s.Config.Store, + []uuid.UUID{planWithDocuments.CreatedBy}, + dataExchangeApproach, + planWithDocuments.CreatedBy, + loaders.UserNotificationPreferencesGetByUserID, + ) } // CreateAnalyzedAuditData uses the seeder to generate analyzed audits. It will make one record for all changes just seeded diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go index a711d5c5b2..196b416d96 100644 --- a/pkg/graph/generated/generated.go +++ b/pkg/graph/generated/generated.go @@ -17542,9 +17542,9 @@ func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_dataExcha } return graphql.Null } - res := resTmp.(models.DataExchangeApproach) + res := resTmp.(*models.DataExchangeApproach) fc.Result = res - return ec.marshalNDataExchangeApproach2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐDataExchangeApproach(ctx, field.Selections, res) + return ec.marshalNDataExchangeApproach2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐDataExchangeApproach(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -81720,8 +81720,14 @@ func (ec *executionContext) marshalNCurrentUser2ᚖgithubᚗcomᚋcmsgovᚋmint return ec._CurrentUser(ctx, sel, v) } -func (ec *executionContext) marshalNDataExchangeApproach2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐDataExchangeApproach(ctx context.Context, sel ast.SelectionSet, v models.DataExchangeApproach) graphql.Marshaler { - return ec._DataExchangeApproach(ctx, sel, &v) +func (ec *executionContext) marshalNDataExchangeApproach2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐDataExchangeApproach(ctx context.Context, sel ast.SelectionSet, v *models.DataExchangeApproach) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DataExchangeApproach(ctx, sel, v) } func (ec *executionContext) unmarshalNDataForMonitoringType2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋgraphᚋmodelᚐDataForMonitoringType(ctx context.Context, v interface{}) (model.DataForMonitoringType, error) { diff --git a/pkg/models/data_exchange_approach_completed_activity_meta.go b/pkg/models/data_exchange_approach_completed_activity_meta.go index 0c480eee9d..bfcf210de1 100644 --- a/pkg/models/data_exchange_approach_completed_activity_meta.go +++ b/pkg/models/data_exchange_approach_completed_activity_meta.go @@ -10,23 +10,20 @@ import ( // is relevant to completing a Data Exchange Approach type DataExchangeApproachCompletedActivityMeta struct { ActivityMetaBaseStruct - Version int `json:"version"` - Type ActivityType `json:"type"` - DataExchangeApproach DataExchangeApproach `json:"dataExchangeApproach"` - MarkedCompleteBy uuid.UUID `json:"markedCompleteBy"` + Version int `json:"version"` + Type ActivityType `json:"type"` + DataExchangeApproach *DataExchangeApproach `json:"dataExchangeApproach"` + MarkedCompleteBy uuid.UUID `json:"markedCompleteBy"` } -// NewDataExchangeApproachCompletedActivityMeta creates a new DataExchangeApproachCompletedActivityMeta -func NewDataExchangeApproachCompletedActivityMeta( - version int, - activityType ActivityType, - dataExchangeApproach DataExchangeApproach, +// newDataExchangeApproachCompletedActivityMeta creates a new DataExchangeApproachCompletedActivityMeta +func newDataExchangeApproachCompletedActivityMeta( + dataExchangeApproach *DataExchangeApproach, markedCompleteBy uuid.UUID, ) *DataExchangeApproachCompletedActivityMeta { + version := 0 // iterate this if this type ever updates return &DataExchangeApproachCompletedActivityMeta{ - ActivityMetaBaseStruct: NewActivityMetaBaseStruct(activityType, version), - Version: version, - Type: activityType, + ActivityMetaBaseStruct: NewActivityMetaBaseStruct(ActivityDataExchangeApproachCompleted, version), DataExchangeApproach: dataExchangeApproach, MarkedCompleteBy: markedCompleteBy, } @@ -35,19 +32,15 @@ func NewDataExchangeApproachCompletedActivityMeta( // NewDataExchangeApproachCompletedActivity creates a new Data Exchange Approach Complete type of Activity func NewDataExchangeApproachCompletedActivity( actorID uuid.UUID, - version int, - activityType ActivityType, - dataExchangeApproach DataExchangeApproach, + dataExchangeApproach *DataExchangeApproach, markedCompleteBy uuid.UUID, ) *Activity { return &Activity{ baseStruct: NewBaseStruct(actorID), ActorID: actorID, EntityID: markedCompleteBy, - ActivityType: activityType, - MetaData: NewDataExchangeApproachCompletedActivityMeta( - version, - activityType, + ActivityType: ActivityDataExchangeApproachCompleted, + MetaData: newDataExchangeApproachCompletedActivityMeta( dataExchangeApproach, markedCompleteBy, ), diff --git a/pkg/notifications/activity.go b/pkg/notifications/activity.go index 8fea733382..8496cfc1ec 100644 --- a/pkg/notifications/activity.go +++ b/pkg/notifications/activity.go @@ -111,6 +111,7 @@ func parseRawActivityMetaData(activityType models.ActivityType, rawMetaDataJSON return nil, err } return &meta, nil + case models.ActivityAddedAsCollaborator: // Deserialize the raw JSON into AddedAsCollaboratorMeta meta := models.AddedAsCollaboratorMeta{} diff --git a/pkg/notifications/data_exchange_approach_completed.go b/pkg/notifications/data_exchange_approach_completed.go new file mode 100644 index 0000000000..3edec3c21c --- /dev/null +++ b/pkg/notifications/data_exchange_approach_completed.go @@ -0,0 +1,46 @@ +package notifications + +import ( + "context" + + "github.com/google/uuid" + + "github.com/cmsgov/mint-app/pkg/models" + "github.com/cmsgov/mint-app/pkg/sqlutils" +) + +// ActivityDataExchangeApproachCompletedCreate creates an activity for when a data exchange approach is completed +func ActivityDataExchangeApproachCompletedCreate( + ctx context.Context, + actorID uuid.UUID, + np sqlutils.NamedPreparer, + receiverIDs []uuid.UUID, + approach *models.DataExchangeApproach, + markedCompletedBy uuid.UUID, + getPreferencesFunc GetUserNotificationPreferencesFunc, +) (*models.Activity, error) { + activity := models.NewDataExchangeApproachCompletedActivity( + actorID, + approach, + markedCompletedBy, + ) + + retActivity, actErr := activityCreate(ctx, np, activity) + if actErr != nil { + return nil, actErr + } + + for _, receiverID := range receiverIDs { + preferences, err := getPreferencesFunc(ctx, receiverID) + if err != nil { + return nil, err + } + + _, err = userNotificationCreate(ctx, np, retActivity, receiverID, preferences.ModelPlanShared) + if err != nil { + return nil, err + } + } + + return retActivity, nil +} diff --git a/src/i18n/en-US/notifications.ts b/src/i18n/en-US/notifications.ts index c9ad1ee3b3..390573736c 100644 --- a/src/i18n/en-US/notifications.ts +++ b/src/i18n/en-US/notifications.ts @@ -20,6 +20,10 @@ const notifications = { hide: 'Hide digest' } }, + DATA_EXCHANGE_APPROACH_COMPLETED: { + text: 'Data Exchange Approach completed for {{-modelName}}.', + cta: 'View Model Plan' + }, DATES_CHANGED: { text: 'Dates have been updated for {{-modelName}}.', cta: { @@ -95,6 +99,12 @@ const notifications = { PERFORMANCE_PERIOD: 'Performance period', WRAP_UP_ENDS: 'Model wrap-up end date' } + }, + dataExchangeApproachCompleted: { + heading: 'Data Exchange Approach completed for {{-modelName}}', + subheading: + 'The Data Exchange Approach has been completed for this model.', + cta: 'View this Model Plan' } }, settings: { @@ -122,7 +132,9 @@ const notifications = { newDiscussionReply: 'When someone replies to a discussion I started', modelPlanShared: 'When someone shares a Model Plan with me', newModelPlan: 'When a new Model Plan is created', - datesChanged: 'When model dates change' + datesChanged: 'When model dates change', + dataExchangeApproachCompleted: + 'When the Data Exchange Approach is completed' }, additionalConfigurations: { whichModel: 'Which models?', @@ -146,7 +158,9 @@ const notifications = { 'You are already unsubscribed from email notifications {{-notificationType}}.', activityType: { NEW_MODEL_PLAN: 'when a new Model Plan is created', - DATES_CHANGED: 'when model dates change' + DATES_CHANGED: 'when model dates change', + DATA_EXCHANGE_APPROACH_COMPLETED: + 'when the Data Exchange Approach is completed' } } } diff --git a/src/views/Notifications/Settings/index.tsx b/src/views/Notifications/Settings/index.tsx index 33707e99c9..b085b4ed53 100644 --- a/src/views/Notifications/Settings/index.tsx +++ b/src/views/Notifications/Settings/index.tsx @@ -80,7 +80,8 @@ const NotificationSettings = () => { modelPlanShared, newModelPlan, datesChanged, - datesChangedNotificationType + datesChangedNotificationType, + dataExchangeApproachCompleted } = (data?.currentUser.notificationPreferences || {}) as GetNotifcationSettingsType; @@ -305,7 +306,8 @@ const NotificationSettings = () => { modelPlanShared: modelPlanShared ?? [], newModelPlan: newModelPlan ?? [], datesChanged: datesChanged ?? [], - datesChangedNotificationType: datesChangedNotificationType ?? undefined + datesChangedNotificationType: datesChangedNotificationType ?? undefined, + dataExchangeApproachCompleted: dataExchangeApproachCompleted ?? [] }; if ((!loading && error) || (!loading && !data?.currentUser)) { @@ -411,7 +413,15 @@ const NotificationSettings = () => { )} - + {setting === 'datesChanged' && ( + +

+ {notificationsT( + 'settings.sections.additionalNotifications.heading' + )} +

+
+ )}

{notificationSettings[setting]} From aee9a0f9ab1662a1f21bf703f7643036c5c315ca Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Wed, 3 Jul 2024 11:14:36 -0400 Subject: [PATCH 04/17] chore: updated postman collection to get all notifications --- MINT.postman_collection.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MINT.postman_collection.json b/MINT.postman_collection.json index c05665056f..3363445e55 100644 --- a/MINT.postman_collection.json +++ b/MINT.postman_collection.json @@ -2154,7 +2154,7 @@ "body": { "mode": "graphql", "graphql": { - "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 modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n replyID\n content\n }\n ... on ModelPlanSharedActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n optionalMessage\n }\n ... on NewDiscussionRepliedActivityMeta {\n version\n type\n discussionID\n replyID\n content\n } \n ... on DailyDigestCompleteActivityMeta{\n version\n type\n modelPlanIDs\n date\n analyzedAudits{\n id\n modelPlanID\n modelName\n date\n changes{\n modelPlan{\n oldName\n statusChanges\n }\n documents{\n count\n }\n crTdls{\n activity\n }\n planSections{\n updated\n readyForReview\n readyForClearance\n }\n modelLeads{\n added{\n id\n commonName\n # userAccount{\n # id\n # email\n # }\n }\n }\n planDiscussions{\n activity\n }\n }\n\n }\n\n }\n ... on NewModelPlanActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n }\n ... on DatesChangedActivityMeta {\n version\n type\n modelPlanID\n modelPlan {\n id\n }\n dateChanges {\n isChanged\n field\n isRange\n oldDate\n newDate\n oldRangeStart\n oldRangeEnd\n newRangeStart\n newRangeEnd\n }\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 modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n replyID\n content\n }\n ... on ModelPlanSharedActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n optionalMessage\n }\n ... on NewDiscussionRepliedActivityMeta {\n version\n type\n discussionID\n replyID\n content\n } \n ... on DailyDigestCompleteActivityMeta{\n version\n type\n modelPlanIDs\n date\n analyzedAudits{\n id\n modelPlanID\n modelName\n date\n changes{\n modelPlan{\n oldName\n statusChanges\n }\n documents{\n count\n }\n crTdls{\n activity\n }\n planSections{\n updated\n readyForReview\n readyForClearance\n }\n modelLeads{\n added{\n id\n commonName\n # userAccount{\n # id\n # email\n # }\n }\n }\n planDiscussions{\n activity\n }\n }\n\n }\n\n }\n ... on NewModelPlanActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n }\n ... on DatesChangedActivityMeta {\n version\n type\n modelPlanID\n modelPlan {\n id\n }\n dateChanges {\n isChanged\n field\n isRange\n oldDate\n newDate\n oldRangeStart\n oldRangeEnd\n newRangeStart\n newRangeEnd\n }\n }\n ... on DataExchangeApproachCompletedActivityMeta {\n version\n type\n dataExchangeApproach {\n id\n name\n }\n markedCompletedBy\n } \n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n", "variables": "" } }, From d01f10110fe397197c8097a5f885f6f15302ccee Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Wed, 3 Jul 2024 11:16:26 -0400 Subject: [PATCH 05/17] chore: updated frontend gql and backend gql for user notification preferences --- pkg/graph/generated/generated.go | 132 +++++++++++++++--- ...user_notification_preferences.resolvers.go | 6 + .../user_notification_preferences.graphql | 4 + .../Notifications/GetNotificationSettings.ts | 1 + .../UpdateNotificationSettings.ts | 1 + src/gql/gen/graphql.ts | 12 +- .../Notifications/Settings/index.test.tsx | 4 + 7 files changed, 139 insertions(+), 21 deletions(-) diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go index 196b416d96..5b1cd245af 100644 --- a/pkg/graph/generated/generated.go +++ b/pkg/graph/generated/generated.go @@ -1240,23 +1240,24 @@ type ComplexityRoot struct { } UserNotificationPreferences struct { - AddedAsCollaborator func(childComplexity int) int - CreatedBy func(childComplexity int) int - CreatedByUserAccount func(childComplexity int) int - CreatedDts func(childComplexity int) int - DailyDigestComplete func(childComplexity int) int - DatesChanged func(childComplexity int) int - DatesChangedNotificationType func(childComplexity int) int - ID func(childComplexity int) int - ModelPlanShared func(childComplexity int) int - ModifiedBy func(childComplexity int) int - ModifiedByUserAccount func(childComplexity int) int - ModifiedDts func(childComplexity int) int - NewDiscussionReply func(childComplexity int) int - NewModelPlan func(childComplexity int) int - TaggedInDiscussion func(childComplexity int) int - TaggedInDiscussionReply func(childComplexity int) int - UserID func(childComplexity int) int + AddedAsCollaborator func(childComplexity int) int + CreatedBy func(childComplexity int) int + CreatedByUserAccount func(childComplexity int) int + CreatedDts func(childComplexity int) int + DailyDigestComplete func(childComplexity int) int + DataExchangeApproachCompleted func(childComplexity int) int + DatesChanged func(childComplexity int) int + DatesChangedNotificationType func(childComplexity int) int + ID func(childComplexity int) int + ModelPlanShared func(childComplexity int) int + ModifiedBy func(childComplexity int) int + ModifiedByUserAccount func(childComplexity int) int + ModifiedDts func(childComplexity int) int + NewDiscussionReply func(childComplexity int) int + NewModelPlan func(childComplexity int) int + TaggedInDiscussion func(childComplexity int) int + TaggedInDiscussionReply func(childComplexity int) int + UserID func(childComplexity int) int } UserNotifications struct { @@ -1613,6 +1614,8 @@ type UserNotificationPreferencesResolver interface { ModelPlanShared(ctx context.Context, obj *models.UserNotificationPreferences) ([]models.UserNotificationPreferenceFlag, error) NewModelPlan(ctx context.Context, obj *models.UserNotificationPreferences) ([]models.UserNotificationPreferenceFlag, error) DatesChanged(ctx context.Context, obj *models.UserNotificationPreferences) ([]models.UserNotificationPreferenceFlag, error) + + DataExchangeApproachCompleted(ctx context.Context, obj *models.UserNotificationPreferences) ([]models.UserNotificationPreferenceFlag, error) } type UserViewCustomizationResolver interface { ViewCustomization(ctx context.Context, obj *models.UserViewCustomization) ([]models.ViewCustomizationType, error) @@ -8742,6 +8745,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.UserNotificationPreferences.DailyDigestComplete(childComplexity), true + case "UserNotificationPreferences.dataExchangeApproachCompleted": + if e.complexity.UserNotificationPreferences.DataExchangeApproachCompleted == nil { + break + } + + return e.complexity.UserNotificationPreferences.DataExchangeApproachCompleted(childComplexity), true + case "UserNotificationPreferences.datesChanged": if e.complexity.UserNotificationPreferences.DatesChanged == nil { break @@ -12171,6 +12181,8 @@ type UserNotificationPreferences { datesChanged: [UserNotificationPreferenceFlag!]! datesChangedNotificationType: DatesChangedNotificationType + dataExchangeApproachCompleted: [UserNotificationPreferenceFlag!]! + createdBy: UUID! createdByUserAccount: UserAccount! createdDts: Time! @@ -12201,6 +12213,8 @@ input UserNotificationPreferencesChanges @goModel(model: "map[string]interface{} datesChanged: [UserNotificationPreferenceFlag!] datesChangedNotificationType: DatesChangedNotificationType + + dataExchangeApproachCompleted: [UserNotificationPreferenceFlag!] } extend type Mutation { @@ -16501,6 +16515,8 @@ func (ec *executionContext) fieldContext_CurrentUser_notificationPreferences(ctx return ec.fieldContext_UserNotificationPreferences_datesChanged(ctx, field) case "datesChangedNotificationType": return ec.fieldContext_UserNotificationPreferences_datesChangedNotificationType(ctx, field) + case "dataExchangeApproachCompleted": + return ec.fieldContext_UserNotificationPreferences_dataExchangeApproachCompleted(ctx, field) case "createdBy": return ec.fieldContext_UserNotificationPreferences_createdBy(ctx, field) case "createdByUserAccount": @@ -28799,6 +28815,8 @@ func (ec *executionContext) fieldContext_Mutation_updateUserNotificationPreferen return ec.fieldContext_UserNotificationPreferences_datesChanged(ctx, field) case "datesChangedNotificationType": return ec.fieldContext_UserNotificationPreferences_datesChangedNotificationType(ctx, field) + case "dataExchangeApproachCompleted": + return ec.fieldContext_UserNotificationPreferences_dataExchangeApproachCompleted(ctx, field) case "createdBy": return ec.fieldContext_UserNotificationPreferences_createdBy(ctx, field) case "createdByUserAccount": @@ -64202,6 +64220,50 @@ func (ec *executionContext) fieldContext_UserNotificationPreferences_datesChange return fc, nil } +func (ec *executionContext) _UserNotificationPreferences_dataExchangeApproachCompleted(ctx context.Context, field graphql.CollectedField, obj *models.UserNotificationPreferences) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserNotificationPreferences_dataExchangeApproachCompleted(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.UserNotificationPreferences().DataExchangeApproachCompleted(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]models.UserNotificationPreferenceFlag) + fc.Result = res + return ec.marshalNUserNotificationPreferenceFlag2ᚕgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐUserNotificationPreferenceFlagᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserNotificationPreferences_dataExchangeApproachCompleted(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserNotificationPreferences", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UserNotificationPreferenceFlag does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _UserNotificationPreferences_createdBy(ctx context.Context, field graphql.CollectedField, obj *models.UserNotificationPreferences) (ret graphql.Marshaler) { fc, err := ec.fieldContext_UserNotificationPreferences_createdBy(ctx, field) if err != nil { @@ -79996,6 +80058,42 @@ func (ec *executionContext) _UserNotificationPreferences(ctx context.Context, se out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "datesChangedNotificationType": out.Values[i] = ec._UserNotificationPreferences_datesChangedNotificationType(ctx, field, obj) + case "dataExchangeApproachCompleted": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._UserNotificationPreferences_dataExchangeApproachCompleted(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "createdBy": out.Values[i] = ec._UserNotificationPreferences_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { diff --git a/pkg/graph/resolvers/user_notification_preferences.resolvers.go b/pkg/graph/resolvers/user_notification_preferences.resolvers.go index d8d9ec3bfb..7c95a542c0 100644 --- a/pkg/graph/resolvers/user_notification_preferences.resolvers.go +++ b/pkg/graph/resolvers/user_notification_preferences.resolvers.go @@ -6,6 +6,7 @@ package resolvers import ( "context" + "fmt" "github.com/cmsgov/mint-app/pkg/appcontext" "github.com/cmsgov/mint-app/pkg/graph/generated" @@ -60,6 +61,11 @@ func (r *userNotificationPreferencesResolver) DatesChanged(ctx context.Context, return obj.DatesChanged, nil } +// DataExchangeApproachCompleted is the resolver for the dataExchangeApproachCompleted field. +func (r *userNotificationPreferencesResolver) DataExchangeApproachCompleted(ctx context.Context, obj *models.UserNotificationPreferences) ([]models.UserNotificationPreferenceFlag, error) { + panic(fmt.Errorf("not implemented: DataExchangeApproachCompleted - dataExchangeApproachCompleted")) +} + // UserNotificationPreferences returns generated.UserNotificationPreferencesResolver implementation. func (r *Resolver) UserNotificationPreferences() generated.UserNotificationPreferencesResolver { return &userNotificationPreferencesResolver{r} diff --git a/pkg/graph/schema/types/user_notification_preferences.graphql b/pkg/graph/schema/types/user_notification_preferences.graphql index 5bcb3d5d1e..814db3c6ee 100644 --- a/pkg/graph/schema/types/user_notification_preferences.graphql +++ b/pkg/graph/schema/types/user_notification_preferences.graphql @@ -34,6 +34,8 @@ type UserNotificationPreferences { datesChanged: [UserNotificationPreferenceFlag!]! datesChangedNotificationType: DatesChangedNotificationType + dataExchangeApproachCompleted: [UserNotificationPreferenceFlag!]! + createdBy: UUID! createdByUserAccount: UserAccount! createdDts: Time! @@ -64,6 +66,8 @@ input UserNotificationPreferencesChanges @goModel(model: "map[string]interface{} datesChanged: [UserNotificationPreferenceFlag!] datesChangedNotificationType: DatesChangedNotificationType + + dataExchangeApproachCompleted: [UserNotificationPreferenceFlag!] } extend type Mutation { diff --git a/src/gql/apolloGQL/Notifications/GetNotificationSettings.ts b/src/gql/apolloGQL/Notifications/GetNotificationSettings.ts index f072b832e9..17186ad920 100644 --- a/src/gql/apolloGQL/Notifications/GetNotificationSettings.ts +++ b/src/gql/apolloGQL/Notifications/GetNotificationSettings.ts @@ -14,6 +14,7 @@ export default gql(/* GraphQL */ ` newModelPlan datesChanged datesChangedNotificationType + dataExchangeApproachCompleted } } } diff --git a/src/gql/apolloGQL/Notifications/UpdateNotificationSettings.ts b/src/gql/apolloGQL/Notifications/UpdateNotificationSettings.ts index 273a402e0b..a3b3772582 100644 --- a/src/gql/apolloGQL/Notifications/UpdateNotificationSettings.ts +++ b/src/gql/apolloGQL/Notifications/UpdateNotificationSettings.ts @@ -15,6 +15,7 @@ export default gql(/* GraphQL */ ` newModelPlan datesChanged datesChangedNotificationType + dataExchangeApproachCompleted } } `); diff --git a/src/gql/gen/graphql.ts b/src/gql/gen/graphql.ts index 8fefb74e05..d6b0264859 100644 --- a/src/gql/gen/graphql.ts +++ b/src/gql/gen/graphql.ts @@ -3026,6 +3026,7 @@ export type UserNotificationPreferences = { createdByUserAccount: UserAccount; createdDts: Scalars['Time']['output']; dailyDigestComplete: Array; + dataExchangeApproachCompleted: Array; datesChanged: Array; datesChangedNotificationType?: Maybe; id: Scalars['UUID']['output']; @@ -3044,6 +3045,7 @@ export type UserNotificationPreferences = { export type UserNotificationPreferencesChanges = { addedAsCollaborator?: InputMaybe>; dailyDigestComplete?: InputMaybe>; + dataExchangeApproachCompleted?: InputMaybe>; datesChanged?: InputMaybe>; datesChangedNotificationType?: InputMaybe; modelPlanShared?: InputMaybe>; @@ -3704,7 +3706,7 @@ export type UpdateNdaMutation = { __typename: 'Mutation', agreeToNDA: { __typena export type GetNotificationSettingsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetNotificationSettingsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notificationPreferences: { __typename: 'UserNotificationPreferences', id: UUID, dailyDigestComplete: Array, addedAsCollaborator: Array, taggedInDiscussion: Array, taggedInDiscussionReply: Array, newDiscussionReply: Array, modelPlanShared: Array, newModelPlan: Array, datesChanged: Array, datesChangedNotificationType?: DatesChangedNotificationType | null } } }; +export type GetNotificationSettingsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notificationPreferences: { __typename: 'UserNotificationPreferences', id: UUID, dailyDigestComplete: Array, addedAsCollaborator: Array, taggedInDiscussion: Array, taggedInDiscussionReply: Array, newDiscussionReply: Array, modelPlanShared: Array, newModelPlan: Array, datesChanged: Array, datesChangedNotificationType?: DatesChangedNotificationType | null, dataExchangeApproachCompleted: Array } } }; export type GetNotificationsQueryVariables = Exact<{ [key: string]: never; }>; @@ -3726,7 +3728,7 @@ export type UpdateNotificationSettingsMutationVariables = Exact<{ }>; -export type UpdateNotificationSettingsMutation = { __typename: 'Mutation', updateUserNotificationPreferences: { __typename: 'UserNotificationPreferences', id: UUID, dailyDigestComplete: Array, addedAsCollaborator: Array, taggedInDiscussion: Array, taggedInDiscussionReply: Array, newDiscussionReply: Array, modelPlanShared: Array, newModelPlan: Array, datesChanged: Array, datesChangedNotificationType?: DatesChangedNotificationType | null } }; +export type UpdateNotificationSettingsMutation = { __typename: 'Mutation', updateUserNotificationPreferences: { __typename: 'UserNotificationPreferences', id: UUID, dailyDigestComplete: Array, addedAsCollaborator: Array, taggedInDiscussion: Array, taggedInDiscussionReply: Array, newDiscussionReply: Array, modelPlanShared: Array, newModelPlan: Array, datesChanged: Array, datesChangedNotificationType?: DatesChangedNotificationType | null, dataExchangeApproachCompleted: Array } }; export type MarkNotificationAsReadMutationVariables = Exact<{ notificationID: Scalars['UUID']['input']; @@ -8824,6 +8826,7 @@ export const GetNotificationSettingsDocument = gql` newModelPlan datesChanged datesChangedNotificationType + dataExchangeApproachCompleted } } } @@ -9120,6 +9123,7 @@ export const UpdateNotificationSettingsDocument = gql` newModelPlan datesChanged datesChangedNotificationType + dataExchangeApproachCompleted } } `; @@ -11733,11 +11737,11 @@ export const TypedGetUserInfoDocument = {"kind":"Document","definitions":[{"kind export const TypedSearchOktaUsersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SearchOktaUsers"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"searchTerm"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"searchOktaUsers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"searchTerm"},"value":{"kind":"Variable","name":{"kind":"Name","value":"searchTerm"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"email"}}]}}]}}]} as unknown as DocumentNode; export const TypedUpdateModelPlanDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateModelPlan"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"changes"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ModelPlanChanges"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateModelPlan"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"changes"},"value":{"kind":"Variable","name":{"kind":"Name","value":"changes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; export const TypedUpdateNdaDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNDA"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agreeToNDA"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agree"},"value":{"kind":"BooleanValue","value":true}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agreed"}},{"kind":"Field","name":{"kind":"Name","value":"agreedDts"}}]}}]}}]} as unknown as DocumentNode; -export const TypedGetNotificationSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotificationSettings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notificationPreferences"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dailyDigestComplete"}},{"kind":"Field","name":{"kind":"Name","value":"addedAsCollaborator"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussion"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"newDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanShared"}},{"kind":"Field","name":{"kind":"Name","value":"newModelPlan"}},{"kind":"Field","name":{"kind":"Name","value":"datesChanged"}},{"kind":"Field","name":{"kind":"Name","value":"datesChangedNotificationType"}}]}}]}}]}}]} as unknown as DocumentNode; +export const TypedGetNotificationSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotificationSettings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notificationPreferences"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dailyDigestComplete"}},{"kind":"Field","name":{"kind":"Name","value":"addedAsCollaborator"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussion"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"newDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanShared"}},{"kind":"Field","name":{"kind":"Name","value":"newModelPlan"}},{"kind":"Field","name":{"kind":"Name","value":"datesChanged"}},{"kind":"Field","name":{"kind":"Name","value":"datesChangedNotificationType"}},{"kind":"Field","name":{"kind":"Name","value":"dataExchangeApproachCompleted"}}]}}]}}]}}]} as unknown as DocumentNode; export const TypedGetNotificationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"numUnreadNotifications"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"inAppSent"}},{"kind":"Field","name":{"kind":"Name","value":"emailSent"}},{"kind":"Field","name":{"kind":"Name","value":"createdDts"}},{"kind":"Field","name":{"kind":"Name","value":"activity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityID"}},{"kind":"Field","name":{"kind":"Name","value":"actorID"}},{"kind":"Field","name":{"kind":"Name","value":"actorUserAccount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"commonName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"metaData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NewDiscussionRepliedActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"discussionID"}},{"kind":"Field","name":{"kind":"Name","value":"replyID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"content"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DatesChangedActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"dateChanges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isChanged"}},{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"Field","name":{"kind":"Name","value":"isRange"}},{"kind":"Field","name":{"kind":"Name","value":"oldDate"}},{"kind":"Field","name":{"kind":"Name","value":"newDate"}},{"kind":"Field","name":{"kind":"Name","value":"oldRangeStart"}},{"kind":"Field","name":{"kind":"Name","value":"oldRangeEnd"}},{"kind":"Field","name":{"kind":"Name","value":"newRangeStart"}},{"kind":"Field","name":{"kind":"Name","value":"newRangeEnd"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TaggedInPlanDiscussionActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"discussionID"}},{"kind":"Field","name":{"kind":"Name","value":"content"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AddedAsCollaboratorMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TaggedInDiscussionReplyActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"discussionID"}},{"kind":"Field","name":{"kind":"Name","value":"replyID"}},{"kind":"Field","name":{"kind":"Name","value":"content"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ModelPlanSharedActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"optionalMessage"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NewModelPlanActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DailyDigestCompleteActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanIDs"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"analyzedAudits"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelName"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"changes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oldName"}},{"kind":"Field","name":{"kind":"Name","value":"statusChanges"}}]}},{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"crTdls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activity"}}]}},{"kind":"Field","name":{"kind":"Name","value":"planSections"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updated"}},{"kind":"Field","name":{"kind":"Name","value":"readyForReview"}},{"kind":"Field","name":{"kind":"Name","value":"readyForClearance"}}]}},{"kind":"Field","name":{"kind":"Name","value":"modelLeads"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"added"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"commonName"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"planDiscussions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activity"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const TypedGetPollNotificationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPollNotifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"numUnreadNotifications"}}]}}]}}]}}]} as unknown as DocumentNode; export const TypedUpdateAllNotificationsAsReadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateAllNotificationsAsRead"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"markAllNotificationsAsRead"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; -export const TypedUpdateNotificationSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNotificationSettings"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"changes"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UserNotificationPreferencesChanges"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateUserNotificationPreferences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"changes"},"value":{"kind":"Variable","name":{"kind":"Name","value":"changes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dailyDigestComplete"}},{"kind":"Field","name":{"kind":"Name","value":"addedAsCollaborator"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussion"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"newDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanShared"}},{"kind":"Field","name":{"kind":"Name","value":"newModelPlan"}},{"kind":"Field","name":{"kind":"Name","value":"datesChanged"}},{"kind":"Field","name":{"kind":"Name","value":"datesChangedNotificationType"}}]}}]}}]} as unknown as DocumentNode; +export const TypedUpdateNotificationSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNotificationSettings"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"changes"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UserNotificationPreferencesChanges"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateUserNotificationPreferences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"changes"},"value":{"kind":"Variable","name":{"kind":"Name","value":"changes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dailyDigestComplete"}},{"kind":"Field","name":{"kind":"Name","value":"addedAsCollaborator"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussion"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"newDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanShared"}},{"kind":"Field","name":{"kind":"Name","value":"newModelPlan"}},{"kind":"Field","name":{"kind":"Name","value":"datesChanged"}},{"kind":"Field","name":{"kind":"Name","value":"datesChangedNotificationType"}},{"kind":"Field","name":{"kind":"Name","value":"dataExchangeApproachCompleted"}}]}}]}}]} as unknown as DocumentNode; export const TypedMarkNotificationAsReadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"MarkNotificationAsRead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"notificationID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"markNotificationAsRead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"notificationID"},"value":{"kind":"Variable","name":{"kind":"Name","value":"notificationID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}}]}}]}}]} as unknown as DocumentNode; export const TypedGetAllOpsEvalAndLearningDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAllOpsEvalAndLearning"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"opsEvalAndLearning"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"stakeholders"}},{"kind":"Field","name":{"kind":"Name","value":"stakeholdersOther"}},{"kind":"Field","name":{"kind":"Name","value":"stakeholdersNote"}},{"kind":"Field","name":{"kind":"Name","value":"helpdeskUse"}},{"kind":"Field","name":{"kind":"Name","value":"helpdeskUseNote"}},{"kind":"Field","name":{"kind":"Name","value":"contractorSupport"}},{"kind":"Field","name":{"kind":"Name","value":"contractorSupportOther"}},{"kind":"Field","name":{"kind":"Name","value":"contractorSupportHow"}},{"kind":"Field","name":{"kind":"Name","value":"contractorSupportNote"}},{"kind":"Field","name":{"kind":"Name","value":"iddocSupport"}},{"kind":"Field","name":{"kind":"Name","value":"iddocSupportNote"}},{"kind":"Field","name":{"kind":"Name","value":"technicalContactsIdentified"}},{"kind":"Field","name":{"kind":"Name","value":"technicalContactsIdentifiedDetail"}},{"kind":"Field","name":{"kind":"Name","value":"technicalContactsIdentifiedNote"}},{"kind":"Field","name":{"kind":"Name","value":"captureParticipantInfo"}},{"kind":"Field","name":{"kind":"Name","value":"captureParticipantInfoNote"}},{"kind":"Field","name":{"kind":"Name","value":"icdOwner"}},{"kind":"Field","name":{"kind":"Name","value":"draftIcdDueDate"}},{"kind":"Field","name":{"kind":"Name","value":"icdNote"}},{"kind":"Field","name":{"kind":"Name","value":"uatNeeds"}},{"kind":"Field","name":{"kind":"Name","value":"stcNeeds"}},{"kind":"Field","name":{"kind":"Name","value":"testingTimelines"}},{"kind":"Field","name":{"kind":"Name","value":"testingNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataMonitoringFileTypes"}},{"kind":"Field","name":{"kind":"Name","value":"dataMonitoringFileOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataResponseType"}},{"kind":"Field","name":{"kind":"Name","value":"dataResponseFileFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"dataFullTimeOrIncremental"}},{"kind":"Field","name":{"kind":"Name","value":"eftSetUp"}},{"kind":"Field","name":{"kind":"Name","value":"unsolicitedAdjustmentsIncluded"}},{"kind":"Field","name":{"kind":"Name","value":"dataFlowDiagramsNeeded"}},{"kind":"Field","name":{"kind":"Name","value":"produceBenefitEnhancementFiles"}},{"kind":"Field","name":{"kind":"Name","value":"fileNamingConventions"}},{"kind":"Field","name":{"kind":"Name","value":"dataMonitoringNote"}},{"kind":"Field","name":{"kind":"Name","value":"benchmarkForPerformance"}},{"kind":"Field","name":{"kind":"Name","value":"benchmarkForPerformanceNote"}},{"kind":"Field","name":{"kind":"Name","value":"computePerformanceScores"}},{"kind":"Field","name":{"kind":"Name","value":"computePerformanceScoresNote"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustPerformance"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustFeedback"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustPayments"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustOther"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustNote"}},{"kind":"Field","name":{"kind":"Name","value":"appealPerformance"}},{"kind":"Field","name":{"kind":"Name","value":"appealFeedback"}},{"kind":"Field","name":{"kind":"Name","value":"appealPayments"}},{"kind":"Field","name":{"kind":"Name","value":"appealOther"}},{"kind":"Field","name":{"kind":"Name","value":"appealNote"}},{"kind":"Field","name":{"kind":"Name","value":"evaluationApproaches"}},{"kind":"Field","name":{"kind":"Name","value":"evaluationApproachOther"}},{"kind":"Field","name":{"kind":"Name","value":"evalutaionApproachNote"}},{"kind":"Field","name":{"kind":"Name","value":"ccmInvolvment"}},{"kind":"Field","name":{"kind":"Name","value":"ccmInvolvmentOther"}},{"kind":"Field","name":{"kind":"Name","value":"ccmInvolvmentNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataNeededForMonitoring"}},{"kind":"Field","name":{"kind":"Name","value":"dataNeededForMonitoringOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataNeededForMonitoringNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataToSendParticicipants"}},{"kind":"Field","name":{"kind":"Name","value":"dataToSendParticicipantsOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataToSendParticicipantsNote"}},{"kind":"Field","name":{"kind":"Name","value":"shareCclfData"}},{"kind":"Field","name":{"kind":"Name","value":"shareCclfDataNote"}},{"kind":"Field","name":{"kind":"Name","value":"sendFilesBetweenCcw"}},{"kind":"Field","name":{"kind":"Name","value":"sendFilesBetweenCcwNote"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToKnown"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToWhich"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToNote"}},{"kind":"Field","name":{"kind":"Name","value":"useCcwForFileDistribiutionToParticipants"}},{"kind":"Field","name":{"kind":"Name","value":"useCcwForFileDistribiutionToParticipantsNote"}},{"kind":"Field","name":{"kind":"Name","value":"developNewQualityMeasures"}},{"kind":"Field","name":{"kind":"Name","value":"developNewQualityMeasuresNote"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPayment"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPaymentOther"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPaymentNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingStarts"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingStartsOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingFrequencyContinually"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingFrequencyOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingStartsNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionStarts"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionStartsOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionFrequencyContinually"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionFrequencyOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionFrequencyNote"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingStarts"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingStartsOther"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingStartsNote"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingFrequencyContinually"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingFrequencyOther"}},{"kind":"Field","name":{"kind":"Name","value":"modelLearningSystems"}},{"kind":"Field","name":{"kind":"Name","value":"modelLearningSystemsOther"}},{"kind":"Field","name":{"kind":"Name","value":"modelLearningSystemsNote"}},{"kind":"Field","name":{"kind":"Name","value":"anticipatedChallenges"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode; export const TypedGetCcwAndQualityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCCWAndQuality"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"modelName"}},{"kind":"Field","name":{"kind":"Name","value":"opsEvalAndLearning"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"ccmInvolvment"}},{"kind":"Field","name":{"kind":"Name","value":"dataNeededForMonitoring"}},{"kind":"Field","name":{"kind":"Name","value":"iddocSupport"}},{"kind":"Field","name":{"kind":"Name","value":"sendFilesBetweenCcw"}},{"kind":"Field","name":{"kind":"Name","value":"sendFilesBetweenCcwNote"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToKnown"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToWhich"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToNote"}},{"kind":"Field","name":{"kind":"Name","value":"useCcwForFileDistribiutionToParticipants"}},{"kind":"Field","name":{"kind":"Name","value":"useCcwForFileDistribiutionToParticipantsNote"}},{"kind":"Field","name":{"kind":"Name","value":"developNewQualityMeasures"}},{"kind":"Field","name":{"kind":"Name","value":"developNewQualityMeasuresNote"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPayment"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPaymentOther"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPaymentNote"}}]}},{"kind":"Field","name":{"kind":"Name","value":"operationalNeeds"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"modifiedDts"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/src/views/Notifications/Settings/index.test.tsx b/src/views/Notifications/Settings/index.test.tsx index 0ca7de62f0..0bdb830c16 100644 --- a/src/views/Notifications/Settings/index.test.tsx +++ b/src/views/Notifications/Settings/index.test.tsx @@ -46,6 +46,10 @@ const notificationsSettingsMock = [ UserNotificationPreferenceFlag.EMAIL, UserNotificationPreferenceFlag.IN_APP ], + dataExchangeApproachCompleted: [ + UserNotificationPreferenceFlag.EMAIL, + UserNotificationPreferenceFlag.IN_APP + ], newModelPlan: [], datesChanged: [], datesChangedNotificationType: null From d52fdee77ac694db8ab560a6e3f3007c926bc765 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Wed, 3 Jul 2024 19:14:37 -0400 Subject: [PATCH 06/17] chore: added simple resolver helper to dispatch emails and email test to validate email templates --- cmd/dbseed/main.go | 2 + cmd/test_email/main.go | 29 +++- pkg/email/data_exchange_approach_completed.go | 15 ++ pkg/email/template_service_impl.go | 16 ++ ...data_exchange_approach_completed_body.html | 19 ++ ...a_exchange_approach_completed_subject.html | 1 + .../data_exchange_approach_helper.go | 164 ++++++++++++++++++ ...change_approach_completed_activity_meta.go | 2 - 8 files changed, 245 insertions(+), 3 deletions(-) create mode 100644 pkg/email/data_exchange_approach_completed.go create mode 100644 pkg/email/templates/data_exchange_approach_completed_body.html create mode 100644 pkg/email/templates/data_exchange_approach_completed_subject.html create mode 100644 pkg/graph/resolvers/data_exchange_approach_helper.go diff --git a/cmd/dbseed/main.go b/cmd/dbseed/main.go index 4979afc717..c1b1c2af76 100644 --- a/cmd/dbseed/main.go +++ b/cmd/dbseed/main.go @@ -269,6 +269,8 @@ func (s *Seeder) SeedData() { planWithDocuments.ID, ) + dataExchangeApproach.ID = uuid.MustParse("01020304-0506-0708-090a-0b0c0d0e0f10") + // create an actor principal for testing notifications actorPrincipal := s.getTestPrincipalByUsername("MINT") diff --git a/cmd/test_email/main.go b/cmd/test_email/main.go index 4c6b8715f7..ed13a424e7 100644 --- a/cmd/test_email/main.go +++ b/cmd/test_email/main.go @@ -21,22 +21,25 @@ func main() { // Running all test functions sendModelPlanCreatedEmailTest(emailService, templateService) + // Discussion emails sendPlanDiscussionCreatedTestEmail(emailService, templateService, addressBook) sendPlanDiscussionTaggedUserTestEmail(emailService, templateService, addressBook) sendPlanDiscussionTaggedSolutionTestEmail(emailService, templateService, addressBook) + //DiscussionReply email sendDiscussionReplyOriginatorTestEmail(emailService, templateService, addressBook) + // Model plan emails sendModelPlanShareTest(emailService, templateService, addressBook) sendDateChangedEmailsTest(emailService, templateService, addressBook) sendCollaboratorAddedEmailTest(emailService, templateService, addressBook) + sendDataExchangeApproachCompletedEmailNotificationTest(emailService, templateService, addressBook) sendFeedbackEmail(emailService, templateService, addressBook) reportAProblemEmail(emailService, templateService, addressBook) // Solution emails sendSolutionSelectedTestEmail(emailService, templateService, addressBook) - } func noErr(err error) { @@ -390,6 +393,30 @@ func sendCollaboratorAddedEmailTest( noErr(err) } +func sendDataExchangeApproachCompletedEmailNotificationTest( + emailService oddmail.EmailService, + templateService email.TemplateService, + addressBook email.AddressBook, +) { + + modelPlan := models.NewModelPlan( + uuid.Nil, + "Retcon Plan", + ) + + err := resolvers.SendDataExchangeApproachCompletedEmailNotification( + emailService, + templateService, + addressBook, + modelPlan, + "marty.mcfly@delorean.88", + "Doc Brown", + true, + ) + + noErr(err) +} + func sendFeedbackEmail( emailService oddmail.EmailService, templateService email.TemplateService, diff --git a/pkg/email/data_exchange_approach_completed.go b/pkg/email/data_exchange_approach_completed.go new file mode 100644 index 0000000000..49e9bcf398 --- /dev/null +++ b/pkg/email/data_exchange_approach_completed.go @@ -0,0 +1,15 @@ +package email + +// DataExchangeApproachCompletedSubjectContent defines the parameters necessary for the corresponding email subject +type DataExchangeApproachCompletedSubjectContent struct { + ModelName string +} + +// DataExchangeApproachCompletedBodyContent defines the parameters necessary for the corresponding email body +type DataExchangeApproachCompletedBodyContent struct { + ClientAddress string + ModelName string + ModelID string + MarkedCompletedByUserCommonName string + ShowFooter bool +} diff --git a/pkg/email/template_service_impl.go b/pkg/email/template_service_impl.go index 75e451fd5c..0b4d0c1eab 100644 --- a/pkg/email/template_service_impl.go +++ b/pkg/email/template_service_impl.go @@ -139,6 +139,15 @@ var solutionSelectedBodyTemplate string //go:embed templates/solution_selected_subject.html var solutionSelectedSubjectTemplate string +// DataExchangeApproachCompletedTemplateName is the template name for the data exchange approach completed email +const DataExchangeApproachCompletedTemplateName string = "data_exchange_approach_completed" + +//go:embed templates/data_exchange_approach_completed_body.html +var dataExchangeApproachCompletedBodyTemplate string + +//go:embed templates/data_exchange_approach_completed_subject.html +var dataExchangeApproachCompletedSubjectTemplate string + // TemplateServiceImpl is an implementation-specific structure loading all resources necessary for server execution type TemplateServiceImpl struct { templateCache *emailTemplates.TemplateCache @@ -185,6 +194,7 @@ func (t *TemplateServiceImpl) Load() error { if err != nil { return err } + err = t.loadEmailTemplate(DiscussionReplyCreatedOriginatorTemplateName, discussionReplyCreatedOriginatorSubjectTemplate, discussionReplyCreatedOriginatorBodyTemplate) if err != nil { return err @@ -224,6 +234,12 @@ func (t *TemplateServiceImpl) Load() error { if err != nil { return err } + + err = t.loadEmailTemplate(DataExchangeApproachCompletedTemplateName, dataExchangeApproachCompletedSubjectTemplate, dataExchangeApproachCompletedBodyTemplate) + if err != nil { + return err + } + return nil } diff --git a/pkg/email/templates/data_exchange_approach_completed_body.html b/pkg/email/templates/data_exchange_approach_completed_body.html new file mode 100644 index 0000000000..31070e32f7 --- /dev/null +++ b/pkg/email/templates/data_exchange_approach_completed_body.html @@ -0,0 +1,19 @@ +{{template "shared_header.html" "Data exchange approach complete:"}} + +

{{.ModelName}}

+

Marked complete by {{.MarkedCompletedByUserCommonName}}

+
+

+ View data exchange approach +

+
+ +{{if .ShowFooter}} +
+
+

+ You are currently subscribed to notifications when data exchange approaches are completed. If you no longer wish to receive these email notifications, please unsubscribe or change your notification settings. +

+{{end}} + +{{template "shared_footer.html"}} \ No newline at end of file diff --git a/pkg/email/templates/data_exchange_approach_completed_subject.html b/pkg/email/templates/data_exchange_approach_completed_subject.html new file mode 100644 index 0000000000..965e963b9c --- /dev/null +++ b/pkg/email/templates/data_exchange_approach_completed_subject.html @@ -0,0 +1 @@ +Data exchange approach complete: {{.ModelName}} \ No newline at end of file diff --git a/pkg/graph/resolvers/data_exchange_approach_helper.go b/pkg/graph/resolvers/data_exchange_approach_helper.go new file mode 100644 index 0000000000..c53e24f9c1 --- /dev/null +++ b/pkg/graph/resolvers/data_exchange_approach_helper.go @@ -0,0 +1,164 @@ +package resolvers + +import ( + "context" + + "github.com/google/uuid" + "go.uber.org/zap" + + "github.com/cmsgov/mint-app/pkg/appcontext" + "github.com/cmsgov/mint-app/pkg/email" + "github.com/cmsgov/mint-app/pkg/models" + "github.com/cmsgov/mint-app/pkg/notifications" + "github.com/cmsgov/mint-app/pkg/shared/oddmail" + "github.com/cmsgov/mint-app/pkg/sqlutils" + "github.com/cmsgov/mint-app/pkg/storage/loaders" + "github.com/cmsgov/mint-app/pkg/userhelpers" +) + +func SendDataExchangeApproachCompletedEmailNotification( + emailService oddmail.EmailService, + templateService email.TemplateService, + addressBook email.AddressBook, + modelPlan *models.ModelPlan, + userEmail string, + markedCompletedByUserCommonName string, + showFooter bool, +) error { + emailTemplate, err := templateService.GetEmailTemplate(email.DataExchangeApproachCompletedTemplateName) + if err != nil { + return err + } + + emailSubject, err := emailTemplate.GetExecutedSubject(email.DataExchangeApproachCompletedSubjectContent{ + ModelName: modelPlan.ModelName, + }) + if err != nil { + return err + } + + emailBody, err := emailTemplate.GetExecutedBody(email.DataExchangeApproachCompletedBodyContent{ + ClientAddress: emailService.GetConfig().GetClientAddress(), + ModelName: modelPlan.ModelName, + ModelID: modelPlan.GetModelPlanID().String(), + MarkedCompletedByUserCommonName: markedCompletedByUserCommonName, + ShowFooter: showFooter, + }) + if err != nil { + return err + } + + err = emailService.Send( + addressBook.DefaultSender, + []string{userEmail}, + nil, + emailSubject, + "text/html", + emailBody, + ) + if err != nil { + return err + } + return nil +} + +func SendDataExchangeApproachCompletedEmailNotifications( + ctx context.Context, + emailService oddmail.EmailService, + templateService email.TemplateService, + addressBook email.AddressBook, + receiverIDs []uuid.UUID, + modelPlan *models.ModelPlan, + markedCompletedByUserCommonName string, + showFooter bool, +) error { + for _, userID := range receiverIDs { + user, err := userhelpers.UserAccountGetByIDLOADER(ctx, userID) + if err != nil { + return err + } + + err = SendDataExchangeApproachCompletedEmailNotification( + emailService, + templateService, + addressBook, + modelPlan, + user.Email, + markedCompletedByUserCommonName, + showFooter, + ) + if err != nil { + return err + } + } + return nil +} + +func SendDataExchangeApproachCompletedNotification( + ctx context.Context, + emailService oddmail.EmailService, + templateService email.TemplateService, + addressBook email.AddressBook, + actorID uuid.UUID, + np sqlutils.NamedPreparer, + receiverIDs []uuid.UUID, + modelPlan *models.ModelPlan, + approach *models.DataExchangeApproach, // TODO: We should probably remove this and reference it from modelPlan + markedCompletedBy uuid.UUID, +) error { + logger := appcontext.ZLogger(ctx) + + // Create and send in-app notifications + _, err := notifications.ActivityDataExchangeApproachCompletedCreate( + ctx, + actorID, + np, + receiverIDs, + approach, + markedCompletedBy, + loaders.UserNotificationPreferencesGetByUserID, + ) + if err != nil { + logger.Error("failed to create and send in-app notifications", zap.Error(err)) + return err + } + + markedCompletedByUser, err := userhelpers.UserAccountGetByIDLOADER(ctx, markedCompletedBy) + if err != nil { + logger.Error("failed to get marked completed by user", zap.Error(err)) + return err + } + + // Send email to the MINTTeam email address from the address book + err = SendDataExchangeApproachCompletedEmailNotification( + emailService, + templateService, + addressBook, + modelPlan, + addressBook.MINTTeamEmail, + markedCompletedByUser.CommonName, + false, + ) + if err != nil { + logger.Error("failed to send email to MINTTeam", zap.Error(err)) + return err + } + + // Create and send email notifications + err = SendDataExchangeApproachCompletedEmailNotifications( + ctx, + emailService, + templateService, + addressBook, + receiverIDs, + modelPlan, + markedCompletedByUser.CommonName, + true, + ) + if err != nil { + logger.Error("failed to send email notifications", zap.Error(err)) + return err + } + + return nil +} diff --git a/pkg/models/data_exchange_approach_completed_activity_meta.go b/pkg/models/data_exchange_approach_completed_activity_meta.go index bfcf210de1..9147ed0a1c 100644 --- a/pkg/models/data_exchange_approach_completed_activity_meta.go +++ b/pkg/models/data_exchange_approach_completed_activity_meta.go @@ -10,8 +10,6 @@ import ( // is relevant to completing a Data Exchange Approach type DataExchangeApproachCompletedActivityMeta struct { ActivityMetaBaseStruct - Version int `json:"version"` - Type ActivityType `json:"type"` DataExchangeApproach *DataExchangeApproach `json:"dataExchangeApproach"` MarkedCompleteBy uuid.UUID `json:"markedCompleteBy"` } From db2222684c8fc1f8b814bbb49c735bccd27ad07d Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Thu, 4 Jul 2024 23:40:27 -0400 Subject: [PATCH 07/17] chore: removed resolved question --- cmd/dbseed/main.go | 18 ++++++++++++------ pkg/models/data_exchange_approach.go | 2 -- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmd/dbseed/main.go b/cmd/dbseed/main.go index c1b1c2af76..47d92443ca 100644 --- a/cmd/dbseed/main.go +++ b/cmd/dbseed/main.go @@ -5,9 +5,6 @@ import ( "fmt" "time" - "github.com/cmsgov/mint-app/pkg/notifications" - "github.com/cmsgov/mint-app/pkg/storage/loaders" - "github.com/google/uuid" "github.com/lib/pq" @@ -275,15 +272,24 @@ func (s *Seeder) SeedData() { actorPrincipal := s.getTestPrincipalByUsername("MINT") - _, err = notifications.ActivityDataExchangeApproachCompletedCreate( + // Use a test user to mark the data exchange approach as complete + testUser := s.getTestPrincipalByUsername("BTAL") + + err = resolvers.SendDataExchangeApproachCompletedNotification( s.Config.Context, + s.Config.EmailService, + s.Config.EmailTemplateService, + s.Config.AddressBook, actorPrincipal.UserAccount.ID, s.Config.Store, []uuid.UUID{planWithDocuments.CreatedBy}, + planWithDocuments, dataExchangeApproach, - planWithDocuments.CreatedBy, - loaders.UserNotificationPreferencesGetByUserID, + testUser.UserAccount.ID, ) + if err != nil { + panic(fmt.Errorf("failed to send data exchange approach completed notification: %w", err)) + } } // CreateAnalyzedAuditData uses the seeder to generate analyzed audits. It will make one record for all changes just seeded diff --git a/pkg/models/data_exchange_approach.go b/pkg/models/data_exchange_approach.go index 69a0eb14de..68d22f3915 100644 --- a/pkg/models/data_exchange_approach.go +++ b/pkg/models/data_exchange_approach.go @@ -6,8 +6,6 @@ import ( "github.com/google/uuid" ) -// TODO: Should this be DataExchange? DataExchangeConcept? How do we want to identify this model? - // DataExchangeApproach represents the data exchange approach of a model plan type DataExchangeApproach struct { baseStruct From a8dab47dbd502c35d01de76c5f7c1229a49c950d Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Fri, 5 Jul 2024 01:33:10 -0400 Subject: [PATCH 08/17] chore: Reset all frontend files to main branch as we split the frontend work to EASI-4491 --- .../Notifications/GetNotificationSettings.ts | 1 - .../UpdateNotificationSettings.ts | 1 - src/gql/gen/graphql.ts | 42 +++---------------- src/i18n/en-US/notifications.ts | 18 +------- .../Notifications/Settings/index.test.tsx | 4 -- src/views/Notifications/Settings/index.tsx | 16 ++----- 6 files changed, 11 insertions(+), 71 deletions(-) diff --git a/src/gql/apolloGQL/Notifications/GetNotificationSettings.ts b/src/gql/apolloGQL/Notifications/GetNotificationSettings.ts index 17186ad920..f072b832e9 100644 --- a/src/gql/apolloGQL/Notifications/GetNotificationSettings.ts +++ b/src/gql/apolloGQL/Notifications/GetNotificationSettings.ts @@ -14,7 +14,6 @@ export default gql(/* GraphQL */ ` newModelPlan datesChanged datesChangedNotificationType - dataExchangeApproachCompleted } } } diff --git a/src/gql/apolloGQL/Notifications/UpdateNotificationSettings.ts b/src/gql/apolloGQL/Notifications/UpdateNotificationSettings.ts index a3b3772582..273a402e0b 100644 --- a/src/gql/apolloGQL/Notifications/UpdateNotificationSettings.ts +++ b/src/gql/apolloGQL/Notifications/UpdateNotificationSettings.ts @@ -15,7 +15,6 @@ export default gql(/* GraphQL */ ` newModelPlan datesChanged datesChangedNotificationType - dataExchangeApproachCompleted } } `); diff --git a/src/gql/gen/graphql.ts b/src/gql/gen/graphql.ts index d6b0264859..d53d8d6b0d 100644 --- a/src/gql/gen/graphql.ts +++ b/src/gql/gen/graphql.ts @@ -56,13 +56,12 @@ export type Activity = { }; /** ActivityMetaData is a type that represents all the data that can be captured in an Activity */ -export type ActivityMetaData = AddedAsCollaboratorMeta | DailyDigestCompleteActivityMeta | DataExchangeApproachCompletedActivityMeta | DatesChangedActivityMeta | ModelPlanSharedActivityMeta | NewDiscussionRepliedActivityMeta | NewModelPlanActivityMeta | TaggedInDiscussionReplyActivityMeta | TaggedInPlanDiscussionActivityMeta; +export type ActivityMetaData = AddedAsCollaboratorMeta | DailyDigestCompleteActivityMeta | DatesChangedActivityMeta | ModelPlanSharedActivityMeta | NewDiscussionRepliedActivityMeta | NewModelPlanActivityMeta | TaggedInDiscussionReplyActivityMeta | TaggedInPlanDiscussionActivityMeta; /** ActivityType represents the possible activities that happen in application that might result in a notification */ export enum ActivityType { ADDED_AS_COLLABORATOR = 'ADDED_AS_COLLABORATOR', DAILY_DIGEST_COMPLETE = 'DAILY_DIGEST_COMPLETE', - DATA_EXCHANGE_APPROACH_COMPLETED = 'DATA_EXCHANGE_APPROACH_COMPLETED', DATES_CHANGED = 'DATES_CHANGED', MODEL_PLAN_SHARED = 'MODEL_PLAN_SHARED', NEW_DISCUSSION_REPLY = 'NEW_DISCUSSION_REPLY', @@ -292,31 +291,6 @@ export type DailyDigestCompleteActivityMeta = { version: Scalars['Int']['output']; }; -export type DataExchangeApproach = { - __typename: 'DataExchangeApproach'; - createdBy: Scalars['UUID']['output']; - createdByUserAccount: UserAccount; - createdDts: Scalars['Time']['output']; - description?: Maybe; - id: Scalars['UUID']['output']; - isComplete: Scalars['Boolean']['output']; - modelPlan: ModelPlan; - modelPlanID: Scalars['UUID']['output']; - modifiedBy?: Maybe; - modifiedByUserAccount?: Maybe; - modifiedDts?: Maybe; - name: Scalars['String']['output']; -}; - -export type DataExchangeApproachCompletedActivityMeta = { - __typename: 'DataExchangeApproachCompletedActivityMeta'; - dataExchangeApproach: DataExchangeApproach; - markedCompleteBy: Scalars['UUID']['output']; - markedCompleteByUserAccount: UserAccount; - type: ActivityType; - version: Scalars['Int']['output']; -}; - export enum DataForMonitoringType { CLINICAL_DATA = 'CLINICAL_DATA', ENCOUNTER_DATA = 'ENCOUNTER_DATA', @@ -3026,7 +3000,6 @@ export type UserNotificationPreferences = { createdByUserAccount: UserAccount; createdDts: Scalars['Time']['output']; dailyDigestComplete: Array; - dataExchangeApproachCompleted: Array; datesChanged: Array; datesChangedNotificationType?: Maybe; id: Scalars['UUID']['output']; @@ -3045,7 +3018,6 @@ export type UserNotificationPreferences = { export type UserNotificationPreferencesChanges = { addedAsCollaborator?: InputMaybe>; dailyDigestComplete?: InputMaybe>; - dataExchangeApproachCompleted?: InputMaybe>; datesChanged?: InputMaybe>; datesChangedNotificationType?: InputMaybe; modelPlanShared?: InputMaybe>; @@ -3706,12 +3678,12 @@ export type UpdateNdaMutation = { __typename: 'Mutation', agreeToNDA: { __typena export type GetNotificationSettingsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetNotificationSettingsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notificationPreferences: { __typename: 'UserNotificationPreferences', id: UUID, dailyDigestComplete: Array, addedAsCollaborator: Array, taggedInDiscussion: Array, taggedInDiscussionReply: Array, newDiscussionReply: Array, modelPlanShared: Array, newModelPlan: Array, datesChanged: Array, datesChangedNotificationType?: DatesChangedNotificationType | null, dataExchangeApproachCompleted: Array } } }; +export type GetNotificationSettingsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notificationPreferences: { __typename: 'UserNotificationPreferences', id: UUID, dailyDigestComplete: Array, addedAsCollaborator: Array, taggedInDiscussion: Array, taggedInDiscussionReply: Array, newDiscussionReply: Array, modelPlanShared: Array, newModelPlan: Array, datesChanged: Array, datesChangedNotificationType?: DatesChangedNotificationType | null } } }; export type GetNotificationsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetNotificationsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notifications: { __typename: 'UserNotifications', numUnreadNotifications: number, notifications: Array<{ __typename: 'UserNotification', id: UUID, isRead: boolean, inAppSent: boolean, emailSent: boolean, createdDts: Time, activity: { __typename: 'Activity', activityType: ActivityType, entityID: UUID, actorID: UUID, actorUserAccount: { __typename: 'UserAccount', commonName: string }, metaData: { __typename: 'AddedAsCollaboratorMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'DailyDigestCompleteActivityMeta', version: number, type: ActivityType, modelPlanIDs: Array, date: Time, analyzedAudits: Array<{ __typename: 'AnalyzedAudit', id: UUID, modelPlanID: UUID, modelName: string, date: Time, changes: { __typename: 'AnalyzedAuditChange', modelPlan?: { __typename: 'AnalyzedModelPlan', oldName?: string | null, statusChanges?: Array | null } | null, documents?: { __typename: 'AnalyzedDocuments', count?: number | null } | null, crTdls?: { __typename: 'AnalyzedCrTdls', activity?: boolean | null } | null, planSections?: { __typename: 'AnalyzedPlanSections', updated: Array, readyForReview: Array, readyForClearance: Array } | null, modelLeads?: { __typename: 'AnalyzedModelLeads', added: Array<{ __typename: 'AnalyzedModelLeadInfo', id: UUID, commonName: string }> } | null, planDiscussions?: { __typename: 'AnalyzedPlanDiscussions', activity?: boolean | null } | null } }> } | { __typename: 'DataExchangeApproachCompletedActivityMeta' } | { __typename: 'DatesChangedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string }, dateChanges: Array<{ __typename: 'DateChange', isChanged: boolean, field: DateChangeFieldType, isRange: boolean, oldDate?: Time | null, newDate?: Time | null, oldRangeStart?: Time | null, oldRangeEnd?: Time | null, newRangeStart?: Time | null, newRangeEnd?: Time | null }> } | { __typename: 'ModelPlanSharedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, optionalMessage?: string | null, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewDiscussionRepliedActivityMeta', version: number, type: ActivityType, discussionID: UUID, replyID: UUID, modelPlanID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewModelPlanActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInDiscussionReplyActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, replyID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInPlanDiscussionActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } } }> } } }; +export type GetNotificationsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notifications: { __typename: 'UserNotifications', numUnreadNotifications: number, notifications: Array<{ __typename: 'UserNotification', id: UUID, isRead: boolean, inAppSent: boolean, emailSent: boolean, createdDts: Time, activity: { __typename: 'Activity', activityType: ActivityType, entityID: UUID, actorID: UUID, actorUserAccount: { __typename: 'UserAccount', commonName: string }, metaData: { __typename: 'AddedAsCollaboratorMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'DailyDigestCompleteActivityMeta', version: number, type: ActivityType, modelPlanIDs: Array, date: Time, analyzedAudits: Array<{ __typename: 'AnalyzedAudit', id: UUID, modelPlanID: UUID, modelName: string, date: Time, changes: { __typename: 'AnalyzedAuditChange', modelPlan?: { __typename: 'AnalyzedModelPlan', oldName?: string | null, statusChanges?: Array | null } | null, documents?: { __typename: 'AnalyzedDocuments', count?: number | null } | null, crTdls?: { __typename: 'AnalyzedCrTdls', activity?: boolean | null } | null, planSections?: { __typename: 'AnalyzedPlanSections', updated: Array, readyForReview: Array, readyForClearance: Array } | null, modelLeads?: { __typename: 'AnalyzedModelLeads', added: Array<{ __typename: 'AnalyzedModelLeadInfo', id: UUID, commonName: string }> } | null, planDiscussions?: { __typename: 'AnalyzedPlanDiscussions', activity?: boolean | null } | null } }> } | { __typename: 'DatesChangedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string }, dateChanges: Array<{ __typename: 'DateChange', isChanged: boolean, field: DateChangeFieldType, isRange: boolean, oldDate?: Time | null, newDate?: Time | null, oldRangeStart?: Time | null, oldRangeEnd?: Time | null, newRangeStart?: Time | null, newRangeEnd?: Time | null }> } | { __typename: 'ModelPlanSharedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, optionalMessage?: string | null, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewDiscussionRepliedActivityMeta', version: number, type: ActivityType, discussionID: UUID, replyID: UUID, modelPlanID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewModelPlanActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInDiscussionReplyActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, replyID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInPlanDiscussionActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } } }> } } }; export type GetPollNotificationsQueryVariables = Exact<{ [key: string]: never; }>; @@ -3728,7 +3700,7 @@ export type UpdateNotificationSettingsMutationVariables = Exact<{ }>; -export type UpdateNotificationSettingsMutation = { __typename: 'Mutation', updateUserNotificationPreferences: { __typename: 'UserNotificationPreferences', id: UUID, dailyDigestComplete: Array, addedAsCollaborator: Array, taggedInDiscussion: Array, taggedInDiscussionReply: Array, newDiscussionReply: Array, modelPlanShared: Array, newModelPlan: Array, datesChanged: Array, datesChangedNotificationType?: DatesChangedNotificationType | null, dataExchangeApproachCompleted: Array } }; +export type UpdateNotificationSettingsMutation = { __typename: 'Mutation', updateUserNotificationPreferences: { __typename: 'UserNotificationPreferences', id: UUID, dailyDigestComplete: Array, addedAsCollaborator: Array, taggedInDiscussion: Array, taggedInDiscussionReply: Array, newDiscussionReply: Array, modelPlanShared: Array, newModelPlan: Array, datesChanged: Array, datesChangedNotificationType?: DatesChangedNotificationType | null } }; export type MarkNotificationAsReadMutationVariables = Exact<{ notificationID: Scalars['UUID']['input']; @@ -8826,7 +8798,6 @@ export const GetNotificationSettingsDocument = gql` newModelPlan datesChanged datesChangedNotificationType - dataExchangeApproachCompleted } } } @@ -9123,7 +9094,6 @@ export const UpdateNotificationSettingsDocument = gql` newModelPlan datesChanged datesChangedNotificationType - dataExchangeApproachCompleted } } `; @@ -11737,11 +11707,11 @@ export const TypedGetUserInfoDocument = {"kind":"Document","definitions":[{"kind export const TypedSearchOktaUsersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SearchOktaUsers"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"searchTerm"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"searchOktaUsers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"searchTerm"},"value":{"kind":"Variable","name":{"kind":"Name","value":"searchTerm"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"email"}}]}}]}}]} as unknown as DocumentNode; export const TypedUpdateModelPlanDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateModelPlan"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"changes"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ModelPlanChanges"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateModelPlan"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"changes"},"value":{"kind":"Variable","name":{"kind":"Name","value":"changes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; export const TypedUpdateNdaDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNDA"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agreeToNDA"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agree"},"value":{"kind":"BooleanValue","value":true}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"agreed"}},{"kind":"Field","name":{"kind":"Name","value":"agreedDts"}}]}}]}}]} as unknown as DocumentNode; -export const TypedGetNotificationSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotificationSettings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notificationPreferences"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dailyDigestComplete"}},{"kind":"Field","name":{"kind":"Name","value":"addedAsCollaborator"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussion"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"newDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanShared"}},{"kind":"Field","name":{"kind":"Name","value":"newModelPlan"}},{"kind":"Field","name":{"kind":"Name","value":"datesChanged"}},{"kind":"Field","name":{"kind":"Name","value":"datesChangedNotificationType"}},{"kind":"Field","name":{"kind":"Name","value":"dataExchangeApproachCompleted"}}]}}]}}]}}]} as unknown as DocumentNode; +export const TypedGetNotificationSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotificationSettings"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notificationPreferences"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dailyDigestComplete"}},{"kind":"Field","name":{"kind":"Name","value":"addedAsCollaborator"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussion"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"newDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanShared"}},{"kind":"Field","name":{"kind":"Name","value":"newModelPlan"}},{"kind":"Field","name":{"kind":"Name","value":"datesChanged"}},{"kind":"Field","name":{"kind":"Name","value":"datesChangedNotificationType"}}]}}]}}]}}]} as unknown as DocumentNode; export const TypedGetNotificationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetNotifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"numUnreadNotifications"}},{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"inAppSent"}},{"kind":"Field","name":{"kind":"Name","value":"emailSent"}},{"kind":"Field","name":{"kind":"Name","value":"createdDts"}},{"kind":"Field","name":{"kind":"Name","value":"activity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityID"}},{"kind":"Field","name":{"kind":"Name","value":"actorID"}},{"kind":"Field","name":{"kind":"Name","value":"actorUserAccount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"commonName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"metaData"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NewDiscussionRepliedActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"discussionID"}},{"kind":"Field","name":{"kind":"Name","value":"replyID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"content"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DatesChangedActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"dateChanges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isChanged"}},{"kind":"Field","name":{"kind":"Name","value":"field"}},{"kind":"Field","name":{"kind":"Name","value":"isRange"}},{"kind":"Field","name":{"kind":"Name","value":"oldDate"}},{"kind":"Field","name":{"kind":"Name","value":"newDate"}},{"kind":"Field","name":{"kind":"Name","value":"oldRangeStart"}},{"kind":"Field","name":{"kind":"Name","value":"oldRangeEnd"}},{"kind":"Field","name":{"kind":"Name","value":"newRangeStart"}},{"kind":"Field","name":{"kind":"Name","value":"newRangeEnd"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TaggedInPlanDiscussionActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"discussionID"}},{"kind":"Field","name":{"kind":"Name","value":"content"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AddedAsCollaboratorMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"TaggedInDiscussionReplyActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"discussionID"}},{"kind":"Field","name":{"kind":"Name","value":"replyID"}},{"kind":"Field","name":{"kind":"Name","value":"content"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ModelPlanSharedActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"optionalMessage"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NewModelPlanActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelName"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DailyDigestCompleteActivityMeta"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanIDs"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"analyzedAudits"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"modelName"}},{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"changes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"oldName"}},{"kind":"Field","name":{"kind":"Name","value":"statusChanges"}}]}},{"kind":"Field","name":{"kind":"Name","value":"documents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"count"}}]}},{"kind":"Field","name":{"kind":"Name","value":"crTdls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activity"}}]}},{"kind":"Field","name":{"kind":"Name","value":"planSections"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updated"}},{"kind":"Field","name":{"kind":"Name","value":"readyForReview"}},{"kind":"Field","name":{"kind":"Name","value":"readyForClearance"}}]}},{"kind":"Field","name":{"kind":"Name","value":"modelLeads"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"added"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"commonName"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"planDiscussions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activity"}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; export const TypedGetPollNotificationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPollNotifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"notifications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"numUnreadNotifications"}}]}}]}}]}}]} as unknown as DocumentNode; export const TypedUpdateAllNotificationsAsReadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateAllNotificationsAsRead"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"markAllNotificationsAsRead"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; -export const TypedUpdateNotificationSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNotificationSettings"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"changes"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UserNotificationPreferencesChanges"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateUserNotificationPreferences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"changes"},"value":{"kind":"Variable","name":{"kind":"Name","value":"changes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dailyDigestComplete"}},{"kind":"Field","name":{"kind":"Name","value":"addedAsCollaborator"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussion"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"newDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanShared"}},{"kind":"Field","name":{"kind":"Name","value":"newModelPlan"}},{"kind":"Field","name":{"kind":"Name","value":"datesChanged"}},{"kind":"Field","name":{"kind":"Name","value":"datesChangedNotificationType"}},{"kind":"Field","name":{"kind":"Name","value":"dataExchangeApproachCompleted"}}]}}]}}]} as unknown as DocumentNode; +export const TypedUpdateNotificationSettingsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNotificationSettings"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"changes"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UserNotificationPreferencesChanges"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateUserNotificationPreferences"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"changes"},"value":{"kind":"Variable","name":{"kind":"Name","value":"changes"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dailyDigestComplete"}},{"kind":"Field","name":{"kind":"Name","value":"addedAsCollaborator"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussion"}},{"kind":"Field","name":{"kind":"Name","value":"taggedInDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"newDiscussionReply"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanShared"}},{"kind":"Field","name":{"kind":"Name","value":"newModelPlan"}},{"kind":"Field","name":{"kind":"Name","value":"datesChanged"}},{"kind":"Field","name":{"kind":"Name","value":"datesChangedNotificationType"}}]}}]}}]} as unknown as DocumentNode; export const TypedMarkNotificationAsReadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"MarkNotificationAsRead"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"notificationID"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"markNotificationAsRead"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"notificationID"},"value":{"kind":"Variable","name":{"kind":"Name","value":"notificationID"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}}]}}]}}]} as unknown as DocumentNode; export const TypedGetAllOpsEvalAndLearningDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAllOpsEvalAndLearning"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"opsEvalAndLearning"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"modelPlanID"}},{"kind":"Field","name":{"kind":"Name","value":"stakeholders"}},{"kind":"Field","name":{"kind":"Name","value":"stakeholdersOther"}},{"kind":"Field","name":{"kind":"Name","value":"stakeholdersNote"}},{"kind":"Field","name":{"kind":"Name","value":"helpdeskUse"}},{"kind":"Field","name":{"kind":"Name","value":"helpdeskUseNote"}},{"kind":"Field","name":{"kind":"Name","value":"contractorSupport"}},{"kind":"Field","name":{"kind":"Name","value":"contractorSupportOther"}},{"kind":"Field","name":{"kind":"Name","value":"contractorSupportHow"}},{"kind":"Field","name":{"kind":"Name","value":"contractorSupportNote"}},{"kind":"Field","name":{"kind":"Name","value":"iddocSupport"}},{"kind":"Field","name":{"kind":"Name","value":"iddocSupportNote"}},{"kind":"Field","name":{"kind":"Name","value":"technicalContactsIdentified"}},{"kind":"Field","name":{"kind":"Name","value":"technicalContactsIdentifiedDetail"}},{"kind":"Field","name":{"kind":"Name","value":"technicalContactsIdentifiedNote"}},{"kind":"Field","name":{"kind":"Name","value":"captureParticipantInfo"}},{"kind":"Field","name":{"kind":"Name","value":"captureParticipantInfoNote"}},{"kind":"Field","name":{"kind":"Name","value":"icdOwner"}},{"kind":"Field","name":{"kind":"Name","value":"draftIcdDueDate"}},{"kind":"Field","name":{"kind":"Name","value":"icdNote"}},{"kind":"Field","name":{"kind":"Name","value":"uatNeeds"}},{"kind":"Field","name":{"kind":"Name","value":"stcNeeds"}},{"kind":"Field","name":{"kind":"Name","value":"testingTimelines"}},{"kind":"Field","name":{"kind":"Name","value":"testingNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataMonitoringFileTypes"}},{"kind":"Field","name":{"kind":"Name","value":"dataMonitoringFileOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataResponseType"}},{"kind":"Field","name":{"kind":"Name","value":"dataResponseFileFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"dataFullTimeOrIncremental"}},{"kind":"Field","name":{"kind":"Name","value":"eftSetUp"}},{"kind":"Field","name":{"kind":"Name","value":"unsolicitedAdjustmentsIncluded"}},{"kind":"Field","name":{"kind":"Name","value":"dataFlowDiagramsNeeded"}},{"kind":"Field","name":{"kind":"Name","value":"produceBenefitEnhancementFiles"}},{"kind":"Field","name":{"kind":"Name","value":"fileNamingConventions"}},{"kind":"Field","name":{"kind":"Name","value":"dataMonitoringNote"}},{"kind":"Field","name":{"kind":"Name","value":"benchmarkForPerformance"}},{"kind":"Field","name":{"kind":"Name","value":"benchmarkForPerformanceNote"}},{"kind":"Field","name":{"kind":"Name","value":"computePerformanceScores"}},{"kind":"Field","name":{"kind":"Name","value":"computePerformanceScoresNote"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustPerformance"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustFeedback"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustPayments"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustOther"}},{"kind":"Field","name":{"kind":"Name","value":"riskAdjustNote"}},{"kind":"Field","name":{"kind":"Name","value":"appealPerformance"}},{"kind":"Field","name":{"kind":"Name","value":"appealFeedback"}},{"kind":"Field","name":{"kind":"Name","value":"appealPayments"}},{"kind":"Field","name":{"kind":"Name","value":"appealOther"}},{"kind":"Field","name":{"kind":"Name","value":"appealNote"}},{"kind":"Field","name":{"kind":"Name","value":"evaluationApproaches"}},{"kind":"Field","name":{"kind":"Name","value":"evaluationApproachOther"}},{"kind":"Field","name":{"kind":"Name","value":"evalutaionApproachNote"}},{"kind":"Field","name":{"kind":"Name","value":"ccmInvolvment"}},{"kind":"Field","name":{"kind":"Name","value":"ccmInvolvmentOther"}},{"kind":"Field","name":{"kind":"Name","value":"ccmInvolvmentNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataNeededForMonitoring"}},{"kind":"Field","name":{"kind":"Name","value":"dataNeededForMonitoringOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataNeededForMonitoringNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataToSendParticicipants"}},{"kind":"Field","name":{"kind":"Name","value":"dataToSendParticicipantsOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataToSendParticicipantsNote"}},{"kind":"Field","name":{"kind":"Name","value":"shareCclfData"}},{"kind":"Field","name":{"kind":"Name","value":"shareCclfDataNote"}},{"kind":"Field","name":{"kind":"Name","value":"sendFilesBetweenCcw"}},{"kind":"Field","name":{"kind":"Name","value":"sendFilesBetweenCcwNote"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToKnown"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToWhich"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToNote"}},{"kind":"Field","name":{"kind":"Name","value":"useCcwForFileDistribiutionToParticipants"}},{"kind":"Field","name":{"kind":"Name","value":"useCcwForFileDistribiutionToParticipantsNote"}},{"kind":"Field","name":{"kind":"Name","value":"developNewQualityMeasures"}},{"kind":"Field","name":{"kind":"Name","value":"developNewQualityMeasuresNote"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPayment"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPaymentOther"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPaymentNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingStarts"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingStartsOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingFrequencyContinually"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingFrequencyOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataSharingStartsNote"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionStarts"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionStartsOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionFrequencyContinually"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionFrequencyOther"}},{"kind":"Field","name":{"kind":"Name","value":"dataCollectionFrequencyNote"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingStarts"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingStartsOther"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingStartsNote"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingFrequencyContinually"}},{"kind":"Field","name":{"kind":"Name","value":"qualityReportingFrequencyOther"}},{"kind":"Field","name":{"kind":"Name","value":"modelLearningSystems"}},{"kind":"Field","name":{"kind":"Name","value":"modelLearningSystemsOther"}},{"kind":"Field","name":{"kind":"Name","value":"modelLearningSystemsNote"}},{"kind":"Field","name":{"kind":"Name","value":"anticipatedChallenges"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode; export const TypedGetCcwAndQualityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCCWAndQuality"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"modelPlan"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"modelName"}},{"kind":"Field","name":{"kind":"Name","value":"opsEvalAndLearning"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"ccmInvolvment"}},{"kind":"Field","name":{"kind":"Name","value":"dataNeededForMonitoring"}},{"kind":"Field","name":{"kind":"Name","value":"iddocSupport"}},{"kind":"Field","name":{"kind":"Name","value":"sendFilesBetweenCcw"}},{"kind":"Field","name":{"kind":"Name","value":"sendFilesBetweenCcwNote"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToKnown"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToWhich"}},{"kind":"Field","name":{"kind":"Name","value":"appToSendFilesToNote"}},{"kind":"Field","name":{"kind":"Name","value":"useCcwForFileDistribiutionToParticipants"}},{"kind":"Field","name":{"kind":"Name","value":"useCcwForFileDistribiutionToParticipantsNote"}},{"kind":"Field","name":{"kind":"Name","value":"developNewQualityMeasures"}},{"kind":"Field","name":{"kind":"Name","value":"developNewQualityMeasuresNote"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPayment"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPaymentOther"}},{"kind":"Field","name":{"kind":"Name","value":"qualityPerformanceImpactsPaymentNote"}}]}},{"kind":"Field","name":{"kind":"Name","value":"operationalNeeds"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"modifiedDts"}}]}}]}}]}}]} as unknown as DocumentNode; diff --git a/src/i18n/en-US/notifications.ts b/src/i18n/en-US/notifications.ts index 390573736c..c9ad1ee3b3 100644 --- a/src/i18n/en-US/notifications.ts +++ b/src/i18n/en-US/notifications.ts @@ -20,10 +20,6 @@ const notifications = { hide: 'Hide digest' } }, - DATA_EXCHANGE_APPROACH_COMPLETED: { - text: 'Data Exchange Approach completed for {{-modelName}}.', - cta: 'View Model Plan' - }, DATES_CHANGED: { text: 'Dates have been updated for {{-modelName}}.', cta: { @@ -99,12 +95,6 @@ const notifications = { PERFORMANCE_PERIOD: 'Performance period', WRAP_UP_ENDS: 'Model wrap-up end date' } - }, - dataExchangeApproachCompleted: { - heading: 'Data Exchange Approach completed for {{-modelName}}', - subheading: - 'The Data Exchange Approach has been completed for this model.', - cta: 'View this Model Plan' } }, settings: { @@ -132,9 +122,7 @@ const notifications = { newDiscussionReply: 'When someone replies to a discussion I started', modelPlanShared: 'When someone shares a Model Plan with me', newModelPlan: 'When a new Model Plan is created', - datesChanged: 'When model dates change', - dataExchangeApproachCompleted: - 'When the Data Exchange Approach is completed' + datesChanged: 'When model dates change' }, additionalConfigurations: { whichModel: 'Which models?', @@ -158,9 +146,7 @@ const notifications = { 'You are already unsubscribed from email notifications {{-notificationType}}.', activityType: { NEW_MODEL_PLAN: 'when a new Model Plan is created', - DATES_CHANGED: 'when model dates change', - DATA_EXCHANGE_APPROACH_COMPLETED: - 'when the Data Exchange Approach is completed' + DATES_CHANGED: 'when model dates change' } } } diff --git a/src/views/Notifications/Settings/index.test.tsx b/src/views/Notifications/Settings/index.test.tsx index 0bdb830c16..0ca7de62f0 100644 --- a/src/views/Notifications/Settings/index.test.tsx +++ b/src/views/Notifications/Settings/index.test.tsx @@ -46,10 +46,6 @@ const notificationsSettingsMock = [ UserNotificationPreferenceFlag.EMAIL, UserNotificationPreferenceFlag.IN_APP ], - dataExchangeApproachCompleted: [ - UserNotificationPreferenceFlag.EMAIL, - UserNotificationPreferenceFlag.IN_APP - ], newModelPlan: [], datesChanged: [], datesChangedNotificationType: null diff --git a/src/views/Notifications/Settings/index.tsx b/src/views/Notifications/Settings/index.tsx index b085b4ed53..33707e99c9 100644 --- a/src/views/Notifications/Settings/index.tsx +++ b/src/views/Notifications/Settings/index.tsx @@ -80,8 +80,7 @@ const NotificationSettings = () => { modelPlanShared, newModelPlan, datesChanged, - datesChangedNotificationType, - dataExchangeApproachCompleted + datesChangedNotificationType } = (data?.currentUser.notificationPreferences || {}) as GetNotifcationSettingsType; @@ -306,8 +305,7 @@ const NotificationSettings = () => { modelPlanShared: modelPlanShared ?? [], newModelPlan: newModelPlan ?? [], datesChanged: datesChanged ?? [], - datesChangedNotificationType: datesChangedNotificationType ?? undefined, - dataExchangeApproachCompleted: dataExchangeApproachCompleted ?? [] + datesChangedNotificationType: datesChangedNotificationType ?? undefined }; if ((!loading && error) || (!loading && !data?.currentUser)) { @@ -413,15 +411,7 @@ const NotificationSettings = () => {
)} - {setting === 'datesChanged' && ( - -

- {notificationsT( - 'settings.sections.additionalNotifications.heading' - )} -

-
- )} +

{notificationSettings[setting]} From 58a62c2e1b6a2148917fe9dc47edd0b7165a9412 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Fri, 5 Jul 2024 01:39:57 -0400 Subject: [PATCH 09/17] chore: reran gql gen --- src/gql/gen/graphql.ts | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/gql/gen/graphql.ts b/src/gql/gen/graphql.ts index d53d8d6b0d..cb4029f1b2 100644 --- a/src/gql/gen/graphql.ts +++ b/src/gql/gen/graphql.ts @@ -56,12 +56,13 @@ export type Activity = { }; /** ActivityMetaData is a type that represents all the data that can be captured in an Activity */ -export type ActivityMetaData = AddedAsCollaboratorMeta | DailyDigestCompleteActivityMeta | DatesChangedActivityMeta | ModelPlanSharedActivityMeta | NewDiscussionRepliedActivityMeta | NewModelPlanActivityMeta | TaggedInDiscussionReplyActivityMeta | TaggedInPlanDiscussionActivityMeta; +export type ActivityMetaData = AddedAsCollaboratorMeta | DailyDigestCompleteActivityMeta | DataExchangeApproachCompletedActivityMeta | DatesChangedActivityMeta | ModelPlanSharedActivityMeta | NewDiscussionRepliedActivityMeta | NewModelPlanActivityMeta | TaggedInDiscussionReplyActivityMeta | TaggedInPlanDiscussionActivityMeta; /** ActivityType represents the possible activities that happen in application that might result in a notification */ export enum ActivityType { ADDED_AS_COLLABORATOR = 'ADDED_AS_COLLABORATOR', DAILY_DIGEST_COMPLETE = 'DAILY_DIGEST_COMPLETE', + DATA_EXCHANGE_APPROACH_COMPLETED = 'DATA_EXCHANGE_APPROACH_COMPLETED', DATES_CHANGED = 'DATES_CHANGED', MODEL_PLAN_SHARED = 'MODEL_PLAN_SHARED', NEW_DISCUSSION_REPLY = 'NEW_DISCUSSION_REPLY', @@ -291,6 +292,31 @@ export type DailyDigestCompleteActivityMeta = { version: Scalars['Int']['output']; }; +export type DataExchangeApproach = { + __typename: 'DataExchangeApproach'; + createdBy: Scalars['UUID']['output']; + createdByUserAccount: UserAccount; + createdDts: Scalars['Time']['output']; + description?: Maybe; + id: Scalars['UUID']['output']; + isComplete: Scalars['Boolean']['output']; + modelPlan: ModelPlan; + modelPlanID: Scalars['UUID']['output']; + modifiedBy?: Maybe; + modifiedByUserAccount?: Maybe; + modifiedDts?: Maybe; + name: Scalars['String']['output']; +}; + +export type DataExchangeApproachCompletedActivityMeta = { + __typename: 'DataExchangeApproachCompletedActivityMeta'; + dataExchangeApproach: DataExchangeApproach; + markedCompleteBy: Scalars['UUID']['output']; + markedCompleteByUserAccount: UserAccount; + type: ActivityType; + version: Scalars['Int']['output']; +}; + export enum DataForMonitoringType { CLINICAL_DATA = 'CLINICAL_DATA', ENCOUNTER_DATA = 'ENCOUNTER_DATA', @@ -3000,6 +3026,7 @@ export type UserNotificationPreferences = { createdByUserAccount: UserAccount; createdDts: Scalars['Time']['output']; dailyDigestComplete: Array; + dataExchangeApproachCompleted: Array; datesChanged: Array; datesChangedNotificationType?: Maybe; id: Scalars['UUID']['output']; @@ -3018,6 +3045,7 @@ export type UserNotificationPreferences = { export type UserNotificationPreferencesChanges = { addedAsCollaborator?: InputMaybe>; dailyDigestComplete?: InputMaybe>; + dataExchangeApproachCompleted?: InputMaybe>; datesChanged?: InputMaybe>; datesChangedNotificationType?: InputMaybe; modelPlanShared?: InputMaybe>; @@ -3683,7 +3711,7 @@ export type GetNotificationSettingsQuery = { __typename: 'Query', currentUser: { export type GetNotificationsQueryVariables = Exact<{ [key: string]: never; }>; -export type GetNotificationsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notifications: { __typename: 'UserNotifications', numUnreadNotifications: number, notifications: Array<{ __typename: 'UserNotification', id: UUID, isRead: boolean, inAppSent: boolean, emailSent: boolean, createdDts: Time, activity: { __typename: 'Activity', activityType: ActivityType, entityID: UUID, actorID: UUID, actorUserAccount: { __typename: 'UserAccount', commonName: string }, metaData: { __typename: 'AddedAsCollaboratorMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'DailyDigestCompleteActivityMeta', version: number, type: ActivityType, modelPlanIDs: Array, date: Time, analyzedAudits: Array<{ __typename: 'AnalyzedAudit', id: UUID, modelPlanID: UUID, modelName: string, date: Time, changes: { __typename: 'AnalyzedAuditChange', modelPlan?: { __typename: 'AnalyzedModelPlan', oldName?: string | null, statusChanges?: Array | null } | null, documents?: { __typename: 'AnalyzedDocuments', count?: number | null } | null, crTdls?: { __typename: 'AnalyzedCrTdls', activity?: boolean | null } | null, planSections?: { __typename: 'AnalyzedPlanSections', updated: Array, readyForReview: Array, readyForClearance: Array } | null, modelLeads?: { __typename: 'AnalyzedModelLeads', added: Array<{ __typename: 'AnalyzedModelLeadInfo', id: UUID, commonName: string }> } | null, planDiscussions?: { __typename: 'AnalyzedPlanDiscussions', activity?: boolean | null } | null } }> } | { __typename: 'DatesChangedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string }, dateChanges: Array<{ __typename: 'DateChange', isChanged: boolean, field: DateChangeFieldType, isRange: boolean, oldDate?: Time | null, newDate?: Time | null, oldRangeStart?: Time | null, oldRangeEnd?: Time | null, newRangeStart?: Time | null, newRangeEnd?: Time | null }> } | { __typename: 'ModelPlanSharedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, optionalMessage?: string | null, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewDiscussionRepliedActivityMeta', version: number, type: ActivityType, discussionID: UUID, replyID: UUID, modelPlanID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewModelPlanActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInDiscussionReplyActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, replyID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInPlanDiscussionActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } } }> } } }; +export type GetNotificationsQuery = { __typename: 'Query', currentUser: { __typename: 'CurrentUser', notifications: { __typename: 'UserNotifications', numUnreadNotifications: number, notifications: Array<{ __typename: 'UserNotification', id: UUID, isRead: boolean, inAppSent: boolean, emailSent: boolean, createdDts: Time, activity: { __typename: 'Activity', activityType: ActivityType, entityID: UUID, actorID: UUID, actorUserAccount: { __typename: 'UserAccount', commonName: string }, metaData: { __typename: 'AddedAsCollaboratorMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'DailyDigestCompleteActivityMeta', version: number, type: ActivityType, modelPlanIDs: Array, date: Time, analyzedAudits: Array<{ __typename: 'AnalyzedAudit', id: UUID, modelPlanID: UUID, modelName: string, date: Time, changes: { __typename: 'AnalyzedAuditChange', modelPlan?: { __typename: 'AnalyzedModelPlan', oldName?: string | null, statusChanges?: Array | null } | null, documents?: { __typename: 'AnalyzedDocuments', count?: number | null } | null, crTdls?: { __typename: 'AnalyzedCrTdls', activity?: boolean | null } | null, planSections?: { __typename: 'AnalyzedPlanSections', updated: Array, readyForReview: Array, readyForClearance: Array } | null, modelLeads?: { __typename: 'AnalyzedModelLeads', added: Array<{ __typename: 'AnalyzedModelLeadInfo', id: UUID, commonName: string }> } | null, planDiscussions?: { __typename: 'AnalyzedPlanDiscussions', activity?: boolean | null } | null } }> } | { __typename: 'DataExchangeApproachCompletedActivityMeta' } | { __typename: 'DatesChangedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string }, dateChanges: Array<{ __typename: 'DateChange', isChanged: boolean, field: DateChangeFieldType, isRange: boolean, oldDate?: Time | null, newDate?: Time | null, oldRangeStart?: Time | null, oldRangeEnd?: Time | null, newRangeStart?: Time | null, newRangeEnd?: Time | null }> } | { __typename: 'ModelPlanSharedActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, optionalMessage?: string | null, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewDiscussionRepliedActivityMeta', version: number, type: ActivityType, discussionID: UUID, replyID: UUID, modelPlanID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'NewModelPlanActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInDiscussionReplyActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, replyID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } | { __typename: 'TaggedInPlanDiscussionActivityMeta', version: number, type: ActivityType, modelPlanID: UUID, discussionID: UUID, content: string, modelPlan: { __typename: 'ModelPlan', modelName: string } } } }> } } }; export type GetPollNotificationsQueryVariables = Exact<{ [key: string]: never; }>; From a86a8c95f223fc8859237ed13557911ae73ddb5c Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Fri, 5 Jul 2024 15:10:49 -0400 Subject: [PATCH 10/17] chore: email unit test for data exchange approach completed --- .../added_as_collaborator_email_test.go | 2 +- ..._exchange_approach_completed_email_test.go | 65 +++++++++++++++++++ pkg/graph/resolvers/plan_collaborator_test.go | 4 +- pkg/graph/resolvers/resolver_test.go | 2 +- .../resolvers/resolver_test_utilities.go | 2 +- 5 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 pkg/graph/resolvers/data_exchange_approach_completed_email_test.go diff --git a/pkg/graph/resolvers/added_as_collaborator_email_test.go b/pkg/graph/resolvers/added_as_collaborator_email_test.go index 5a8f5ec47a..aeef047f58 100644 --- a/pkg/graph/resolvers/added_as_collaborator_email_test.go +++ b/pkg/graph/resolvers/added_as_collaborator_email_test.go @@ -25,7 +25,7 @@ func (s *ResolverSuite) TestAddedAsCollaboratorEmail() { } expectedEmail := "CLAB.doe@local.fake" // This comes from the stub fetch user info function - testTemplate, expectedSubject, expectedBody := createAddedAsCollaboratorTemplateCacheHelper(planName, plan) + testTemplate, expectedSubject, expectedBody := createDummyTemplateCacheHelper(planName, plan) mockEmailTemplateService. EXPECT(). GetEmailTemplate(gomock.Eq(email.AddedAsCollaboratorTemplateName)). diff --git a/pkg/graph/resolvers/data_exchange_approach_completed_email_test.go b/pkg/graph/resolvers/data_exchange_approach_completed_email_test.go new file mode 100644 index 0000000000..89965b4640 --- /dev/null +++ b/pkg/graph/resolvers/data_exchange_approach_completed_email_test.go @@ -0,0 +1,65 @@ +package resolvers + +import ( + "github.com/golang/mock/gomock" + + "github.com/cmsgov/mint-app/pkg/email" + "github.com/cmsgov/mint-app/pkg/shared/oddmail" +) + +func (s *ResolverSuite) TestDataExchangeApproachCompletedEmail() { + mockController := gomock.NewController(s.T()) + mockEmailService := oddmail.NewMockEmailService(mockController) + mockEmailTemplateService := email.NewMockTemplateService(mockController) + + planName := "Plan For Milestones" + plan := s.createModelPlan(planName) + + addressBook := email.AddressBook{ + DefaultSender: "unit-test-execution@mint.cms.gov", + MINTTeamEmail: "mint.team@local.fake", + } + + testTemplate, expectedSubject, expectedBody := createDummyTemplateCacheHelper(planName, plan) + mockEmailTemplateService. + EXPECT(). + GetEmailTemplate(gomock.Eq(email.DataExchangeApproachCompletedTemplateName)). + Return(testTemplate, nil). + AnyTimes() + expectedEmail := addressBook.MINTTeamEmail + + mockEmailService. + EXPECT(). + Send( + gomock.Any(), + gomock.Eq([]string{expectedEmail}), + gomock.Any(), + gomock.Eq(expectedSubject), + gomock.Any(), + gomock.Eq(expectedBody), + ). + Times(1) + + emailServiceConfig := &oddmail.GoSimpleMailServiceConfig{ + ClientAddress: "http://localhost:3005", + } + + mockEmailService. + EXPECT(). + GetConfig(). + Return(emailServiceConfig). + AnyTimes() + + err := SendDataExchangeApproachCompletedEmailNotification( + mockEmailService, + mockEmailTemplateService, + addressBook, + plan, + expectedEmail, + "Test User", + false, + ) + s.NoError(err) + + mockController.Finish() +} diff --git a/pkg/graph/resolvers/plan_collaborator_test.go b/pkg/graph/resolvers/plan_collaborator_test.go index 8f8ce3fb39..f7547735f7 100644 --- a/pkg/graph/resolvers/plan_collaborator_test.go +++ b/pkg/graph/resolvers/plan_collaborator_test.go @@ -35,7 +35,7 @@ func (suite *ResolverSuite) TestCreatePlanCollaboratorWithoutNotification() { } expectedEmail := "CLAB.doe@local.fake" //comes from stubFetchUserInfo - testTemplate, expectedSubject, expectedBody := createAddedAsCollaboratorTemplateCacheHelper(planName, plan) + testTemplate, expectedSubject, expectedBody := createDummyTemplateCacheHelper(planName, plan) mockEmailTemplateService. EXPECT(). @@ -120,7 +120,7 @@ func (suite *ResolverSuite) TestCreatePlanCollaboratorWithNotification() { } expectedEmail := "CLAB.doe@local.fake" //comes from stubFetchUserInfo - testTemplate, expectedSubject, expectedBody := createAddedAsCollaboratorTemplateCacheHelper(planName, plan) + testTemplate, expectedSubject, expectedBody := createDummyTemplateCacheHelper(planName, plan) mockEmailTemplateService. EXPECT(). diff --git a/pkg/graph/resolvers/resolver_test.go b/pkg/graph/resolvers/resolver_test.go index 4749b14231..59d84e453c 100644 --- a/pkg/graph/resolvers/resolver_test.go +++ b/pkg/graph/resolvers/resolver_test.go @@ -136,7 +136,7 @@ func (suite *ResolverSuite) createPlanCollaborator(mp *models.ModelPlan, userNam Return(emailServiceConfig). AnyTimes() - testTemplate, expectedSubject, expectedBody := createAddedAsCollaboratorTemplateCacheHelper(mp.ModelName, mp) + testTemplate, expectedSubject, expectedBody := createDummyTemplateCacheHelper(mp.ModelName, mp) mockEmailTemplateService. EXPECT(). GetEmailTemplate(gomock.Eq(email.AddedAsCollaboratorTemplateName)). diff --git a/pkg/graph/resolvers/resolver_test_utilities.go b/pkg/graph/resolvers/resolver_test_utilities.go index 3b394d324c..ac3dff7499 100644 --- a/pkg/graph/resolvers/resolver_test_utilities.go +++ b/pkg/graph/resolvers/resolver_test_utilities.go @@ -129,7 +129,7 @@ func getTestPrincipal(store *storage.Store, userName string) *authentication.App } -func createAddedAsCollaboratorTemplateCacheHelper( +func createDummyTemplateCacheHelper( planName string, plan *models.ModelPlan) (*emailTemplates.EmailTemplate, string, string) { templateCache := emailTemplates.NewTemplateCache() From 2e814387b093ff9a8e11bbd8621b1b2d91d7a03a Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Wed, 10 Jul 2024 18:57:49 -0400 Subject: [PATCH 11/17] chore: removed unnecessary Scan and Value methods --- pkg/models/data_exchange_approach.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkg/models/data_exchange_approach.go b/pkg/models/data_exchange_approach.go index 68d22f3915..443394fce0 100644 --- a/pkg/models/data_exchange_approach.go +++ b/pkg/models/data_exchange_approach.go @@ -1,8 +1,6 @@ package models import ( - "database/sql/driver" - "github.com/google/uuid" ) @@ -24,13 +22,3 @@ func NewDataExchangeApproach(name string, createdBy uuid.UUID, modelPlanID uuid. IsComplete: false, } } - -// Value allows us to satisfy the valuer interface, so we can write to the database -func (d DataExchangeApproach) Value() (driver.Value, error) { - return GenericValue(d) -} - -// Scan implements the scanner interface, so we can translate the JSONb from the db to an object in GO -func (d *DataExchangeApproach) Scan(src interface{}) error { - return GenericScan(src, d) -} From 834c34dabd978cbf951c5fe36fe630fc3fc60b62 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Thu, 11 Jul 2024 00:17:17 -0400 Subject: [PATCH 12/17] chore: added unit test for activity data exchange complete notification --- .../data_exchange_approach_completed_test.go | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 pkg/notifications/data_exchange_approach_completed_test.go diff --git a/pkg/notifications/data_exchange_approach_completed_test.go b/pkg/notifications/data_exchange_approach_completed_test.go new file mode 100644 index 0000000000..e243e38a42 --- /dev/null +++ b/pkg/notifications/data_exchange_approach_completed_test.go @@ -0,0 +1,65 @@ +package notifications + +import ( + "context" + + "github.com/google/uuid" + + "github.com/cmsgov/mint-app/pkg/models" +) + +func (suite *NotificationsSuite) TestActivityDataExchangeApproachCompletedCreate() { + + // we are just choosing a valid UUID to set for the entityID + modelPlanID := uuid.New() + actorID := suite.testConfigs.Principal.Account().ID + + approachCreator, err := suite.testConfigs.GetTestPrincipal(suite.testConfigs.Store, "FAKE") + suite.NoError(err) + + approachMarkedCompleteBy, err := suite.testConfigs.GetTestPrincipal(suite.testConfigs.Store, "MINT") + suite.NoError(err) + + receiverIDs := []uuid.UUID{approachCreator.Account().ID} + + mockFunc := func(ctx context.Context, user_id uuid.UUID) (*models.UserNotificationPreferences, error) { + // Return mock data, all notifications enabled + return models.NewUserNotificationPreferences(user_id), nil + } + + approach := models.NewDataExchangeApproach( + "TestDataExchangeApproach", + actorID, + modelPlanID, + ) + + testActivity, err := ActivityDataExchangeApproachCompletedCreate( + suite.testConfigs.Context, + actorID, + suite.testConfigs.Store, + receiverIDs, + approach, + approachMarkedCompleteBy.Account().ID, + mockFunc, + ) + + suite.NoError(err) + suite.NotNil(testActivity) + suite.EqualValues(models.ActivityDataExchangeApproachCompleted, testActivity.ActivityType) + // Assert meta data is not deserialized here + suite.Nil(testActivity.MetaData) + //Assert meta data can be deserialized + suite.NotNil(testActivity.MetaDataRaw) + meta, err := parseRawActivityMetaData(testActivity.ActivityType, testActivity.MetaDataRaw) + suite.NoError(err) + suite.NotNil(meta) + + actorNots, err := UserNotificationCollectionGetByUser(suite.testConfigs.Context, suite.testConfigs.Store, suite.testConfigs.Principal) + suite.NoError(err) + suite.EqualValues(0, actorNots.NumUnreadNotifications()) + + creatorNots, err := UserNotificationCollectionGetByUser(suite.testConfigs.Context, suite.testConfigs.Store, approachCreator) + suite.NoError(err) + suite.EqualValues(1, creatorNots.NumUnreadNotifications()) + +} From e401f1d53de18a7a28002a0b8855c27b05ac0a74 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Thu, 11 Jul 2024 00:51:15 -0400 Subject: [PATCH 13/17] chore: implemented resolver for data exchange approach completed notification preferences --- pkg/graph/resolvers/user_notification_preferences.resolvers.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/graph/resolvers/user_notification_preferences.resolvers.go b/pkg/graph/resolvers/user_notification_preferences.resolvers.go index 7c95a542c0..22c49ebc97 100644 --- a/pkg/graph/resolvers/user_notification_preferences.resolvers.go +++ b/pkg/graph/resolvers/user_notification_preferences.resolvers.go @@ -6,7 +6,6 @@ package resolvers import ( "context" - "fmt" "github.com/cmsgov/mint-app/pkg/appcontext" "github.com/cmsgov/mint-app/pkg/graph/generated" @@ -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) { - panic(fmt.Errorf("not implemented: DataExchangeApproachCompleted - dataExchangeApproachCompleted")) + return obj.DataExchangeApproachCompleted, nil } // UserNotificationPreferences returns generated.UserNotificationPreferencesResolver implementation. From 52ceb84d07b47fc5b29f0827fd0592ab4a5864cc Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Thu, 11 Jul 2024 18:21:07 -0400 Subject: [PATCH 14/17] fix: updated various test definitions to match new user account preferences spec --- cmd/dbseed/main.go | 7 ++++++- .../data_exchange_approach_helper.go | 21 +++++++------------ pkg/models/user_notification_preferences.go | 17 ++++++++------- .../data_exchange_approach_completed.go | 13 ++++-------- .../data_exchange_approach_completed_test.go | 15 ++++++------- 5 files changed, 33 insertions(+), 40 deletions(-) diff --git a/cmd/dbseed/main.go b/cmd/dbseed/main.go index 47d92443ca..7355a1d27f 100644 --- a/cmd/dbseed/main.go +++ b/cmd/dbseed/main.go @@ -282,7 +282,12 @@ func (s *Seeder) SeedData() { s.Config.AddressBook, actorPrincipal.UserAccount.ID, s.Config.Store, - []uuid.UUID{planWithDocuments.CreatedBy}, + []*models.UserAccountAndNotificationPreferences{ + { + UserAccount: *testUser.UserAccount, + PreferenceFlags: models.DefaultUserNotificationPreferencesFlags(), + }, + }, planWithDocuments, dataExchangeApproach, testUser.UserAccount.ID, diff --git a/pkg/graph/resolvers/data_exchange_approach_helper.go b/pkg/graph/resolvers/data_exchange_approach_helper.go index c53e24f9c1..690c31cac6 100644 --- a/pkg/graph/resolvers/data_exchange_approach_helper.go +++ b/pkg/graph/resolvers/data_exchange_approach_helper.go @@ -12,7 +12,6 @@ import ( "github.com/cmsgov/mint-app/pkg/notifications" "github.com/cmsgov/mint-app/pkg/shared/oddmail" "github.com/cmsgov/mint-app/pkg/sqlutils" - "github.com/cmsgov/mint-app/pkg/storage/loaders" "github.com/cmsgov/mint-app/pkg/userhelpers" ) @@ -67,18 +66,13 @@ func SendDataExchangeApproachCompletedEmailNotifications( emailService oddmail.EmailService, templateService email.TemplateService, addressBook email.AddressBook, - receiverIDs []uuid.UUID, + receivers []*models.UserAccountAndNotificationPreferences, modelPlan *models.ModelPlan, markedCompletedByUserCommonName string, showFooter bool, ) error { - for _, userID := range receiverIDs { - user, err := userhelpers.UserAccountGetByIDLOADER(ctx, userID) - if err != nil { - return err - } - - err = SendDataExchangeApproachCompletedEmailNotification( + for _, user := range receivers { + err := SendDataExchangeApproachCompletedEmailNotification( emailService, templateService, addressBook, @@ -101,22 +95,23 @@ func SendDataExchangeApproachCompletedNotification( addressBook email.AddressBook, actorID uuid.UUID, np sqlutils.NamedPreparer, - receiverIDs []uuid.UUID, + receivers []*models.UserAccountAndNotificationPreferences, modelPlan *models.ModelPlan, approach *models.DataExchangeApproach, // TODO: We should probably remove this and reference it from modelPlan markedCompletedBy uuid.UUID, ) error { logger := appcontext.ZLogger(ctx) + emailPreferences, inAppPreferences := models.FilterNotificationPreferences(receivers) + // Create and send in-app notifications _, err := notifications.ActivityDataExchangeApproachCompletedCreate( ctx, actorID, np, - receiverIDs, + inAppPreferences, approach, markedCompletedBy, - loaders.UserNotificationPreferencesGetByUserID, ) if err != nil { logger.Error("failed to create and send in-app notifications", zap.Error(err)) @@ -150,7 +145,7 @@ func SendDataExchangeApproachCompletedNotification( emailService, templateService, addressBook, - receiverIDs, + emailPreferences, modelPlan, markedCompletedByUser.CommonName, true, diff --git a/pkg/models/user_notification_preferences.go b/pkg/models/user_notification_preferences.go index a4d77a7cc4..87aa2d0236 100644 --- a/pkg/models/user_notification_preferences.go +++ b/pkg/models/user_notification_preferences.go @@ -33,14 +33,15 @@ func NewUserNotificationPreferences(userID uuid.UUID) *UserNotificationPreferenc baseStruct: NewBaseStruct(userID), UserID: userID, - DailyDigestComplete: DefaultUserNotificationPreferencesFlags(), - AddedAsCollaborator: DefaultUserNotificationPreferencesFlags(), - TaggedInDiscussion: DefaultUserNotificationPreferencesFlags(), - TaggedInDiscussionReply: DefaultUserNotificationPreferencesFlags(), - NewDiscussionReply: DefaultUserNotificationPreferencesFlags(), - ModelPlanShared: DefaultUserNotificationPreferencesFlags(), - NewModelPlan: EmptyUserNotificationPreferencesFlags(), - DatesChanged: EmptyUserNotificationPreferencesFlags(), + DailyDigestComplete: DefaultUserNotificationPreferencesFlags(), + AddedAsCollaborator: DefaultUserNotificationPreferencesFlags(), + TaggedInDiscussion: DefaultUserNotificationPreferencesFlags(), + TaggedInDiscussionReply: DefaultUserNotificationPreferencesFlags(), + NewDiscussionReply: DefaultUserNotificationPreferencesFlags(), + ModelPlanShared: DefaultUserNotificationPreferencesFlags(), + NewModelPlan: EmptyUserNotificationPreferencesFlags(), + DatesChanged: EmptyUserNotificationPreferencesFlags(), + DataExchangeApproachCompleted: EmptyUserNotificationPreferencesFlags(), } } diff --git a/pkg/notifications/data_exchange_approach_completed.go b/pkg/notifications/data_exchange_approach_completed.go index 3edec3c21c..b64d3c5304 100644 --- a/pkg/notifications/data_exchange_approach_completed.go +++ b/pkg/notifications/data_exchange_approach_completed.go @@ -14,11 +14,11 @@ func ActivityDataExchangeApproachCompletedCreate( ctx context.Context, actorID uuid.UUID, np sqlutils.NamedPreparer, - receiverIDs []uuid.UUID, + receivers []*models.UserAccountAndNotificationPreferences, approach *models.DataExchangeApproach, markedCompletedBy uuid.UUID, - getPreferencesFunc GetUserNotificationPreferencesFunc, ) (*models.Activity, error) { + activity := models.NewDataExchangeApproachCompletedActivity( actorID, approach, @@ -30,13 +30,8 @@ func ActivityDataExchangeApproachCompletedCreate( return nil, actErr } - for _, receiverID := range receiverIDs { - preferences, err := getPreferencesFunc(ctx, receiverID) - if err != nil { - return nil, err - } - - _, err = userNotificationCreate(ctx, np, retActivity, receiverID, preferences.ModelPlanShared) + for _, receiver := range receivers { + _, err := userNotificationCreate(ctx, np, retActivity, receiver.ID, receiver.PreferenceFlags) if err != nil { return nil, err } diff --git a/pkg/notifications/data_exchange_approach_completed_test.go b/pkg/notifications/data_exchange_approach_completed_test.go index e243e38a42..0ce83d499c 100644 --- a/pkg/notifications/data_exchange_approach_completed_test.go +++ b/pkg/notifications/data_exchange_approach_completed_test.go @@ -1,8 +1,6 @@ package notifications import ( - "context" - "github.com/google/uuid" "github.com/cmsgov/mint-app/pkg/models" @@ -20,11 +18,11 @@ func (suite *NotificationsSuite) TestActivityDataExchangeApproachCompletedCreate approachMarkedCompleteBy, err := suite.testConfigs.GetTestPrincipal(suite.testConfigs.Store, "MINT") suite.NoError(err) - receiverIDs := []uuid.UUID{approachCreator.Account().ID} - - mockFunc := func(ctx context.Context, user_id uuid.UUID) (*models.UserNotificationPreferences, error) { - // Return mock data, all notifications enabled - return models.NewUserNotificationPreferences(user_id), nil + receivers := []*models.UserAccountAndNotificationPreferences{ + { + UserAccount: *approachCreator.UserAccount, + PreferenceFlags: models.DefaultUserNotificationPreferencesFlags(), + }, } approach := models.NewDataExchangeApproach( @@ -37,10 +35,9 @@ func (suite *NotificationsSuite) TestActivityDataExchangeApproachCompletedCreate suite.testConfigs.Context, actorID, suite.testConfigs.Store, - receiverIDs, + receivers, approach, approachMarkedCompleteBy.Account().ID, - mockFunc, ) suite.NoError(err) From 8a9d37cf64dbed39d360d3a23efebf216c0a6d31 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Fri, 12 Jul 2024 00:02:59 -0400 Subject: [PATCH 15/17] chore: removed outdated comment --- pkg/graph/resolvers/data_exchange_approach_helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/graph/resolvers/data_exchange_approach_helper.go b/pkg/graph/resolvers/data_exchange_approach_helper.go index 690c31cac6..18b86a03f5 100644 --- a/pkg/graph/resolvers/data_exchange_approach_helper.go +++ b/pkg/graph/resolvers/data_exchange_approach_helper.go @@ -97,7 +97,7 @@ func SendDataExchangeApproachCompletedNotification( np sqlutils.NamedPreparer, receivers []*models.UserAccountAndNotificationPreferences, modelPlan *models.ModelPlan, - approach *models.DataExchangeApproach, // TODO: We should probably remove this and reference it from modelPlan + approach *models.DataExchangeApproach, markedCompletedBy uuid.UUID, ) error { logger := appcontext.ZLogger(ctx) From 2e429001b59a672ae0c7b38a1bab1a2550eb7b26 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Fri, 12 Jul 2024 00:30:21 -0400 Subject: [PATCH 16/17] chore: updated postman collection renaming markedCompletedBy -> markedCompleteBy --- MINT.postman_collection.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MINT.postman_collection.json b/MINT.postman_collection.json index 3363445e55..e02fa2694a 100644 --- a/MINT.postman_collection.json +++ b/MINT.postman_collection.json @@ -2154,7 +2154,7 @@ "body": { "mode": "graphql", "graphql": { - "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 modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n replyID\n content\n }\n ... on ModelPlanSharedActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n optionalMessage\n }\n ... on NewDiscussionRepliedActivityMeta {\n version\n type\n discussionID\n replyID\n content\n } \n ... on DailyDigestCompleteActivityMeta{\n version\n type\n modelPlanIDs\n date\n analyzedAudits{\n id\n modelPlanID\n modelName\n date\n changes{\n modelPlan{\n oldName\n statusChanges\n }\n documents{\n count\n }\n crTdls{\n activity\n }\n planSections{\n updated\n readyForReview\n readyForClearance\n }\n modelLeads{\n added{\n id\n commonName\n # userAccount{\n # id\n # email\n # }\n }\n }\n planDiscussions{\n activity\n }\n }\n\n }\n\n }\n ... on NewModelPlanActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n }\n ... on DatesChangedActivityMeta {\n version\n type\n modelPlanID\n modelPlan {\n id\n }\n dateChanges {\n isChanged\n field\n isRange\n oldDate\n newDate\n oldRangeStart\n oldRangeEnd\n newRangeStart\n newRangeEnd\n }\n }\n ... on DataExchangeApproachCompletedActivityMeta {\n version\n type\n dataExchangeApproach {\n id\n name\n }\n markedCompletedBy\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 modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n replyID\n content\n }\n ... on ModelPlanSharedActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n optionalMessage\n }\n ... on NewDiscussionRepliedActivityMeta {\n version\n type\n discussionID\n replyID\n content\n } \n ... on DailyDigestCompleteActivityMeta{\n version\n type\n modelPlanIDs\n date\n analyzedAudits{\n id\n modelPlanID\n modelName\n date\n changes{\n modelPlan{\n oldName\n statusChanges\n }\n documents{\n count\n }\n crTdls{\n activity\n }\n planSections{\n updated\n readyForReview\n readyForClearance\n }\n modelLeads{\n added{\n id\n commonName\n # userAccount{\n # id\n # email\n # }\n }\n }\n planDiscussions{\n activity\n }\n }\n\n }\n\n }\n ... on NewModelPlanActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n }\n ... on DatesChangedActivityMeta {\n version\n type\n modelPlanID\n modelPlan {\n id\n }\n dateChanges {\n isChanged\n field\n isRange\n oldDate\n newDate\n oldRangeStart\n oldRangeEnd\n newRangeStart\n newRangeEnd\n }\n }\n ... on DataExchangeApproachCompletedActivityMeta {\n version\n type\n dataExchangeApproach {\n id\n name\n }\n markedCompleteBy\n } \n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n", "variables": "" } }, @@ -2194,7 +2194,7 @@ "body": { "mode": "graphql", "graphql": { - "query": "query currentUser {\n currentUser {\n notificationPreferences {\n dailyDigestComplete\n\n addedAsCollaborator\n\n taggedInDiscussion\n\n taggedInDiscussionReply\n\n newDiscussionReply\n\n modelPlanShared\n\n newModelPlan\n\n datesChanged\n datesChangedNotificationType\n }\n }\n }\n\n", + "query": "query currentUser {\n currentUser {\n notificationPreferences {\n dailyDigestComplete\n\n addedAsCollaborator\n\n taggedInDiscussion\n\n taggedInDiscussionReply\n\n newDiscussionReply\n\n modelPlanShared\n\n newModelPlan\n\n datesChanged\n datesChangedNotificationType\n\n dataExchangeApproachCompleted\n }\n }\n }\n\n", "variables": "" } }, From cff7c48b2d5c6c9c42fd0ae4bb37adf4aacc9694 Mon Sep 17 00:00:00 2001 From: Tom Brooks Date: Tue, 16 Jul 2024 05:38:02 -0400 Subject: [PATCH 17/17] chore: converted data exchange approach complete meta to id --- pkg/graph/generated/generated.go | 1540 ++++------------- pkg/graph/resolvers/activity.resolvers.go | 11 - .../data_exchange_approach_helper.go | 2 +- pkg/graph/schema/types/activity.graphql | 18 +- ...change_approach_completed_activity_meta.go | 12 +- .../data_exchange_approach_completed.go | 4 +- .../data_exchange_approach_completed_test.go | 2 +- src/gql/gen/graphql.ts | 18 +- 8 files changed, 307 insertions(+), 1300 deletions(-) diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go index 5b1cd245af..66596e4a2e 100644 --- a/pkg/graph/generated/generated.go +++ b/pkg/graph/generated/generated.go @@ -47,7 +47,6 @@ type ResolverRoot interface { AuditChange() AuditChangeResolver CurrentUser() CurrentUserResolver DailyDigestCompleteActivityMeta() DailyDigestCompleteActivityMetaResolver - DataExchangeApproach() DataExchangeApproachResolver DataExchangeApproachCompletedActivityMeta() DataExchangeApproachCompletedActivityMetaResolver DatesChangedActivityMeta() DatesChangedActivityMetaResolver DiscussionReply() DiscussionReplyResolver @@ -197,23 +196,8 @@ type ComplexityRoot struct { Version func(childComplexity int) int } - DataExchangeApproach struct { - CreatedBy func(childComplexity int) int - CreatedByUserAccount func(childComplexity int) int - CreatedDts func(childComplexity int) int - Description func(childComplexity int) int - ID func(childComplexity int) int - IsComplete func(childComplexity int) int - ModelPlan func(childComplexity int) int - ModelPlanID func(childComplexity int) int - ModifiedBy func(childComplexity int) int - ModifiedByUserAccount func(childComplexity int) int - ModifiedDts func(childComplexity int) int - Name func(childComplexity int) int - } - DataExchangeApproachCompletedActivityMeta struct { - DataExchangeApproach func(childComplexity int) int + DataExchangeApproachID func(childComplexity int) int MarkedCompleteBy func(childComplexity int) int MarkedCompleteByUserAccount func(childComplexity int) int Type func(childComplexity int) int @@ -1304,9 +1288,6 @@ type CurrentUserResolver interface { type DailyDigestCompleteActivityMetaResolver interface { AnalyzedAudits(ctx context.Context, obj *models.DailyDigestCompleteActivityMeta) ([]*models.AnalyzedAudit, error) } -type DataExchangeApproachResolver interface { - ModelPlan(ctx context.Context, obj *models.DataExchangeApproach) (*models.ModelPlan, error) -} type DataExchangeApproachCompletedActivityMetaResolver interface { MarkedCompleteByUserAccount(ctx context.Context, obj *models.DataExchangeApproachCompletedActivityMeta) (*authentication.UserAccount, error) } @@ -2099,96 +2080,12 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.DailyDigestCompleteActivityMeta.Version(childComplexity), true - case "DataExchangeApproach.createdBy": - if e.complexity.DataExchangeApproach.CreatedBy == nil { - break - } - - return e.complexity.DataExchangeApproach.CreatedBy(childComplexity), true - - case "DataExchangeApproach.createdByUserAccount": - if e.complexity.DataExchangeApproach.CreatedByUserAccount == nil { - break - } - - return e.complexity.DataExchangeApproach.CreatedByUserAccount(childComplexity), true - - case "DataExchangeApproach.createdDts": - if e.complexity.DataExchangeApproach.CreatedDts == nil { - break - } - - return e.complexity.DataExchangeApproach.CreatedDts(childComplexity), true - - case "DataExchangeApproach.description": - if e.complexity.DataExchangeApproach.Description == nil { - break - } - - return e.complexity.DataExchangeApproach.Description(childComplexity), true - - case "DataExchangeApproach.id": - if e.complexity.DataExchangeApproach.ID == nil { - break - } - - return e.complexity.DataExchangeApproach.ID(childComplexity), true - - case "DataExchangeApproach.isComplete": - if e.complexity.DataExchangeApproach.IsComplete == nil { - break - } - - return e.complexity.DataExchangeApproach.IsComplete(childComplexity), true - - case "DataExchangeApproach.modelPlan": - if e.complexity.DataExchangeApproach.ModelPlan == nil { + case "DataExchangeApproachCompletedActivityMeta.dataExchangeApproachID": + if e.complexity.DataExchangeApproachCompletedActivityMeta.DataExchangeApproachID == nil { break } - return e.complexity.DataExchangeApproach.ModelPlan(childComplexity), true - - case "DataExchangeApproach.modelPlanID": - if e.complexity.DataExchangeApproach.ModelPlanID == nil { - break - } - - return e.complexity.DataExchangeApproach.ModelPlanID(childComplexity), true - - case "DataExchangeApproach.modifiedBy": - if e.complexity.DataExchangeApproach.ModifiedBy == nil { - break - } - - return e.complexity.DataExchangeApproach.ModifiedBy(childComplexity), true - - case "DataExchangeApproach.modifiedByUserAccount": - if e.complexity.DataExchangeApproach.ModifiedByUserAccount == nil { - break - } - - return e.complexity.DataExchangeApproach.ModifiedByUserAccount(childComplexity), true - - case "DataExchangeApproach.modifiedDts": - if e.complexity.DataExchangeApproach.ModifiedDts == nil { - break - } - - return e.complexity.DataExchangeApproach.ModifiedDts(childComplexity), true - - case "DataExchangeApproach.name": - if e.complexity.DataExchangeApproach.Name == nil { - break - } - - return e.complexity.DataExchangeApproach.Name(childComplexity), true - - case "DataExchangeApproachCompletedActivityMeta.dataExchangeApproach": - if e.complexity.DataExchangeApproachCompletedActivityMeta.DataExchangeApproach == nil { - break - } - - return e.complexity.DataExchangeApproachCompletedActivityMeta.DataExchangeApproach(childComplexity), true + return e.complexity.DataExchangeApproachCompletedActivityMeta.DataExchangeApproachID(childComplexity), true case "DataExchangeApproachCompletedActivityMeta.markedCompleteBy": if e.complexity.DataExchangeApproachCompletedActivityMeta.MarkedCompleteBy == nil { @@ -9192,26 +9089,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! markedCompleteBy: UUID! markedCompleteByUserAccount: UserAccount! } @@ -16824,52 +16705,8 @@ func (ec *executionContext) fieldContext_DailyDigestCompleteActivityMeta_date(ct return fc, nil } -func (ec *executionContext) _DataExchangeApproach_id(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(uuid.UUID) - fc.Result = res - return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproach_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UUID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproach_name(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_name(ctx, field) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_version(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_version(ctx, field) if err != nil { return graphql.Null } @@ -16882,7 +16719,7 @@ func (ec *executionContext) _DataExchangeApproach_name(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Version, nil }) if err != nil { ec.Error(ctx, err) @@ -16894,67 +16731,26 @@ func (ec *executionContext) _DataExchangeApproach_name(ctx context.Context, fiel } return graphql.Null } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproach_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproach_description(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) + res := resTmp.(int) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNInt2int(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DataExchangeApproach_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + return nil, errors.New("field of type Int does not have child fields") }, } return fc, nil } -func (ec *executionContext) _DataExchangeApproach_isComplete(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_isComplete(ctx, field) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_type(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_type(ctx, field) if err != nil { return graphql.Null } @@ -16967,7 +16763,7 @@ func (ec *executionContext) _DataExchangeApproach_isComplete(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsComplete, nil + return obj.Type, nil }) if err != nil { ec.Error(ctx, err) @@ -16979,26 +16775,26 @@ func (ec *executionContext) _DataExchangeApproach_isComplete(ctx context.Context } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(models.ActivityType) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNActivityType2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐActivityType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DataExchangeApproach_isComplete(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") + return nil, errors.New("field of type ActivityType does not have child fields") }, } return fc, nil } -func (ec *executionContext) _DataExchangeApproach_modelPlanID(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_modelPlanID(ctx, field) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_dataExchangeApproachID(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_dataExchangeApproachID(ctx, field) if err != nil { return graphql.Null } @@ -17011,7 +16807,7 @@ func (ec *executionContext) _DataExchangeApproach_modelPlanID(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ModelPlanID, nil + return obj.DataExchangeApproachID, nil }) if err != nil { ec.Error(ctx, err) @@ -17028,9 +16824,9 @@ func (ec *executionContext) _DataExchangeApproach_modelPlanID(ctx context.Contex return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DataExchangeApproach_modelPlanID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_dataExchangeApproachID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, IsMethod: false, IsResolver: false, @@ -17041,112 +16837,8 @@ func (ec *executionContext) fieldContext_DataExchangeApproach_modelPlanID(ctx co return fc, nil } -func (ec *executionContext) _DataExchangeApproach_modelPlan(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_modelPlan(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.DataExchangeApproach().ModelPlan(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*models.ModelPlan) - fc.Result = res - return ec.marshalNModelPlan2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐModelPlan(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproach_modelPlan(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_ModelPlan_id(ctx, field) - case "modelName": - return ec.fieldContext_ModelPlan_modelName(ctx, field) - case "abbreviation": - return ec.fieldContext_ModelPlan_abbreviation(ctx, field) - case "archived": - return ec.fieldContext_ModelPlan_archived(ctx, field) - case "createdBy": - return ec.fieldContext_ModelPlan_createdBy(ctx, field) - case "createdByUserAccount": - return ec.fieldContext_ModelPlan_createdByUserAccount(ctx, field) - case "createdDts": - return ec.fieldContext_ModelPlan_createdDts(ctx, field) - case "modifiedBy": - return ec.fieldContext_ModelPlan_modifiedBy(ctx, field) - case "modifiedByUserAccount": - return ec.fieldContext_ModelPlan_modifiedByUserAccount(ctx, field) - case "modifiedDts": - return ec.fieldContext_ModelPlan_modifiedDts(ctx, field) - case "basics": - return ec.fieldContext_ModelPlan_basics(ctx, field) - case "generalCharacteristics": - return ec.fieldContext_ModelPlan_generalCharacteristics(ctx, field) - case "participantsAndProviders": - return ec.fieldContext_ModelPlan_participantsAndProviders(ctx, field) - case "beneficiaries": - return ec.fieldContext_ModelPlan_beneficiaries(ctx, field) - case "opsEvalAndLearning": - return ec.fieldContext_ModelPlan_opsEvalAndLearning(ctx, field) - case "collaborators": - return ec.fieldContext_ModelPlan_collaborators(ctx, field) - case "documents": - return ec.fieldContext_ModelPlan_documents(ctx, field) - case "discussions": - return ec.fieldContext_ModelPlan_discussions(ctx, field) - case "payments": - return ec.fieldContext_ModelPlan_payments(ctx, field) - case "status": - return ec.fieldContext_ModelPlan_status(ctx, field) - case "isFavorite": - return ec.fieldContext_ModelPlan_isFavorite(ctx, field) - case "isCollaborator": - return ec.fieldContext_ModelPlan_isCollaborator(ctx, field) - case "crs": - return ec.fieldContext_ModelPlan_crs(ctx, field) - case "tdls": - return ec.fieldContext_ModelPlan_tdls(ctx, field) - case "prepareForClearance": - return ec.fieldContext_ModelPlan_prepareForClearance(ctx, field) - case "nameHistory": - return ec.fieldContext_ModelPlan_nameHistory(ctx, field) - case "operationalNeeds": - return ec.fieldContext_ModelPlan_operationalNeeds(ctx, field) - case "opSolutionLastModifiedDts": - return ec.fieldContext_ModelPlan_opSolutionLastModifiedDts(ctx, field) - case "statusPlannedActiveOrEnded": - return ec.fieldContext_ModelPlan_statusPlannedActiveOrEnded(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type ModelPlan", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproach_createdBy(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_createdBy(ctx, field) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx, field) if err != nil { return graphql.Null } @@ -17159,7 +16851,7 @@ func (ec *executionContext) _DataExchangeApproach_createdBy(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedBy, nil + return obj.MarkedCompleteBy, nil }) if err != nil { ec.Error(ctx, err) @@ -17176,9 +16868,9 @@ func (ec *executionContext) _DataExchangeApproach_createdBy(ctx context.Context, return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DataExchangeApproach_createdBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, IsMethod: false, IsResolver: false, @@ -17189,8 +16881,8 @@ func (ec *executionContext) fieldContext_DataExchangeApproach_createdBy(ctx cont return fc, nil } -func (ec *executionContext) _DataExchangeApproach_createdByUserAccount(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_createdByUserAccount(ctx, field) +func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx, field) if err != nil { return graphql.Null } @@ -17203,7 +16895,7 @@ func (ec *executionContext) _DataExchangeApproach_createdByUserAccount(ctx conte }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.CreatedByUserAccount(ctx), nil + return ec.resolvers.DataExchangeApproachCompletedActivityMeta().MarkedCompleteByUserAccount(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -17220,469 +16912,12 @@ func (ec *executionContext) _DataExchangeApproach_createdByUserAccount(ctx conte return ec.marshalNUserAccount2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋauthenticationᚐUserAccount(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_DataExchangeApproach_createdByUserAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", + Object: "DataExchangeApproachCompletedActivityMeta", Field: field, IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_UserAccount_id(ctx, field) - case "username": - return ec.fieldContext_UserAccount_username(ctx, field) - case "isEUAID": - return ec.fieldContext_UserAccount_isEUAID(ctx, field) - case "commonName": - return ec.fieldContext_UserAccount_commonName(ctx, field) - case "locale": - return ec.fieldContext_UserAccount_locale(ctx, field) - case "email": - return ec.fieldContext_UserAccount_email(ctx, field) - case "givenName": - return ec.fieldContext_UserAccount_givenName(ctx, field) - case "familyName": - return ec.fieldContext_UserAccount_familyName(ctx, field) - case "zoneInfo": - return ec.fieldContext_UserAccount_zoneInfo(ctx, field) - case "hasLoggedIn": - return ec.fieldContext_UserAccount_hasLoggedIn(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserAccount", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproach_createdDts(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_createdDts(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreatedDts, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(time.Time) - fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproach_createdDts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproach_modifiedBy(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_modifiedBy(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ModifiedBy, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*uuid.UUID) - fc.Result = res - return ec.marshalOUUID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproach_modifiedBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UUID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproach_modifiedByUserAccount(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_modifiedByUserAccount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ModifiedByUserAccount(ctx), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*authentication.UserAccount) - fc.Result = res - return ec.marshalOUserAccount2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋauthenticationᚐUserAccount(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproach_modifiedByUserAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_UserAccount_id(ctx, field) - case "username": - return ec.fieldContext_UserAccount_username(ctx, field) - case "isEUAID": - return ec.fieldContext_UserAccount_isEUAID(ctx, field) - case "commonName": - return ec.fieldContext_UserAccount_commonName(ctx, field) - case "locale": - return ec.fieldContext_UserAccount_locale(ctx, field) - case "email": - return ec.fieldContext_UserAccount_email(ctx, field) - case "givenName": - return ec.fieldContext_UserAccount_givenName(ctx, field) - case "familyName": - return ec.fieldContext_UserAccount_familyName(ctx, field) - case "zoneInfo": - return ec.fieldContext_UserAccount_zoneInfo(ctx, field) - case "hasLoggedIn": - return ec.fieldContext_UserAccount_hasLoggedIn(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type UserAccount", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproach_modifiedDts(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproach) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproach_modifiedDts(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ModifiedDts, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*time.Time) - fc.Result = res - return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproach_modifiedDts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproach", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Time does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_version(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_version(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Version, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproachCompletedActivityMeta", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_type(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(models.ActivityType) - fc.Result = res - return ec.marshalNActivityType2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐActivityType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproachCompletedActivityMeta", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ActivityType does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DataExchangeApproach, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*models.DataExchangeApproach) - fc.Result = res - return ec.marshalNDataExchangeApproach2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐDataExchangeApproach(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproachCompletedActivityMeta", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_DataExchangeApproach_id(ctx, field) - case "name": - return ec.fieldContext_DataExchangeApproach_name(ctx, field) - case "description": - return ec.fieldContext_DataExchangeApproach_description(ctx, field) - case "isComplete": - return ec.fieldContext_DataExchangeApproach_isComplete(ctx, field) - case "modelPlanID": - return ec.fieldContext_DataExchangeApproach_modelPlanID(ctx, field) - case "modelPlan": - return ec.fieldContext_DataExchangeApproach_modelPlan(ctx, field) - case "createdBy": - return ec.fieldContext_DataExchangeApproach_createdBy(ctx, field) - case "createdByUserAccount": - return ec.fieldContext_DataExchangeApproach_createdByUserAccount(ctx, field) - case "createdDts": - return ec.fieldContext_DataExchangeApproach_createdDts(ctx, field) - case "modifiedBy": - return ec.fieldContext_DataExchangeApproach_modifiedBy(ctx, field) - case "modifiedByUserAccount": - return ec.fieldContext_DataExchangeApproach_modifiedByUserAccount(ctx, field) - case "modifiedDts": - return ec.fieldContext_DataExchangeApproach_modifiedDts(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type DataExchangeApproach", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MarkedCompleteBy, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(uuid.UUID) - fc.Result = res - return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteBy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproachCompletedActivityMeta", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type UUID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx context.Context, field graphql.CollectedField, obj *models.DataExchangeApproachCompletedActivityMeta) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.DataExchangeApproachCompletedActivityMeta().MarkedCompleteByUserAccount(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*authentication.UserAccount) - fc.Result = res - return ec.marshalNUserAccount2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋauthenticationᚐUserAccount(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_DataExchangeApproachCompletedActivityMeta_markedCompleteByUserAccount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "DataExchangeApproachCompletedActivityMeta", - Field: field, - IsMethod: true, - IsResolver: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": @@ -68703,442 +67938,40 @@ func (ec *executionContext) _AnalyzedPlanSections(ctx context.Context, sel ast.S return out } -var auditChangeImplementors = []string{"AuditChange"} - -func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionSet, obj *models.AuditChange) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, auditChangeImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("AuditChange") - case "id": - out.Values[i] = ec._AuditChange_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "primaryKey": - out.Values[i] = ec._AuditChange_primaryKey(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "foreignKey": - out.Values[i] = ec._AuditChange_foreignKey(ctx, field, obj) - case "tableName": - out.Values[i] = ec._AuditChange_tableName(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "action": - out.Values[i] = ec._AuditChange_action(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "fields": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._AuditChange_fields(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "modifiedBy": - out.Values[i] = ec._AuditChange_modifiedBy(ctx, field, obj) - case "modifiedByUserAccount": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._AuditChange_modifiedByUserAccount(ctx, field, obj) - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "modifiedDts": - out.Values[i] = ec._AuditChange_modifiedDts(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var currentUserImplementors = []string{"CurrentUser"} - -func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionSet, obj *models.CurrentUser) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, currentUserImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CurrentUser") - case "launchDarkly": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._CurrentUser_launchDarkly(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "account": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._CurrentUser_account(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "notifications": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._CurrentUser_notifications(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "notificationPreferences": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._CurrentUser_notificationPreferences(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var dailyDigestCompleteActivityMetaImplementors = []string{"DailyDigestCompleteActivityMeta", "ActivityMetaData"} - -func (ec *executionContext) _DailyDigestCompleteActivityMeta(ctx context.Context, sel ast.SelectionSet, obj *models.DailyDigestCompleteActivityMeta) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, dailyDigestCompleteActivityMetaImplementors) - - out := graphql.NewFieldSet(fields) - deferred := make(map[string]*graphql.FieldSet) - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("DailyDigestCompleteActivityMeta") - case "version": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_version(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "type": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "modelPlanIDs": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_modelPlanIDs(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "analyzedAudits": - field := field - - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._DailyDigestCompleteActivityMeta_analyzedAudits(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - if field.Deferrable != nil { - dfs, ok := deferred[field.Deferrable.Label] - di := 0 - if ok { - dfs.AddField(field) - di = len(dfs.Values) - 1 - } else { - dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) - deferred[field.Deferrable.Label] = dfs - } - dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { - return innerFunc(ctx, dfs) - }) - - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "userID": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_userID(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - case "date": - out.Values[i] = ec._DailyDigestCompleteActivityMeta_date(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch(ctx) - if out.Invalids > 0 { - return graphql.Null - } - - atomic.AddInt32(&ec.deferred, int32(len(deferred))) - - for label, dfs := range deferred { - ec.processDeferredGroup(graphql.DeferredGroup{ - Label: label, - Path: graphql.GetPath(ctx), - FieldSet: dfs, - Context: ctx, - }) - } - - return out -} - -var dataExchangeApproachImplementors = []string{"DataExchangeApproach"} +var auditChangeImplementors = []string{"AuditChange"} -func (ec *executionContext) _DataExchangeApproach(ctx context.Context, sel ast.SelectionSet, obj *models.DataExchangeApproach) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, dataExchangeApproachImplementors) +func (ec *executionContext) _AuditChange(ctx context.Context, sel ast.SelectionSet, obj *models.AuditChange) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, auditChangeImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("DataExchangeApproach") + out.Values[i] = graphql.MarshalString("AuditChange") case "id": - out.Values[i] = ec._DataExchangeApproach_id(ctx, field, obj) + out.Values[i] = ec._AuditChange_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "name": - out.Values[i] = ec._DataExchangeApproach_name(ctx, field, obj) + case "primaryKey": + out.Values[i] = ec._AuditChange_primaryKey(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "description": - out.Values[i] = ec._DataExchangeApproach_description(ctx, field, obj) - case "isComplete": - out.Values[i] = ec._DataExchangeApproach_isComplete(ctx, field, obj) + case "foreignKey": + out.Values[i] = ec._AuditChange_foreignKey(ctx, field, obj) + case "tableName": + out.Values[i] = ec._AuditChange_tableName(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "modelPlanID": - out.Values[i] = ec._DataExchangeApproach_modelPlanID(ctx, field, obj) + case "action": + out.Values[i] = ec._AuditChange_action(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "modelPlan": + case "fields": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -69147,7 +67980,7 @@ func (ec *executionContext) _DataExchangeApproach(ctx context.Context, sel ast.S ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._DataExchangeApproach_modelPlan(ctx, field, obj) + res = ec._AuditChange_fields(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -69174,12 +68007,78 @@ func (ec *executionContext) _DataExchangeApproach(ctx context.Context, sel ast.S } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "createdBy": - out.Values[i] = ec._DataExchangeApproach_createdBy(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) + case "modifiedBy": + out.Values[i] = ec._AuditChange_modifiedBy(ctx, field, obj) + case "modifiedByUserAccount": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._AuditChange_modifiedByUserAccount(ctx, field, obj) + return res } - case "createdByUserAccount": + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "modifiedDts": + out.Values[i] = ec._AuditChange_modifiedDts(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var currentUserImplementors = []string{"CurrentUser"} + +func (ec *executionContext) _CurrentUser(ctx context.Context, sel ast.SelectionSet, obj *models.CurrentUser) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, currentUserImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CurrentUser") + case "launchDarkly": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -69188,7 +68087,7 @@ func (ec *executionContext) _DataExchangeApproach(ctx context.Context, sel ast.S ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._DataExchangeApproach_createdByUserAccount(ctx, field, obj) + res = ec._CurrentUser_launchDarkly(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -69215,14 +68114,164 @@ func (ec *executionContext) _DataExchangeApproach(ctx context.Context, sel ast.S } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "createdDts": - out.Values[i] = ec._DataExchangeApproach_createdDts(ctx, field, obj) + case "account": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CurrentUser_account(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "notifications": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CurrentUser_notifications(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "notificationPreferences": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._CurrentUser_notificationPreferences(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var dailyDigestCompleteActivityMetaImplementors = []string{"DailyDigestCompleteActivityMeta", "ActivityMetaData"} + +func (ec *executionContext) _DailyDigestCompleteActivityMeta(ctx context.Context, sel ast.SelectionSet, obj *models.DailyDigestCompleteActivityMeta) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dailyDigestCompleteActivityMetaImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DailyDigestCompleteActivityMeta") + case "version": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_version(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "modifiedBy": - out.Values[i] = ec._DataExchangeApproach_modifiedBy(ctx, field, obj) - case "modifiedByUserAccount": + case "type": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "modelPlanIDs": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_modelPlanIDs(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "analyzedAudits": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -69231,7 +68280,10 @@ func (ec *executionContext) _DataExchangeApproach(ctx context.Context, sel ast.S ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._DataExchangeApproach_modifiedByUserAccount(ctx, field, obj) + res = ec._DailyDigestCompleteActivityMeta_analyzedAudits(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } return res } @@ -69255,8 +68307,16 @@ func (ec *executionContext) _DataExchangeApproach(ctx context.Context, sel ast.S } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "modifiedDts": - out.Values[i] = ec._DataExchangeApproach_modifiedDts(ctx, field, obj) + case "userID": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_userID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "date": + out.Values[i] = ec._DailyDigestCompleteActivityMeta_date(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -69301,8 +68361,8 @@ func (ec *executionContext) _DataExchangeApproachCompletedActivityMeta(ctx conte if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "dataExchangeApproach": - out.Values[i] = ec._DataExchangeApproachCompletedActivityMeta_dataExchangeApproach(ctx, field, obj) + case "dataExchangeApproachID": + out.Values[i] = ec._DataExchangeApproachCompletedActivityMeta_dataExchangeApproachID(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -81818,16 +80878,6 @@ func (ec *executionContext) marshalNCurrentUser2ᚖgithubᚗcomᚋcmsgovᚋmint return ec._CurrentUser(ctx, sel, v) } -func (ec *executionContext) marshalNDataExchangeApproach2ᚖgithubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋmodelsᚐDataExchangeApproach(ctx context.Context, sel ast.SelectionSet, v *models.DataExchangeApproach) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._DataExchangeApproach(ctx, sel, v) -} - func (ec *executionContext) unmarshalNDataForMonitoringType2githubᚗcomᚋcmsgovᚋmintᚑappᚋpkgᚋgraphᚋmodelᚐDataForMonitoringType(ctx context.Context, v interface{}) (model.DataForMonitoringType, error) { var res model.DataForMonitoringType err := res.UnmarshalGQL(v) diff --git a/pkg/graph/resolvers/activity.resolvers.go b/pkg/graph/resolvers/activity.resolvers.go index 36938d147b..317a5d278e 100644 --- a/pkg/graph/resolvers/activity.resolvers.go +++ b/pkg/graph/resolvers/activity.resolvers.go @@ -34,11 +34,6 @@ func (r *dailyDigestCompleteActivityMetaResolver) AnalyzedAudits(ctx context.Con return loaders.AnalyzedAuditGetByModelPlanIDsAndDate(ctx, obj.ModelPlanIDs, obj.Date) } -// ModelPlan is the resolver for the modelPlan field. -func (r *dataExchangeApproachResolver) ModelPlan(ctx context.Context, obj *models.DataExchangeApproach) (*models.ModelPlan, error) { - return ModelPlanGetByIDLOADER(ctx, obj.ModelPlanID) -} - // MarkedCompleteByUserAccount is the resolver for the markedCompleteByUserAccount field. func (r *dataExchangeApproachCompletedActivityMetaResolver) MarkedCompleteByUserAccount(ctx context.Context, obj *models.DataExchangeApproachCompletedActivityMeta) (*authentication.UserAccount, error) { return UserAccountGetByIDLOADER(ctx, obj.MarkedCompleteBy) @@ -117,11 +112,6 @@ func (r *Resolver) DailyDigestCompleteActivityMeta() generated.DailyDigestComple return &dailyDigestCompleteActivityMetaResolver{r} } -// DataExchangeApproach returns generated.DataExchangeApproachResolver implementation. -func (r *Resolver) DataExchangeApproach() generated.DataExchangeApproachResolver { - return &dataExchangeApproachResolver{r} -} - // DataExchangeApproachCompletedActivityMeta returns generated.DataExchangeApproachCompletedActivityMetaResolver implementation. func (r *Resolver) DataExchangeApproachCompletedActivityMeta() generated.DataExchangeApproachCompletedActivityMetaResolver { return &dataExchangeApproachCompletedActivityMetaResolver{r} @@ -160,7 +150,6 @@ func (r *Resolver) TaggedInPlanDiscussionActivityMeta() generated.TaggedInPlanDi type activityResolver struct{ *Resolver } type addedAsCollaboratorMetaResolver struct{ *Resolver } type dailyDigestCompleteActivityMetaResolver struct{ *Resolver } -type dataExchangeApproachResolver struct{ *Resolver } type dataExchangeApproachCompletedActivityMetaResolver struct{ *Resolver } type datesChangedActivityMetaResolver struct{ *Resolver } type modelPlanSharedActivityMetaResolver struct{ *Resolver } diff --git a/pkg/graph/resolvers/data_exchange_approach_helper.go b/pkg/graph/resolvers/data_exchange_approach_helper.go index 18b86a03f5..9311f6021b 100644 --- a/pkg/graph/resolvers/data_exchange_approach_helper.go +++ b/pkg/graph/resolvers/data_exchange_approach_helper.go @@ -110,7 +110,7 @@ func SendDataExchangeApproachCompletedNotification( actorID, np, inAppPreferences, - approach, + approach.ID, markedCompletedBy, ) if err != nil { diff --git a/pkg/graph/schema/types/activity.graphql b/pkg/graph/schema/types/activity.graphql index ca40d05e15..e9ace5cbf6 100644 --- a/pkg/graph/schema/types/activity.graphql +++ b/pkg/graph/schema/types/activity.graphql @@ -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! markedCompleteBy: UUID! markedCompleteByUserAccount: UserAccount! } diff --git a/pkg/models/data_exchange_approach_completed_activity_meta.go b/pkg/models/data_exchange_approach_completed_activity_meta.go index 9147ed0a1c..d2aafc609b 100644 --- a/pkg/models/data_exchange_approach_completed_activity_meta.go +++ b/pkg/models/data_exchange_approach_completed_activity_meta.go @@ -10,19 +10,19 @@ 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"` } // 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, } } @@ -30,7 +30,7 @@ func newDataExchangeApproachCompletedActivityMeta( // 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{ @@ -39,7 +39,7 @@ func NewDataExchangeApproachCompletedActivity( EntityID: markedCompleteBy, ActivityType: ActivityDataExchangeApproachCompleted, MetaData: newDataExchangeApproachCompletedActivityMeta( - dataExchangeApproach, + dataExchangeApproachID, markedCompleteBy, ), } diff --git a/pkg/notifications/data_exchange_approach_completed.go b/pkg/notifications/data_exchange_approach_completed.go index b64d3c5304..d888a185c0 100644 --- a/pkg/notifications/data_exchange_approach_completed.go +++ b/pkg/notifications/data_exchange_approach_completed.go @@ -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, ) diff --git a/pkg/notifications/data_exchange_approach_completed_test.go b/pkg/notifications/data_exchange_approach_completed_test.go index 0ce83d499c..4455ebafa5 100644 --- a/pkg/notifications/data_exchange_approach_completed_test.go +++ b/pkg/notifications/data_exchange_approach_completed_test.go @@ -36,7 +36,7 @@ func (suite *NotificationsSuite) TestActivityDataExchangeApproachCompletedCreate actorID, suite.testConfigs.Store, receivers, - approach, + approach.ID, approachMarkedCompleteBy.Account().ID, ) diff --git a/src/gql/gen/graphql.ts b/src/gql/gen/graphql.ts index cb4029f1b2..e9b77df399 100644 --- a/src/gql/gen/graphql.ts +++ b/src/gql/gen/graphql.ts @@ -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; - id: Scalars['UUID']['output']; - isComplete: Scalars['Boolean']['output']; - modelPlan: ModelPlan; - modelPlanID: Scalars['UUID']['output']; - modifiedBy?: Maybe; - modifiedByUserAccount?: Maybe; - modifiedDts?: Maybe; - name: Scalars['String']['output']; -}; - export type DataExchangeApproachCompletedActivityMeta = { __typename: 'DataExchangeApproachCompletedActivityMeta'; - dataExchangeApproach: DataExchangeApproach; + dataExchangeApproachID: Scalars['UUID']['output']; markedCompleteBy: Scalars['UUID']['output']; markedCompleteByUserAccount: UserAccount; type: ActivityType;