From 69e653aa1bcf3925ac310ef178487b83c6a975fc Mon Sep 17 00:00:00 2001 From: adamodd Date: Wed, 18 Dec 2024 11:34:11 -0800 Subject: [PATCH 1/6] Init feature branch From a71ca4ad060e6bcd56bac519968e1cce214e4c81 Mon Sep 17 00:00:00 2001 From: Lee Warrick <32332479+mynar7@users.noreply.github.com> Date: Wed, 15 Jan 2025 13:55:57 -0500 Subject: [PATCH 2/6] [EASI-4527] add presentation links schema (#2951) * add presentation links schema * move column declarations * add presentation links model and stub URL/status resolvers, remove bucket name * add mutation/query to postman --- EASI.postman_collection.json | 66 + ...V199__Add_async_GRB_presentation_links.sql | 46 + pkg/graph/generated/generated.go | 1972 ++++++++++++++--- pkg/graph/schema.graphql | 38 + pkg/graph/schema.resolvers.go | 58 + pkg/models/models_gen.go | 10 + pkg/models/system_intake_document.go | 4 +- .../system_intake_grb_presentation_links.go | 23 + pkg/storage/truncate.go | 1 + scripts/dev | 1 + src/gql/gen/graphql.ts | 38 + 11 files changed, 1931 insertions(+), 326 deletions(-) create mode 100644 migrations/V199__Add_async_GRB_presentation_links.sql create mode 100644 pkg/models/system_intake_grb_presentation_links.go diff --git a/EASI.postman_collection.json b/EASI.postman_collection.json index b97add9839..6fb92e1f68 100644 --- a/EASI.postman_collection.json +++ b/EASI.postman_collection.json @@ -1289,6 +1289,72 @@ } }, "response": [] + }, + { + "name": "Get GRB Presentation Links", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "graphql", + "graphql": { + "query": "query getSystemIntakeGRBReviewers($systemIntakeID: UUID!) {\n systemIntake(id: $systemIntakeID) {\n id\n grbPresentationLinks {\n systemIntakeID\n createdAt\n createdBy\n modifiedAt\n modifiedBy\n recordingLink\n recordingPasscode\n transcriptFileName\n transcriptFileStatus\n transcriptFileURL\n presentationDeckFileName\n presentationDeckFileStatus\n presentationDeckFileURL\n }\n }\n}", + "variables": "{\r\n \"systemIntakeID\": \"5af245bc-fc54-4677-bab1-1b3e798bb43c\"\r\n}" + } + }, + "url": { + "raw": "{{url}}", + "host": [ + "{{url}}" + ] + } + }, + "response": [] + }, + { + "name": "Set GRB Presentation Links", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "graphql", + "graphql": { + "query": "mutation setSystemIntakeGRBPresentationLinks(\n $input: SystemIntakeGRBPresentationLinksInput!\n) {\n setSystemIntakeGRBPresentationLinks(input: $input) {\n systemIntakeID\n createdAt\n createdBy\n modifiedAt\n modifiedBy\n recordingLink\n recordingPasscode\n transcriptFileName\n transcriptFileStatus\n transcriptFileURL\n presentationDeckFileName\n presentationDeckFileStatus\n presentationDeckFileURL\n }\n}", + "variables": "{\r\n \"input\": {\r\n \"systemIntakeID\": \"8edb237e-ad48-49b2-91cf-8534362bc6cf\",\r\n \"recordingLink\": \"https://google.com\",\r\n \"recordingPasscode\": \"123456\"\r\n }\r\n}" + } + }, + "url": { + "raw": "{{url}}", + "host": [ + "{{url}}" + ] + } + }, + "response": [] } ] }, diff --git a/migrations/V199__Add_async_GRB_presentation_links.sql b/migrations/V199__Add_async_GRB_presentation_links.sql new file mode 100644 index 0000000000..07abb3fbb8 --- /dev/null +++ b/migrations/V199__Add_async_GRB_presentation_links.sql @@ -0,0 +1,46 @@ +CREATE TABLE IF NOT EXISTS system_intake_grb_presentation_links ( + id UUID PRIMARY KEY NOT NULL, + created_by UUID NOT NULL REFERENCES user_account(id), + created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, + modified_by UUID REFERENCES user_account(id), + modified_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, + system_intake_id UUID NOT NULL UNIQUE REFERENCES system_intakes(id), + recording_link TEXT, + recording_passcode TEXT, + transcript_link TEXT, + transcript_s3_key TEXT, + transcript_file_name TEXT, + presentation_deck_s3_key TEXT, + presentation_deck_file_name TEXT, + CONSTRAINT transcript_link_or_doc_null_check CHECK ( + ( + transcript_link IS NULL AND + transcript_s3_key IS NULL AND + transcript_file_name IS NULL + ) OR + ( + transcript_link IS NOT NULL AND + transcript_s3_key IS NULL AND + transcript_file_name IS NULL + ) OR + ( + transcript_link IS NULL AND + transcript_s3_key IS NOT NULL AND + transcript_file_name IS NOT NULL + ) + ), + CONSTRAINT presentation_deck_null_check CHECK ( + ( + presentation_deck_s3_key IS NULL AND + presentation_deck_file_name IS NULL + ) OR + ( + presentation_deck_s3_key IS NOT NULL AND + presentation_deck_file_name IS NOT NULL + ) + ) +); + +COMMENT ON CONSTRAINT transcript_link_or_doc_null_check ON system_intake_grb_presentation_links IS 'Ensures either a transcript link OR document is inserted and that the file name and s3 key are present if transcript is a document'; + +COMMENT ON CONSTRAINT presentation_deck_null_check ON system_intake_grb_presentation_links IS 'Ensures presentation deck file name and s3 key are both present or both null'; diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go index fff2156074..63a234302c 100644 --- a/pkg/graph/generated/generated.go +++ b/pkg/graph/generated/generated.go @@ -54,6 +54,7 @@ type ResolverRoot interface { Query() QueryResolver SystemIntake() SystemIntakeResolver SystemIntakeDocument() SystemIntakeDocumentResolver + SystemIntakeGRBPresentationLinks() SystemIntakeGRBPresentationLinksResolver SystemIntakeGRBReviewer() SystemIntakeGRBReviewerResolver SystemIntakeNote() SystemIntakeNoteResolver TRBAdminNote() TRBAdminNoteResolver @@ -595,6 +596,7 @@ type ComplexityRoot struct { SendReportAProblemEmail func(childComplexity int, input models.SendReportAProblemEmailInput) int SendTRBGuidanceLetter func(childComplexity int, input models.SendTRBGuidanceLetterInput) int SetRolesForUserOnSystem func(childComplexity int, input models.SetRolesForUserOnSystemInput) int + SetSystemIntakeGRBPresentationLinks func(childComplexity int, input models.SystemIntakeGRBPresentationLinksInput) int SetSystemIntakeRelationExistingService func(childComplexity int, input *models.SetSystemIntakeRelationExistingServiceInput) int SetSystemIntakeRelationExistingSystem func(childComplexity int, input *models.SetSystemIntakeRelationExistingSystemInput) int SetSystemIntakeRelationNewSystem func(childComplexity int, input *models.SetSystemIntakeRelationNewSystemInput) int @@ -699,6 +701,7 @@ type ComplexityRoot struct { GovernanceRequestFeedbacks func(childComplexity int) int GovernanceTeams func(childComplexity int) int GrbDiscussions func(childComplexity int) int + GrbPresentationLinks func(childComplexity int) int GrbReviewers func(childComplexity int) int GrtReviewEmailBody func(childComplexity int) int HasUIChanges func(childComplexity int) int @@ -842,6 +845,23 @@ type ComplexityRoot struct { Source func(childComplexity int) int } + SystemIntakeGRBPresentationLinks struct { + CreatedAt func(childComplexity int) int + CreatedBy func(childComplexity int) int + ModifiedAt func(childComplexity int) int + ModifiedBy func(childComplexity int) int + PresentationDeckFileName func(childComplexity int) int + PresentationDeckFileStatus func(childComplexity int) int + PresentationDeckFileURL func(childComplexity int) int + RecordingLink func(childComplexity int) int + RecordingPasscode func(childComplexity int) int + SystemIntakeID func(childComplexity int) int + TranscriptFileName func(childComplexity int) int + TranscriptFileStatus func(childComplexity int) int + TranscriptFileURL func(childComplexity int) int + TranscriptLink func(childComplexity int) int + } + SystemIntakeGRBReviewDiscussion struct { InitialPost func(childComplexity int) int Replies func(childComplexity int) int @@ -1236,6 +1256,7 @@ type MutationResolver interface { CreateSystemIntakeGRBDiscussionPost(ctx context.Context, input models.CreateSystemIntakeGRBDiscussionPostInput) (*models.SystemIntakeGRBReviewDiscussionPost, error) CreateSystemIntakeGRBDiscussionReply(ctx context.Context, input models.CreateSystemIntakeGRBDiscussionReplyInput) (*models.SystemIntakeGRBReviewDiscussionPost, error) UpdateSystemIntakeLinkedCedarSystem(ctx context.Context, input models.UpdateSystemIntakeLinkedCedarSystemInput) (*models.UpdateSystemIntakePayload, error) + SetSystemIntakeGRBPresentationLinks(ctx context.Context, input models.SystemIntakeGRBPresentationLinksInput) (*models.SystemIntakeGRBPresentationLinks, error) ArchiveSystemIntake(ctx context.Context, id uuid.UUID) (*models.SystemIntake, error) SendFeedbackEmail(ctx context.Context, input models.SendFeedbackEmailInput) (*string, error) SendCantFindSomethingEmail(ctx context.Context, input models.SendCantFindSomethingEmailInput) (*string, error) @@ -1368,6 +1389,7 @@ type SystemIntakeResolver interface { RelatedIntakes(ctx context.Context, obj *models.SystemIntake) ([]*models.SystemIntake, error) RelatedTRBRequests(ctx context.Context, obj *models.SystemIntake) ([]*models.TRBRequest, error) GrbDiscussions(ctx context.Context, obj *models.SystemIntake) ([]*models.SystemIntakeGRBReviewDiscussion, error) + GrbPresentationLinks(ctx context.Context, obj *models.SystemIntake) (*models.SystemIntakeGRBPresentationLinks, error) } type SystemIntakeDocumentResolver interface { DocumentType(ctx context.Context, obj *models.SystemIntakeDocument) (*models.SystemIntakeDocumentType, error) @@ -1379,6 +1401,13 @@ type SystemIntakeDocumentResolver interface { CanDelete(ctx context.Context, obj *models.SystemIntakeDocument) (bool, error) CanView(ctx context.Context, obj *models.SystemIntakeDocument) (bool, error) } +type SystemIntakeGRBPresentationLinksResolver interface { + TranscriptFileURL(ctx context.Context, obj *models.SystemIntakeGRBPresentationLinks) (*string, error) + TranscriptFileStatus(ctx context.Context, obj *models.SystemIntakeGRBPresentationLinks) (*models.SystemIntakeDocumentStatus, error) + + PresentationDeckFileURL(ctx context.Context, obj *models.SystemIntakeGRBPresentationLinks) (*string, error) + PresentationDeckFileStatus(ctx context.Context, obj *models.SystemIntakeGRBPresentationLinks) (*models.SystemIntakeDocumentStatus, error) +} type SystemIntakeGRBReviewerResolver interface { VotingRole(ctx context.Context, obj *models.SystemIntakeGRBReviewer) (models.SystemIntakeGRBReviewerVotingRole, error) GrbRole(ctx context.Context, obj *models.SystemIntakeGRBReviewer) (models.SystemIntakeGRBReviewerRole, error) @@ -4531,6 +4560,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.SetRolesForUserOnSystem(childComplexity, args["input"].(models.SetRolesForUserOnSystemInput)), true + case "Mutation.setSystemIntakeGRBPresentationLinks": + if e.complexity.Mutation.SetSystemIntakeGRBPresentationLinks == nil { + break + } + + args, err := ec.field_Mutation_setSystemIntakeGRBPresentationLinks_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.SetSystemIntakeGRBPresentationLinks(childComplexity, args["input"].(models.SystemIntakeGRBPresentationLinksInput)), true + case "Mutation.setSystemIntakeRelationExistingService": if e.complexity.Mutation.SetSystemIntakeRelationExistingService == nil { break @@ -5482,6 +5523,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.SystemIntake.GrbDiscussions(childComplexity), true + case "SystemIntake.grbPresentationLinks": + if e.complexity.SystemIntake.GrbPresentationLinks == nil { + break + } + + return e.complexity.SystemIntake.GrbPresentationLinks(childComplexity), true + case "SystemIntake.grbReviewers": if e.complexity.SystemIntake.GrbReviewers == nil { break @@ -6196,6 +6244,104 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.SystemIntakeFundingSource.Source(childComplexity), true + case "SystemIntakeGRBPresentationLinks.createdAt": + if e.complexity.SystemIntakeGRBPresentationLinks.CreatedAt == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.CreatedAt(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.createdBy": + if e.complexity.SystemIntakeGRBPresentationLinks.CreatedBy == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.CreatedBy(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.modifiedAt": + if e.complexity.SystemIntakeGRBPresentationLinks.ModifiedAt == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.ModifiedAt(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.modifiedBy": + if e.complexity.SystemIntakeGRBPresentationLinks.ModifiedBy == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.ModifiedBy(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.presentationDeckFileName": + if e.complexity.SystemIntakeGRBPresentationLinks.PresentationDeckFileName == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.PresentationDeckFileName(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.presentationDeckFileStatus": + if e.complexity.SystemIntakeGRBPresentationLinks.PresentationDeckFileStatus == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.PresentationDeckFileStatus(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.presentationDeckFileURL": + if e.complexity.SystemIntakeGRBPresentationLinks.PresentationDeckFileURL == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.PresentationDeckFileURL(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.recordingLink": + if e.complexity.SystemIntakeGRBPresentationLinks.RecordingLink == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.RecordingLink(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.recordingPasscode": + if e.complexity.SystemIntakeGRBPresentationLinks.RecordingPasscode == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.RecordingPasscode(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.systemIntakeID": + if e.complexity.SystemIntakeGRBPresentationLinks.SystemIntakeID == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.SystemIntakeID(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.transcriptFileName": + if e.complexity.SystemIntakeGRBPresentationLinks.TranscriptFileName == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.TranscriptFileName(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.transcriptFileStatus": + if e.complexity.SystemIntakeGRBPresentationLinks.TranscriptFileStatus == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.TranscriptFileStatus(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.transcriptFileURL": + if e.complexity.SystemIntakeGRBPresentationLinks.TranscriptFileURL == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.TranscriptFileURL(childComplexity), true + + case "SystemIntakeGRBPresentationLinks.transcriptLink": + if e.complexity.SystemIntakeGRBPresentationLinks.TranscriptLink == nil { + break + } + + return e.complexity.SystemIntakeGRBPresentationLinks.TranscriptLink(childComplexity), true + case "SystemIntakeGRBReviewDiscussion.initialPost": if e.complexity.SystemIntakeGRBReviewDiscussion.InitialPost == nil { break @@ -7804,6 +7950,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputSystemIntakeExpireLCIDInput, ec.unmarshalInputSystemIntakeFundingSourceInput, ec.unmarshalInputSystemIntakeFundingSourcesInput, + ec.unmarshalInputSystemIntakeGRBPresentationLinksInput, ec.unmarshalInputSystemIntakeGovernanceTeamInput, ec.unmarshalInputSystemIntakeISSOInput, ec.unmarshalInputSystemIntakeIssueLCIDInput, @@ -8620,6 +8767,38 @@ type SystemIntakeRequester { name: String! } +""" +Represents a single row of presentation link and document data for a system intake's Async GRB review +""" +type SystemIntakeGRBPresentationLinks { + systemIntakeID: UUID! + createdBy: UUID! + createdAt: Time! + modifiedBy: UUID + modifiedAt: Time + recordingLink: String! + recordingPasscode: String + transcriptLink: String + transcriptFileName: String + transcriptFileURL: String + transcriptFileStatus: SystemIntakeDocumentStatus + presentationDeckFileName: String + presentationDeckFileURL: String + presentationDeckFileStatus: SystemIntakeDocumentStatus +} + +""" +Data needed to add system intake presentation link data +""" +input SystemIntakeGRBPresentationLinksInput { + systemIntakeID: UUID! + recordingLink: String! + recordingPasscode: String + transcriptLink: String + transcriptFileData: Upload + presentationDeckFileData: Upload +} + """ Represents an IT governance request for a system """ @@ -8732,6 +8911,10 @@ type SystemIntake { GRB Review Discussion Posts/Threads """ grbDiscussions: [SystemIntakeGRBReviewDiscussion!]! + """ + GRB Presentation Link Data + """ + grbPresentationLinks: SystemIntakeGRBPresentationLinks } type SystemIntakeContractNumber { @@ -10501,6 +10684,8 @@ type Mutation { updateSystemIntakeLinkedCedarSystem(input: UpdateSystemIntakeLinkedCedarSystemInput!): UpdateSystemIntakePayload + setSystemIntakeGRBPresentationLinks(input: SystemIntakeGRBPresentationLinksInput!): SystemIntakeGRBPresentationLinks + archiveSystemIntake(id: UUID!): SystemIntake! sendFeedbackEmail(input: SendFeedbackEmailInput!): String @@ -12538,6 +12723,34 @@ func (ec *executionContext) field_Mutation_setRolesForUserOnSystem_argsInput( return zeroVal, nil } +func (ec *executionContext) field_Mutation_setSystemIntakeGRBPresentationLinks_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_setSystemIntakeGRBPresentationLinks_argsInput(ctx, rawArgs) + if err != nil { + return nil, err + } + args["input"] = arg0 + return args, nil +} +func (ec *executionContext) field_Mutation_setSystemIntakeGRBPresentationLinks_argsInput( + ctx context.Context, + rawArgs map[string]any, +) (models.SystemIntakeGRBPresentationLinksInput, error) { + if _, ok := rawArgs["input"]; !ok { + var zeroVal models.SystemIntakeGRBPresentationLinksInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNSystemIntakeGRBPresentationLinksInput2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeGRBPresentationLinksInput(ctx, tmp) + } + + var zeroVal models.SystemIntakeGRBPresentationLinksInput + return zeroVal, nil +} + func (ec *executionContext) field_Mutation_setSystemIntakeRelationExistingService_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -15575,6 +15788,8 @@ func (ec *executionContext) fieldContext_BusinessCase_systemIntake(_ context.Con return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -24467,6 +24682,8 @@ func (ec *executionContext) fieldContext_CedarSystem_linkedSystemIntakes(ctx con return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -31369,6 +31586,8 @@ func (ec *executionContext) fieldContext_Mutation_createSystemIntake(ctx context return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -31611,6 +31830,8 @@ func (ec *executionContext) fieldContext_Mutation_updateSystemIntakeRequestType( return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -32983,6 +33204,88 @@ func (ec *executionContext) fieldContext_Mutation_updateSystemIntakeLinkedCedarS return fc, nil } +func (ec *executionContext) _Mutation_setSystemIntakeGRBPresentationLinks(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_setSystemIntakeGRBPresentationLinks(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().SetSystemIntakeGRBPresentationLinks(rctx, fc.Args["input"].(models.SystemIntakeGRBPresentationLinksInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*models.SystemIntakeGRBPresentationLinks) + fc.Result = res + return ec.marshalOSystemIntakeGRBPresentationLinks2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeGRBPresentationLinks(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_setSystemIntakeGRBPresentationLinks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "systemIntakeID": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_systemIntakeID(ctx, field) + case "createdBy": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_createdBy(ctx, field) + case "createdAt": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_createdAt(ctx, field) + case "modifiedBy": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_modifiedBy(ctx, field) + case "modifiedAt": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_modifiedAt(ctx, field) + case "recordingLink": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_recordingLink(ctx, field) + case "recordingPasscode": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_recordingPasscode(ctx, field) + case "transcriptLink": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptLink(ctx, field) + case "transcriptFileName": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileName(ctx, field) + case "transcriptFileURL": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileURL(ctx, field) + case "transcriptFileStatus": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileStatus(ctx, field) + case "presentationDeckFileName": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileName(ctx, field) + case "presentationDeckFileURL": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileURL(ctx, field) + case "presentationDeckFileStatus": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileStatus(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SystemIntakeGRBPresentationLinks", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_setSystemIntakeGRBPresentationLinks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _Mutation_archiveSystemIntake(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Mutation_archiveSystemIntake(ctx, field) if err != nil { @@ -33180,6 +33483,8 @@ func (ec *executionContext) fieldContext_Mutation_archiveSystemIntake(ctx contex return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -37394,6 +37699,8 @@ func (ec *executionContext) fieldContext_Query_systemIntake(ctx context.Context, return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -37609,6 +37916,8 @@ func (ec *executionContext) fieldContext_Query_systemIntakes(ctx context.Context return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -37824,6 +38133,8 @@ func (ec *executionContext) fieldContext_Query_mySystemIntakes(_ context.Context return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -38028,6 +38339,8 @@ func (ec *executionContext) fieldContext_Query_systemIntakesWithReviewRequested( return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -38232,6 +38545,8 @@ func (ec *executionContext) fieldContext_Query_systemIntakesWithLcids(_ context. return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -44227,6 +44542,8 @@ func (ec *executionContext) fieldContext_SystemIntake_relatedIntakes(_ context.C return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -44392,6 +44709,77 @@ func (ec *executionContext) fieldContext_SystemIntake_grbDiscussions(_ context.C return fc, nil } +func (ec *executionContext) _SystemIntake_grbPresentationLinks(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntake) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntake_grbPresentationLinks(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.SystemIntake().GrbPresentationLinks(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*models.SystemIntakeGRBPresentationLinks) + fc.Result = res + return ec.marshalOSystemIntakeGRBPresentationLinks2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeGRBPresentationLinks(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntake_grbPresentationLinks(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntake", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "systemIntakeID": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_systemIntakeID(ctx, field) + case "createdBy": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_createdBy(ctx, field) + case "createdAt": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_createdAt(ctx, field) + case "modifiedBy": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_modifiedBy(ctx, field) + case "modifiedAt": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_modifiedAt(ctx, field) + case "recordingLink": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_recordingLink(ctx, field) + case "recordingPasscode": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_recordingPasscode(ctx, field) + case "transcriptLink": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptLink(ctx, field) + case "transcriptFileName": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileName(ctx, field) + case "transcriptFileURL": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileURL(ctx, field) + case "transcriptFileStatus": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileStatus(ctx, field) + case "presentationDeckFileName": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileName(ctx, field) + case "presentationDeckFileURL": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileURL(ctx, field) + case "presentationDeckFileStatus": + return ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileStatus(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SystemIntakeGRBPresentationLinks", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _SystemIntakeAction_id(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeAction) (ret graphql.Marshaler) { fc, err := ec.fieldContext_SystemIntakeAction_id(ctx, field) if err != nil { @@ -44633,6 +45021,8 @@ func (ec *executionContext) fieldContext_SystemIntakeAction_systemIntake(_ conte return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -46571,9 +46961,487 @@ func (ec *executionContext) _SystemIntakeDocument_id(ctx context.Context, field return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeDocument_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + 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) _SystemIntakeDocument_fileName(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocument_fileName(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.FileName, 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_SystemIntakeDocument_fileName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + 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) _SystemIntakeDocument_status(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocument_status(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.SystemIntakeDocument().Status(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.SystemIntakeDocumentStatus) + fc.Result = res + return ec.marshalNSystemIntakeDocumentStatus2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeDocument_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SystemIntakeDocumentStatus does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SystemIntakeDocument_version(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocument_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) (any, 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.(models.SystemIntakeDocumentVersion) + fc.Result = res + return ec.marshalNSystemIntakeDocumentVersion2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentVersion(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeDocument_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SystemIntakeDocumentVersion does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SystemIntakeDocument_uploadedAt(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocument_uploadedAt(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.SystemIntakeDocument().UploadedAt(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.(*time.Time) + fc.Result = res + return ec.marshalNTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeDocument_uploadedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + Field: field, + 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") + }, + } + return fc, nil +} + +func (ec *executionContext) _SystemIntakeDocument_url(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocument_url(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.SystemIntakeDocument().URL(rctx, obj) + }) + 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_SystemIntakeDocument_url(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _SystemIntakeDocument_canDelete(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocument_canDelete(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.SystemIntakeDocument().CanDelete(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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeDocument_canDelete(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _SystemIntakeDocument_canView(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocument_canView(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.SystemIntakeDocument().CanView(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.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeDocument_canView(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _SystemIntakeDocument_systemIntakeId(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocument_systemIntakeId(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.SystemIntakeID, 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_SystemIntakeDocument_systemIntakeId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocument", + 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) _SystemIntakeDocumentType_commonType(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocumentType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocumentType_commonType(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.CommonType, 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.SystemIntakeDocumentCommonType) + fc.Result = res + return ec.marshalNSystemIntakeDocumentCommonType2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentCommonType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeDocumentType_commonType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocumentType", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SystemIntakeDocumentCommonType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _SystemIntakeDocumentType_otherTypeDescription(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocumentType) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeDocumentType_otherTypeDescription(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.OtherTypeDescription, 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_SystemIntakeDocumentType_otherTypeDescription(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeDocumentType", + 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) _SystemIntakeFundingSource_id(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeFundingSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeFundingSource_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) (any, 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_SystemIntakeFundingSource_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeFundingSource", Field: field, IsMethod: false, IsResolver: false, @@ -46584,8 +47452,8 @@ func (ec *executionContext) fieldContext_SystemIntakeDocument_id(_ context.Conte return fc, nil } -func (ec *executionContext) _SystemIntakeDocument_fileName(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocument_fileName(ctx, field) +func (ec *executionContext) _SystemIntakeFundingSource_fundingNumber(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeFundingSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeFundingSource_fundingNumber(ctx, field) if err != nil { return graphql.Null } @@ -46598,26 +47466,64 @@ func (ec *executionContext) _SystemIntakeDocument_fileName(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.FileName, nil + return obj.FundingNumber, 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.(null.String) + fc.Result = res + return ec.marshalOString2githubᚗcomᚋgureguᚋnullᚐString(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeFundingSource_fundingNumber(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeFundingSource", + 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) _SystemIntakeFundingSource_source(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeFundingSource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeFundingSource_source(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return obj.Source, nil + }) + if err != nil { + ec.Error(ctx, err) return graphql.Null } - res := resTmp.(string) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(null.String) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2githubᚗcomᚋgureguᚋnullᚐString(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_fileName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeFundingSource_source(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeFundingSource", Field: field, IsMethod: false, IsResolver: false, @@ -46628,8 +47534,8 @@ func (ec *executionContext) fieldContext_SystemIntakeDocument_fileName(_ context return fc, nil } -func (ec *executionContext) _SystemIntakeDocument_status(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocument_status(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_systemIntakeID(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_systemIntakeID(ctx, field) if err != nil { return graphql.Null } @@ -46642,7 +47548,7 @@ func (ec *executionContext) _SystemIntakeDocument_status(ctx context.Context, fi }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SystemIntakeDocument().Status(rctx, obj) + return obj.SystemIntakeID, nil }) if err != nil { ec.Error(ctx, err) @@ -46654,26 +47560,26 @@ func (ec *executionContext) _SystemIntakeDocument_status(ctx context.Context, fi } return graphql.Null } - res := resTmp.(models.SystemIntakeDocumentStatus) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNSystemIntakeDocumentStatus2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentStatus(ctx, field.Selections, res) + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_status(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_systemIntakeID(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeGRBPresentationLinks", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SystemIntakeDocumentStatus does not have child fields") + return nil, errors.New("field of type UUID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SystemIntakeDocument_version(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocument_version(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_createdBy(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_createdBy(ctx, field) if err != nil { return graphql.Null } @@ -46686,7 +47592,7 @@ func (ec *executionContext) _SystemIntakeDocument_version(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Version, nil + return obj.CreatedBy, nil }) if err != nil { ec.Error(ctx, err) @@ -46698,26 +47604,26 @@ func (ec *executionContext) _SystemIntakeDocument_version(ctx context.Context, f } return graphql.Null } - res := resTmp.(models.SystemIntakeDocumentVersion) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNSystemIntakeDocumentVersion2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentVersion(ctx, field.Selections, res) + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_version(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_createdBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeGRBPresentationLinks", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SystemIntakeDocumentVersion does not have child fields") + return nil, errors.New("field of type UUID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SystemIntakeDocument_uploadedAt(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocument_uploadedAt(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_createdAt(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_createdAt(ctx, field) if err != nil { return graphql.Null } @@ -46730,7 +47636,7 @@ func (ec *executionContext) _SystemIntakeDocument_uploadedAt(ctx context.Context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SystemIntakeDocument().UploadedAt(rctx, obj) + return obj.CreatedAt, nil }) if err != nil { ec.Error(ctx, err) @@ -46742,17 +47648,17 @@ func (ec *executionContext) _SystemIntakeDocument_uploadedAt(ctx context.Context } return graphql.Null } - res := resTmp.(*time.Time) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNTime2ᚖtimeᚐTime(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_uploadedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeGRBPresentationLinks", Field: field, - IsMethod: true, - IsResolver: true, + 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") }, @@ -46760,8 +47666,8 @@ func (ec *executionContext) fieldContext_SystemIntakeDocument_uploadedAt(_ conte return fc, nil } -func (ec *executionContext) _SystemIntakeDocument_url(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocument_url(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_modifiedBy(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_modifiedBy(ctx, field) if err != nil { return graphql.Null } @@ -46774,7 +47680,7 @@ func (ec *executionContext) _SystemIntakeDocument_url(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SystemIntakeDocument().URL(rctx, obj) + return obj.ModifiedBy, nil }) if err != nil { ec.Error(ctx, err) @@ -46783,26 +47689,26 @@ func (ec *executionContext) _SystemIntakeDocument_url(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(*string) + res := resTmp.(*uuid.UUID) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalOUUID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_url(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_modifiedBy(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeGRBPresentationLinks", Field: field, - IsMethod: true, - IsResolver: true, + 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 UUID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SystemIntakeDocument_canDelete(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocument_canDelete(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_modifiedAt(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_modifiedAt(ctx, field) if err != nil { return graphql.Null } @@ -46815,38 +47721,35 @@ func (ec *executionContext) _SystemIntakeDocument_canDelete(ctx context.Context, }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SystemIntakeDocument().CanDelete(rctx, obj) + return obj.ModifiedAt, 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) + res := resTmp.(*time.Time) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_canDelete(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_modifiedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeGRBPresentationLinks", Field: field, - IsMethod: true, - IsResolver: true, + 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 Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SystemIntakeDocument_canView(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocument_canView(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_recordingLink(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_recordingLink(ctx, field) if err != nil { return graphql.Null } @@ -46859,7 +47762,7 @@ func (ec *executionContext) _SystemIntakeDocument_canView(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.SystemIntakeDocument().CanView(rctx, obj) + return obj.RecordingLink, nil }) if err != nil { ec.Error(ctx, err) @@ -46871,26 +47774,26 @@ func (ec *executionContext) _SystemIntakeDocument_canView(ctx context.Context, f } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_canView(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_recordingLink(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeGRBPresentationLinks", Field: field, - IsMethod: true, - IsResolver: true, + 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 String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SystemIntakeDocument_systemIntakeId(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocument) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocument_systemIntakeId(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_recordingPasscode(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_recordingPasscode(ctx, field) if err != nil { return graphql.Null } @@ -46903,38 +47806,35 @@ func (ec *executionContext) _SystemIntakeDocument_systemIntakeId(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.SystemIntakeID, nil + return obj.RecordingPasscode, 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) + res := resTmp.(*string) fc.Result = res - return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocument_systemIntakeId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_recordingPasscode(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocument", + Object: "SystemIntakeGRBPresentationLinks", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SystemIntakeDocumentType_commonType(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocumentType) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocumentType_commonType(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_transcriptLink(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptLink(ctx, field) if err != nil { return graphql.Null } @@ -46947,38 +47847,35 @@ func (ec *executionContext) _SystemIntakeDocumentType_commonType(ctx context.Con }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.CommonType, nil + return obj.TranscriptLink, 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.SystemIntakeDocumentCommonType) + res := resTmp.(*string) fc.Result = res - return ec.marshalNSystemIntakeDocumentCommonType2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentCommonType(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocumentType_commonType(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_transcriptLink(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocumentType", + Object: "SystemIntakeGRBPresentationLinks", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type SystemIntakeDocumentCommonType does not have child fields") + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SystemIntakeDocumentType_otherTypeDescription(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeDocumentType) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeDocumentType_otherTypeDescription(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_transcriptFileName(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileName(ctx, field) if err != nil { return graphql.Null } @@ -46991,7 +47888,7 @@ func (ec *executionContext) _SystemIntakeDocumentType_otherTypeDescription(ctx c }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.OtherTypeDescription, nil + return obj.TranscriptFileName, nil }) if err != nil { ec.Error(ctx, err) @@ -47005,9 +47902,9 @@ func (ec *executionContext) _SystemIntakeDocumentType_otherTypeDescription(ctx c return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeDocumentType_otherTypeDescription(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeDocumentType", + Object: "SystemIntakeGRBPresentationLinks", Field: field, IsMethod: false, IsResolver: false, @@ -47018,8 +47915,8 @@ func (ec *executionContext) fieldContext_SystemIntakeDocumentType_otherTypeDescr return fc, nil } -func (ec *executionContext) _SystemIntakeFundingSource_id(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeFundingSource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeFundingSource_id(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_transcriptFileURL(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileURL(ctx, field) if err != nil { return graphql.Null } @@ -47032,38 +47929,76 @@ func (ec *executionContext) _SystemIntakeFundingSource_id(ctx context.Context, f }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.resolvers.SystemIntakeGRBPresentationLinks().TranscriptFileURL(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.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeGRBPresentationLinks", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _SystemIntakeGRBPresentationLinks_transcriptFileStatus(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileStatus(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.SystemIntakeGRBPresentationLinks().TranscriptFileStatus(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) return graphql.Null } - res := resTmp.(uuid.UUID) + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*models.SystemIntakeDocumentStatus) fc.Result = res - return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOSystemIntakeDocumentStatus2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentStatus(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeFundingSource_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_transcriptFileStatus(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeFundingSource", + Object: "SystemIntakeGRBPresentationLinks", 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 UUID does not have child fields") + return nil, errors.New("field of type SystemIntakeDocumentStatus does not have child fields") }, } return fc, nil } -func (ec *executionContext) _SystemIntakeFundingSource_fundingNumber(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeFundingSource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeFundingSource_fundingNumber(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_presentationDeckFileName(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileName(ctx, field) if err != nil { return graphql.Null } @@ -47076,7 +48011,7 @@ func (ec *executionContext) _SystemIntakeFundingSource_fundingNumber(ctx context }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.FundingNumber, nil + return obj.PresentationDeckFileName, nil }) if err != nil { ec.Error(ctx, err) @@ -47085,14 +48020,14 @@ func (ec *executionContext) _SystemIntakeFundingSource_fundingNumber(ctx context if resTmp == nil { return graphql.Null } - res := resTmp.(null.String) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2githubᚗcomᚋgureguᚋnullᚐString(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeFundingSource_fundingNumber(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileName(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeFundingSource", + Object: "SystemIntakeGRBPresentationLinks", Field: field, IsMethod: false, IsResolver: false, @@ -47103,8 +48038,8 @@ func (ec *executionContext) fieldContext_SystemIntakeFundingSource_fundingNumber return fc, nil } -func (ec *executionContext) _SystemIntakeFundingSource_source(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeFundingSource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SystemIntakeFundingSource_source(ctx, field) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_presentationDeckFileURL(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileURL(ctx, field) if err != nil { return graphql.Null } @@ -47117,7 +48052,7 @@ func (ec *executionContext) _SystemIntakeFundingSource_source(ctx context.Contex }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) { ctx = rctx // use context from middleware stack in children - return obj.Source, nil + return ec.resolvers.SystemIntakeGRBPresentationLinks().PresentationDeckFileURL(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -47126,17 +48061,17 @@ func (ec *executionContext) _SystemIntakeFundingSource_source(ctx context.Contex if resTmp == nil { return graphql.Null } - res := resTmp.(null.String) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2githubᚗcomᚋgureguᚋnullᚐString(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_SystemIntakeFundingSource_source(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileURL(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "SystemIntakeFundingSource", + Object: "SystemIntakeGRBPresentationLinks", 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 String does not have child fields") }, @@ -47144,6 +48079,47 @@ func (ec *executionContext) fieldContext_SystemIntakeFundingSource_source(_ cont return fc, nil } +func (ec *executionContext) _SystemIntakeGRBPresentationLinks_presentationDeckFileStatus(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBPresentationLinks) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileStatus(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.SystemIntakeGRBPresentationLinks().PresentationDeckFileStatus(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*models.SystemIntakeDocumentStatus) + fc.Result = res + return ec.marshalOSystemIntakeDocumentStatus2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_presentationDeckFileStatus(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SystemIntakeGRBPresentationLinks", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type SystemIntakeDocumentStatus does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _SystemIntakeGRBReviewDiscussion_initialPost(ctx context.Context, field graphql.CollectedField, obj *models.SystemIntakeGRBReviewDiscussion) (ret graphql.Marshaler) { fc, err := ec.fieldContext_SystemIntakeGRBReviewDiscussion_initialPost(ctx, field) if err != nil { @@ -53391,6 +54367,8 @@ func (ec *executionContext) fieldContext_TRBRequest_relatedIntakes(_ context.Con return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -56260,6 +57238,8 @@ func (ec *executionContext) fieldContext_TRBRequestForm_systemIntakes(_ context. return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -57018,6 +57998,8 @@ func (ec *executionContext) fieldContext_UpdateSystemIntakePayload_systemIntake( return ec.fieldContext_SystemIntake_relatedTRBRequests(ctx, field) case "grbDiscussions": return ec.fieldContext_SystemIntake_grbDiscussions(ctx, field) + case "grbPresentationLinks": + return ec.fieldContext_SystemIntake_grbPresentationLinks(ctx, field) } return nil, fmt.Errorf("no field named %q was found under type SystemIntake", field.Name) }, @@ -61565,6 +62547,68 @@ func (ec *executionContext) unmarshalInputSystemIntakeFundingSourcesInput(ctx co return it, nil } +func (ec *executionContext) unmarshalInputSystemIntakeGRBPresentationLinksInput(ctx context.Context, obj any) (models.SystemIntakeGRBPresentationLinksInput, error) { + var it models.SystemIntakeGRBPresentationLinksInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"systemIntakeID", "recordingLink", "recordingPasscode", "transcriptLink", "transcriptFileData", "presentationDeckFileData"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "systemIntakeID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("systemIntakeID")) + data, err := ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.SystemIntakeID = data + case "recordingLink": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recordingLink")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.RecordingLink = data + case "recordingPasscode": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recordingPasscode")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.RecordingPasscode = data + case "transcriptLink": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("transcriptLink")) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + it.TranscriptLink = data + case "transcriptFileData": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("transcriptFileData")) + data, err := ec.unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v) + if err != nil { + return it, err + } + it.TranscriptFileData = data + case "presentationDeckFileData": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("presentationDeckFileData")) + data, err := ec.unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx, v) + if err != nil { + return it, err + } + it.PresentationDeckFileData = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputSystemIntakeGovernanceTeamInput(ctx context.Context, obj any) (models.SystemIntakeGovernanceTeamInput, error) { var it models.SystemIntakeGovernanceTeamInput asMap := map[string]any{} @@ -66647,6 +67691,10 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_updateSystemIntakeLinkedCedarSystem(ctx, field) }) + case "setSystemIntakeGRBPresentationLinks": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_setSystemIntakeGRBPresentationLinks(ctx, field) + }) case "archiveSystemIntake": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_archiveSystemIntake(ctx, field) @@ -69066,6 +70114,39 @@ func (ec *executionContext) _SystemIntake(ctx context.Context, sel ast.Selection continue } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "grbPresentationLinks": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._SystemIntake_grbPresentationLinks(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) }) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -69558,21 +70639,372 @@ func (ec *executionContext) _SystemIntakeContractNumber(ctx context.Context, sel return out } -var systemIntakeCostsImplementors = []string{"SystemIntakeCosts"} +var systemIntakeCostsImplementors = []string{"SystemIntakeCosts"} + +func (ec *executionContext) _SystemIntakeCosts(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeCosts) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeCostsImplementors) + + 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("SystemIntakeCosts") + case "expectedIncreaseAmount": + out.Values[i] = ec._SystemIntakeCosts_expectedIncreaseAmount(ctx, field, obj) + case "isExpectingIncrease": + out.Values[i] = ec._SystemIntakeCosts_isExpectingIncrease(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 systemIntakeDocumentImplementors = []string{"SystemIntakeDocument"} + +func (ec *executionContext) _SystemIntakeDocument(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeDocument) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeDocumentImplementors) + + 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("SystemIntakeDocument") + case "documentType": + 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._SystemIntakeDocument_documentType(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 "id": + out.Values[i] = ec._SystemIntakeDocument_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "fileName": + out.Values[i] = ec._SystemIntakeDocument_fileName(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "status": + 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._SystemIntakeDocument_status(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 "version": + out.Values[i] = ec._SystemIntakeDocument_version(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "uploadedAt": + 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._SystemIntakeDocument_uploadedAt(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 "url": + field := field + + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._SystemIntakeDocument_url(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 "canDelete": + 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._SystemIntakeDocument_canDelete(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 "canView": + 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._SystemIntakeDocument_canView(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 "systemIntakeId": + out.Values[i] = ec._SystemIntakeDocument_systemIntakeId(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 systemIntakeDocumentTypeImplementors = []string{"SystemIntakeDocumentType"} + +func (ec *executionContext) _SystemIntakeDocumentType(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeDocumentType) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeDocumentTypeImplementors) + + 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("SystemIntakeDocumentType") + case "commonType": + out.Values[i] = ec._SystemIntakeDocumentType_commonType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "otherTypeDescription": + out.Values[i] = ec._SystemIntakeDocumentType_otherTypeDescription(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 systemIntakeFundingSourceImplementors = []string{"SystemIntakeFundingSource"} -func (ec *executionContext) _SystemIntakeCosts(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeCosts) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeCostsImplementors) +func (ec *executionContext) _SystemIntakeFundingSource(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeFundingSource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeFundingSourceImplementors) 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("SystemIntakeCosts") - case "expectedIncreaseAmount": - out.Values[i] = ec._SystemIntakeCosts_expectedIncreaseAmount(ctx, field, obj) - case "isExpectingIncrease": - out.Values[i] = ec._SystemIntakeCosts_isExpectingIncrease(ctx, field, obj) + out.Values[i] = graphql.MarshalString("SystemIntakeFundingSource") + case "id": + out.Values[i] = ec._SystemIntakeFundingSource_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "fundingNumber": + out.Values[i] = ec._SystemIntakeFundingSource_fundingNumber(ctx, field, obj) + case "source": + out.Values[i] = ec._SystemIntakeFundingSource_source(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -69596,117 +71028,57 @@ func (ec *executionContext) _SystemIntakeCosts(ctx context.Context, sel ast.Sele return out } -var systemIntakeDocumentImplementors = []string{"SystemIntakeDocument"} +var systemIntakeGRBPresentationLinksImplementors = []string{"SystemIntakeGRBPresentationLinks"} -func (ec *executionContext) _SystemIntakeDocument(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeDocument) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeDocumentImplementors) +func (ec *executionContext) _SystemIntakeGRBPresentationLinks(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeGRBPresentationLinks) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeGRBPresentationLinksImplementors) 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("SystemIntakeDocument") - case "documentType": - 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._SystemIntakeDocument_documentType(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 "id": - out.Values[i] = ec._SystemIntakeDocument_id(ctx, field, obj) + out.Values[i] = graphql.MarshalString("SystemIntakeGRBPresentationLinks") + case "systemIntakeID": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_systemIntakeID(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "fileName": - out.Values[i] = ec._SystemIntakeDocument_fileName(ctx, field, obj) + case "createdBy": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_createdBy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "status": - 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._SystemIntakeDocument_status(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 + case "createdAt": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_createdAt(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "version": - out.Values[i] = ec._SystemIntakeDocument_version(ctx, field, obj) + case "modifiedBy": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_modifiedBy(ctx, field, obj) + case "modifiedAt": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_modifiedAt(ctx, field, obj) + case "recordingLink": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_recordingLink(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } - case "uploadedAt": + case "recordingPasscode": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_recordingPasscode(ctx, field, obj) + case "transcriptLink": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_transcriptLink(ctx, field, obj) + case "transcriptFileName": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_transcriptFileName(ctx, field, obj) + case "transcriptFileURL": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._SystemIntakeDocument_uploadedAt(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._SystemIntakeGRBPresentationLinks_transcriptFileURL(ctx, field, obj) return res } @@ -69730,7 +71102,7 @@ func (ec *executionContext) _SystemIntakeDocument(ctx context.Context, sel ast.S } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "url": + case "transcriptFileStatus": field := field innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { @@ -69739,7 +71111,7 @@ func (ec *executionContext) _SystemIntakeDocument(ctx context.Context, sel ast.S ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._SystemIntakeDocument_url(ctx, field, obj) + res = ec._SystemIntakeGRBPresentationLinks_transcriptFileStatus(ctx, field, obj) return res } @@ -69763,19 +71135,18 @@ func (ec *executionContext) _SystemIntakeDocument(ctx context.Context, sel ast.S } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "canDelete": + case "presentationDeckFileName": + out.Values[i] = ec._SystemIntakeGRBPresentationLinks_presentationDeckFileName(ctx, field, obj) + case "presentationDeckFileURL": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._SystemIntakeDocument_canDelete(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._SystemIntakeGRBPresentationLinks_presentationDeckFileURL(ctx, field, obj) return res } @@ -69799,19 +71170,16 @@ func (ec *executionContext) _SystemIntakeDocument(ctx context.Context, sel ast.S } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "canView": + case "presentationDeckFileStatus": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._SystemIntakeDocument_canView(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } + res = ec._SystemIntakeGRBPresentationLinks_presentationDeckFileStatus(ctx, field, obj) return res } @@ -69835,95 +71203,6 @@ func (ec *executionContext) _SystemIntakeDocument(ctx context.Context, sel ast.S } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "systemIntakeId": - out.Values[i] = ec._SystemIntakeDocument_systemIntakeId(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 systemIntakeDocumentTypeImplementors = []string{"SystemIntakeDocumentType"} - -func (ec *executionContext) _SystemIntakeDocumentType(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeDocumentType) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeDocumentTypeImplementors) - - 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("SystemIntakeDocumentType") - case "commonType": - out.Values[i] = ec._SystemIntakeDocumentType_commonType(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "otherTypeDescription": - out.Values[i] = ec._SystemIntakeDocumentType_otherTypeDescription(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 systemIntakeFundingSourceImplementors = []string{"SystemIntakeFundingSource"} - -func (ec *executionContext) _SystemIntakeFundingSource(ctx context.Context, sel ast.SelectionSet, obj *models.SystemIntakeFundingSource) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, systemIntakeFundingSourceImplementors) - - 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("SystemIntakeFundingSource") - case "id": - out.Values[i] = ec._SystemIntakeFundingSource_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - out.Invalids++ - } - case "fundingNumber": - out.Values[i] = ec._SystemIntakeFundingSource_fundingNumber(ctx, field, obj) - case "source": - out.Values[i] = ec._SystemIntakeFundingSource_source(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -75738,6 +77017,11 @@ func (ec *executionContext) unmarshalNSystemIntakeFundingSourceInput2ᚖgithub return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalNSystemIntakeGRBPresentationLinksInput2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeGRBPresentationLinksInput(ctx context.Context, v any) (models.SystemIntakeGRBPresentationLinksInput, error) { + res, err := ec.unmarshalInputSystemIntakeGRBPresentationLinksInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) marshalNSystemIntakeGRBReviewDiscussion2ᚕᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeGRBReviewDiscussionᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.SystemIntakeGRBReviewDiscussion) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup @@ -78370,6 +79654,23 @@ func (ec *executionContext) marshalOSystemIntakeDocument2ᚖgithubᚗcomᚋcms return ec._SystemIntakeDocument(ctx, sel, v) } +func (ec *executionContext) unmarshalOSystemIntakeDocumentStatus2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentStatus(ctx context.Context, v any) (*models.SystemIntakeDocumentStatus, error) { + if v == nil { + return nil, nil + } + tmp, err := graphql.UnmarshalString(v) + res := models.SystemIntakeDocumentStatus(tmp) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOSystemIntakeDocumentStatus2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeDocumentStatus(ctx context.Context, sel ast.SelectionSet, v *models.SystemIntakeDocumentStatus) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(string(*v)) + return res +} + func (ec *executionContext) unmarshalOSystemIntakeFundingSourcesInput2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeFundingSourcesInput(ctx context.Context, v any) (*models.SystemIntakeFundingSourcesInput, error) { if v == nil { return nil, nil @@ -78378,6 +79679,13 @@ func (ec *executionContext) unmarshalOSystemIntakeFundingSourcesInput2ᚖgithub return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalOSystemIntakeGRBPresentationLinks2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeGRBPresentationLinks(ctx context.Context, sel ast.SelectionSet, v *models.SystemIntakeGRBPresentationLinks) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._SystemIntakeGRBPresentationLinks(ctx, sel, v) +} + func (ec *executionContext) marshalOSystemIntakeGRBReviewDiscussionPost2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐSystemIntakeGRBReviewDiscussionPost(ctx context.Context, sel ast.SelectionSet, v *models.SystemIntakeGRBReviewDiscussionPost) graphql.Marshaler { if v == nil { return graphql.Null @@ -78841,6 +80149,22 @@ func (ec *executionContext) marshalOUpdateSystemIntakePayload2ᚖgithubᚗcomᚋ return ec._UpdateSystemIntakePayload(ctx, sel, v) } +func (ec *executionContext) unmarshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v any) (*graphql.Upload, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalUpload(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOUpload2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, sel ast.SelectionSet, v *graphql.Upload) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalUpload(*v) + return res +} + func (ec *executionContext) marshalOUserAccount2ᚖgithubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋauthenticationᚐUserAccount(ctx context.Context, sel ast.SelectionSet, v *authentication.UserAccount) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/pkg/graph/schema.graphql b/pkg/graph/schema.graphql index 629cd0a3e3..3eba09a619 100644 --- a/pkg/graph/schema.graphql +++ b/pkg/graph/schema.graphql @@ -683,6 +683,38 @@ type SystemIntakeRequester { name: String! } +""" +Represents a single row of presentation link and document data for a system intake's Async GRB review +""" +type SystemIntakeGRBPresentationLinks { + systemIntakeID: UUID! + createdBy: UUID! + createdAt: Time! + modifiedBy: UUID + modifiedAt: Time + recordingLink: String! + recordingPasscode: String + transcriptLink: String + transcriptFileName: String + transcriptFileURL: String + transcriptFileStatus: SystemIntakeDocumentStatus + presentationDeckFileName: String + presentationDeckFileURL: String + presentationDeckFileStatus: SystemIntakeDocumentStatus +} + +""" +Data needed to add system intake presentation link data +""" +input SystemIntakeGRBPresentationLinksInput { + systemIntakeID: UUID! + recordingLink: String! + recordingPasscode: String + transcriptLink: String + transcriptFileData: Upload + presentationDeckFileData: Upload +} + """ Represents an IT governance request for a system """ @@ -795,6 +827,10 @@ type SystemIntake { GRB Review Discussion Posts/Threads """ grbDiscussions: [SystemIntakeGRBReviewDiscussion!]! + """ + GRB Presentation Link Data + """ + grbPresentationLinks: SystemIntakeGRBPresentationLinks } type SystemIntakeContractNumber { @@ -2564,6 +2600,8 @@ type Mutation { updateSystemIntakeLinkedCedarSystem(input: UpdateSystemIntakeLinkedCedarSystemInput!): UpdateSystemIntakePayload + setSystemIntakeGRBPresentationLinks(input: SystemIntakeGRBPresentationLinksInput!): SystemIntakeGRBPresentationLinks + archiveSystemIntake(id: UUID!): SystemIntake! sendFeedbackEmail(input: SendFeedbackEmailInput!): String diff --git a/pkg/graph/schema.resolvers.go b/pkg/graph/schema.resolvers.go index 37f25241e3..6c7704d3ce 100644 --- a/pkg/graph/schema.resolvers.go +++ b/pkg/graph/schema.resolvers.go @@ -700,6 +700,24 @@ func (r *mutationResolver) UpdateSystemIntakeLinkedCedarSystem(ctx context.Conte }, nil } +// SetSystemIntakeGRBPresentationLinks is the resolver for the setSystemIntakeGRBPresentationLinks field. +func (r *mutationResolver) SetSystemIntakeGRBPresentationLinks(ctx context.Context, input models.SystemIntakeGRBPresentationLinksInput) (*models.SystemIntakeGRBPresentationLinks, error) { + mockPresentationLinks := models.NewSystemIntakeGRBPresentationLinks(appcontext.Principal(ctx).Account().ID) + mockPresentationLinks.SystemIntakeID = uuid.MustParse("5af245bc-fc54-4677-bab1-1b3e798bb43c") + mockPresentationLinks.CreatedAt = time.Now() + mockPresentationLinks.RecordingLink = input.RecordingLink + mockPresentationLinks.RecordingPasscode = input.RecordingPasscode + mockPresentationLinks.TranscriptLink = input.TranscriptLink + + if input.TranscriptFileData != nil { + mockPresentationLinks.TranscriptFileName = &input.TranscriptFileData.Filename + } + if input.PresentationDeckFileData != nil { + mockPresentationLinks.PresentationDeckFileName = &input.PresentationDeckFileData.Filename + } + return mockPresentationLinks, nil +} + // ArchiveSystemIntake is the resolver for the archiveSystemIntake field. func (r *mutationResolver) ArchiveSystemIntake(ctx context.Context, id uuid.UUID) (*models.SystemIntake, error) { intake, err := r.store.FetchSystemIntakeByID(ctx, id) @@ -1927,6 +1945,20 @@ func (r *systemIntakeResolver) GrbDiscussions(ctx context.Context, obj *models.S return resolvers.SystemIntakeGRBDiscussions(ctx, r.store, obj.ID) } +// GrbPresentationLinks is the resolver for the grbPresentationLinks field. +func (r *systemIntakeResolver) GrbPresentationLinks(ctx context.Context, obj *models.SystemIntake) (*models.SystemIntakeGRBPresentationLinks, error) { + mockPresentationLinks := models.NewSystemIntakeGRBPresentationLinks(appcontext.Principal(ctx).Account().ID) + mockPresentationLinks.SystemIntakeID = uuid.MustParse("5af245bc-fc54-4677-bab1-1b3e798bb43c") + mockPresentationLinks.CreatedBy = appcontext.Principal(ctx).Account().ID + mockPresentationLinks.CreatedAt = time.Now() + mockPresentationLinks.RecordingLink = "https://google.com" + mockPresentationLinks.RecordingPasscode = helpers.PointerTo("123456") + mockPresentationLinks.TranscriptLink = nil + mockPresentationLinks.TranscriptFileName = helpers.PointerTo("transcript.doc") + mockPresentationLinks.PresentationDeckFileName = helpers.PointerTo("presentationDeck.pptx") + return mockPresentationLinks, nil +} + // DocumentType is the resolver for the documentType field. func (r *systemIntakeDocumentResolver) DocumentType(ctx context.Context, obj *models.SystemIntakeDocument) (*models.SystemIntakeDocumentType, error) { return &models.SystemIntakeDocumentType{ @@ -1964,6 +1996,26 @@ func (r *systemIntakeDocumentResolver) CanView(ctx context.Context, obj *models. return resolvers.CanViewDocument(ctx, grbUsers, obj), nil } +// TranscriptFileURL is the resolver for the transcriptFileURL field. +func (r *systemIntakeGRBPresentationLinksResolver) TranscriptFileURL(ctx context.Context, obj *models.SystemIntakeGRBPresentationLinks) (*string, error) { + return helpers.PointerTo("https://google.com"), nil +} + +// TranscriptFileStatus is the resolver for the transcriptFileStatus field. +func (r *systemIntakeGRBPresentationLinksResolver) TranscriptFileStatus(ctx context.Context, obj *models.SystemIntakeGRBPresentationLinks) (*models.SystemIntakeDocumentStatus, error) { + return helpers.PointerTo(models.SystemIntakeDocumentStatusPending), nil +} + +// PresentationDeckFileURL is the resolver for the presentationDeckFileURL field. +func (r *systemIntakeGRBPresentationLinksResolver) PresentationDeckFileURL(ctx context.Context, obj *models.SystemIntakeGRBPresentationLinks) (*string, error) { + return helpers.PointerTo("https://google.com"), nil +} + +// PresentationDeckFileStatus is the resolver for the presentationDeckFileStatus field. +func (r *systemIntakeGRBPresentationLinksResolver) PresentationDeckFileStatus(ctx context.Context, obj *models.SystemIntakeGRBPresentationLinks) (*models.SystemIntakeDocumentStatus, error) { + return helpers.PointerTo(models.SystemIntakeDocumentStatusPending), nil +} + // VotingRole is the resolver for the votingRole field. func (r *systemIntakeGRBReviewerResolver) VotingRole(ctx context.Context, obj *models.SystemIntakeGRBReviewer) (models.SystemIntakeGRBReviewerVotingRole, error) { return models.SystemIntakeGRBReviewerVotingRole(obj.GRBVotingRole), nil @@ -2252,6 +2304,11 @@ func (r *Resolver) SystemIntakeDocument() generated.SystemIntakeDocumentResolver return &systemIntakeDocumentResolver{r} } +// SystemIntakeGRBPresentationLinks returns generated.SystemIntakeGRBPresentationLinksResolver implementation. +func (r *Resolver) SystemIntakeGRBPresentationLinks() generated.SystemIntakeGRBPresentationLinksResolver { + return &systemIntakeGRBPresentationLinksResolver{r} +} + // SystemIntakeGRBReviewer returns generated.SystemIntakeGRBReviewerResolver implementation. func (r *Resolver) SystemIntakeGRBReviewer() generated.SystemIntakeGRBReviewerResolver { return &systemIntakeGRBReviewerResolver{r} @@ -2312,6 +2369,7 @@ type mutationResolver struct{ *Resolver } type queryResolver struct{ *Resolver } type systemIntakeResolver struct{ *Resolver } type systemIntakeDocumentResolver struct{ *Resolver } +type systemIntakeGRBPresentationLinksResolver struct{ *Resolver } type systemIntakeGRBReviewerResolver struct{ *Resolver } type systemIntakeNoteResolver struct{ *Resolver } type tRBAdminNoteResolver struct{ *Resolver } diff --git a/pkg/models/models_gen.go b/pkg/models/models_gen.go index 6d00ece77a..a39f9d492f 100644 --- a/pkg/models/models_gen.go +++ b/pkg/models/models_gen.go @@ -616,6 +616,16 @@ type SystemIntakeFundingSourcesInput struct { FundingSources []*SystemIntakeFundingSourceInput `json:"fundingSources"` } +// Data needed to add system intake presentation link data +type SystemIntakeGRBPresentationLinksInput struct { + SystemIntakeID uuid.UUID `json:"systemIntakeID"` + RecordingLink string `json:"recordingLink"` + RecordingPasscode *string `json:"recordingPasscode,omitempty"` + TranscriptLink *string `json:"transcriptLink,omitempty"` + TranscriptFileData *graphql.Upload `json:"transcriptFileData,omitempty"` + PresentationDeckFileData *graphql.Upload `json:"presentationDeckFileData,omitempty"` +} + type SystemIntakeGRBReviewDiscussion struct { InitialPost *SystemIntakeGRBReviewDiscussionPost `json:"initialPost"` Replies []*SystemIntakeGRBReviewDiscussionPost `json:"replies"` diff --git a/pkg/models/system_intake_document.go b/pkg/models/system_intake_document.go index 1479b903ff..7c9cb27d15 100644 --- a/pkg/models/system_intake_document.go +++ b/pkg/models/system_intake_document.go @@ -55,8 +55,8 @@ type SystemIntakeDocument struct { Version SystemIntakeDocumentVersion `db:"document_version" json:"version"` OtherType string `db:"other_type"` FileName string `json:"fileName" db:"file_name"` - Bucket string `json:"bucket" db:"bucket"` - S3Key string `json:"s3Key" db:"s3_key"` // The document's key inside an S3 bucket; does *not* include the bucket name. + Bucket string `json:"bucket" db:"bucket"` // TODO: Bucket name should be removed as it is never referenced + S3Key string `json:"s3Key" db:"s3_key"` // The document's key inside an S3 bucket; does *not* include the bucket name. UploaderRole DocumentUploaderRole `json:"uploaderRole" db:"uploader_role"` } diff --git a/pkg/models/system_intake_grb_presentation_links.go b/pkg/models/system_intake_grb_presentation_links.go new file mode 100644 index 0000000000..b5cfbcbc3e --- /dev/null +++ b/pkg/models/system_intake_grb_presentation_links.go @@ -0,0 +1,23 @@ +package models + +import ( + "github.com/google/uuid" +) + +type SystemIntakeGRBPresentationLinks struct { + BaseStructUser + SystemIntakeID uuid.UUID `json:"systemIntakeId" db:"system_intake_id"` + RecordingLink string `json:"recordingLink" db:"recording_link"` + RecordingPasscode *string `json:"recordingPasscode" db:"recording_passcode"` + TranscriptLink *string `json:"transcriptLink" db:"transcript_link"` + TranscriptS3Key *string `db:"transcript_s3_key"` + TranscriptFileName *string `json:"transcriptFileName" db:"transcript_file_name"` + PresentationDeckS3Key *string `db:"presentation_deck_s3_key"` + PresentationDeckFileName *string `json:"presentationDeckFileName" db:"presentation_deck_file_name"` +} + +func NewSystemIntakeGRBPresentationLinks(createdByUserAcctID uuid.UUID) *SystemIntakeGRBPresentationLinks { + return &SystemIntakeGRBPresentationLinks{ + BaseStructUser: NewBaseStructUser(createdByUserAcctID), + } +} diff --git a/pkg/storage/truncate.go b/pkg/storage/truncate.go index c87737891a..ef755f7bd8 100644 --- a/pkg/storage/truncate.go +++ b/pkg/storage/truncate.go @@ -21,6 +21,7 @@ func (s *Store) TruncateAllTablesDANGEROUS(logger *zap.Logger) error { estimated_lifecycle_costs, business_cases, governance_request_feedback, + system_intake_grb_presentation_links, system_intake_contacts, system_intake_contract_numbers, system_intake_documents, diff --git a/scripts/dev b/scripts/dev index 3e7fd94d40..3e9c5c863b 100755 --- a/scripts/dev +++ b/scripts/dev @@ -359,6 +359,7 @@ namespace :db do estimated_lifecycle_costs business_cases governance_request_feedback + system_intake_grb_presentation_links system_intake_grb_reviewers system_intake_internal_grb_review_discussion_posts system_intake_contacts diff --git a/src/gql/gen/graphql.ts b/src/gql/gen/graphql.ts index b3994bff4a..03d4527a28 100644 --- a/src/gql/gen/graphql.ts +++ b/src/gql/gen/graphql.ts @@ -999,6 +999,7 @@ export type Mutation = { sendReportAProblemEmail?: Maybe; sendTRBGuidanceLetter: TRBGuidanceLetter; setRolesForUserOnSystem?: Maybe; + setSystemIntakeGRBPresentationLinks?: Maybe; setSystemIntakeRelationExistingService?: Maybe; setSystemIntakeRelationExistingSystem?: Maybe; setSystemIntakeRelationNewSystem?: Maybe; @@ -1338,6 +1339,12 @@ export type MutationSetRolesForUserOnSystemArgs = { }; +/** Defines the mutations for the schema */ +export type MutationSetSystemIntakeGRBPresentationLinksArgs = { + input: SystemIntakeGRBPresentationLinksInput; +}; + + /** Defines the mutations for the schema */ export type MutationSetSystemIntakeRelationExistingServiceArgs = { input?: InputMaybe; @@ -1864,6 +1871,8 @@ export type SystemIntake = { grbDiscussions: Array; /** This is a calculated state based on if a date exists for the GRB Meeting date */ grbMeetingState: SystemIntakeMeetingState; + /** GRB Presentation Link Data */ + grbPresentationLinks?: Maybe; grbReviewStartedAt?: Maybe; grbReviewers: Array; grtDate?: Maybe; @@ -2226,6 +2235,35 @@ export type SystemIntakeFundingSourcesInput = { fundingSources: Array; }; +/** Represents a single row of presentation link and document data for a system intake's Async GRB review */ +export type SystemIntakeGRBPresentationLinks = { + __typename: 'SystemIntakeGRBPresentationLinks'; + createdAt: Scalars['Time']['output']; + createdBy: Scalars['UUID']['output']; + modifiedAt?: Maybe; + modifiedBy?: Maybe; + presentationDeckFileName?: Maybe; + presentationDeckFileStatus?: Maybe; + presentationDeckFileURL?: Maybe; + recordingLink: Scalars['String']['output']; + recordingPasscode?: Maybe; + systemIntakeID: Scalars['UUID']['output']; + transcriptFileName?: Maybe; + transcriptFileStatus?: Maybe; + transcriptFileURL?: Maybe; + transcriptLink?: Maybe; +}; + +/** Data needed to add system intake presentation link data */ +export type SystemIntakeGRBPresentationLinksInput = { + presentationDeckFileData?: InputMaybe; + recordingLink: Scalars['String']['input']; + recordingPasscode?: InputMaybe; + systemIntakeID: Scalars['UUID']['input']; + transcriptFileData?: InputMaybe; + transcriptLink?: InputMaybe; +}; + export type SystemIntakeGRBReviewDiscussion = { __typename: 'SystemIntakeGRBReviewDiscussion'; initialPost: SystemIntakeGRBReviewDiscussionPost; From 49ac98593fda804234d26a5130cd10b7a6fe29b5 Mon Sep 17 00:00:00 2001 From: samoddball <156127704+samoddball@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:36:33 -0700 Subject: [PATCH 3/6] [EASI-4529] notification emails (#2947) * email template * create template support code * add to tests * use acronym * Update pkg/email/templates/grb_review_presentation_links_updated.gohtml Co-authored-by: Lee Warrick <32332479+mynar7@users.noreply.github.com> * remove extra
* updates to system_intake_admin_upload_doc.gohtml * fix oops * fix mistaken bold * spacing --------- Co-authored-by: Lee Warrick <32332479+mynar7@users.noreply.github.com> --- cmd/test_email_templates/main.go | 12 +++ pkg/email/email.go | 8 ++ .../grb_review_discussion_group_tagged.go | 2 +- ...grb_review_discussion_individual_tagged.go | 2 +- .../grb_review_presentation_links_updated.go | 70 +++++++++++++++++ ..._review_presentation_links_updated_test.go | 76 +++++++++++++++++++ pkg/email/system_intake_admin_upload_doc.go | 8 +- .../system_intake_admin_upload_doc_test.go | 8 +- ...b_review_presentation_links_updated.gohtml | 19 +++++ .../system_intake_admin_upload_doc.gohtml | 7 +- 10 files changed, 197 insertions(+), 15 deletions(-) create mode 100644 pkg/email/grb_review_presentation_links_updated.go create mode 100644 pkg/email/grb_review_presentation_links_updated_test.go create mode 100644 pkg/email/templates/grb_review_presentation_links_updated.gohtml diff --git a/cmd/test_email_templates/main.go b/cmd/test_email_templates/main.go index e8ba081bfd..3cfac3ef63 100644 --- a/cmd/test_email_templates/main.go +++ b/cmd/test_email_templates/main.go @@ -723,4 +723,16 @@ func sendITGovEmails(ctx context.Context, client *email.Client) { }, ) noErr(err) + + err = client.SystemIntake.SendGRBReviewPresentationLinksUpdatedEmail( + ctx, + email.SendGRBReviewPresentationLinksUpdatedEmailInput{ + SystemIntakeID: intakeID, + ProjectName: "Project with Presentation", + RequesterName: "Nobody", + RequesterComponent: "ABCD", + Recipients: emailNotificationRecipients.RegularRecipientEmails, + }, + ) + noErr(err) } diff --git a/pkg/email/email.go b/pkg/email/email.go index 878412ee21..956e9c5466 100644 --- a/pkg/email/email.go +++ b/pkg/email/email.go @@ -79,6 +79,7 @@ type templates struct { grbReviewDiscussionReply templateCaller grbReviewDiscussionIndividualTagged templateCaller grbReviewDiscussionGroupTagged templateCaller + grbReviewPresentationLinksUpdated templateCaller } // sender is an interface for swapping out email provider implementations @@ -429,6 +430,13 @@ func NewClient(config Config, sender sender) (Client, error) { } appTemplates.grbReviewDiscussionGroupTagged = grbReviewDiscussionGroupTagged + grbReviewPresentationLinksUpdatedTemplateName := "grb_review_presentation_links_updated.gohtml" + grbReviewPresentationLinksUpdated := rawTemplates.Lookup(grbReviewPresentationLinksUpdatedTemplateName) + if grbReviewPresentationLinksUpdated == nil { + return Client{}, templateError(grbReviewPresentationLinksUpdatedTemplateName) + } + appTemplates.grbReviewPresentationLinksUpdated = grbReviewPresentationLinksUpdated + client := Client{ config: config, templates: appTemplates, diff --git a/pkg/email/grb_review_discussion_group_tagged.go b/pkg/email/grb_review_discussion_group_tagged.go index fc007ba506..4be6a44631 100644 --- a/pkg/email/grb_review_discussion_group_tagged.go +++ b/pkg/email/grb_review_discussion_group_tagged.go @@ -45,7 +45,7 @@ type GRBReviewDiscussionGroupTaggedBody struct { func (sie systemIntakeEmails) grbReviewDiscussionGroupTaggedBody(input SendGRBReviewDiscussionGroupTaggedEmailInput) (string, error) { if sie.client.templates.grbReviewDiscussionGroupTagged == nil { - return "", errors.New("grb review discussion reply template is nil") + return "", errors.New("grb review discussion group tagged template is nil") } grbReviewPath := path.Join("it-governance", input.SystemIntakeID.String(), "grb-review") diff --git a/pkg/email/grb_review_discussion_individual_tagged.go b/pkg/email/grb_review_discussion_individual_tagged.go index 3371a5720f..3bbc4340bb 100644 --- a/pkg/email/grb_review_discussion_individual_tagged.go +++ b/pkg/email/grb_review_discussion_individual_tagged.go @@ -42,7 +42,7 @@ type GRBReviewDiscussionIndividualTaggedBody struct { func (sie systemIntakeEmails) grbReviewDiscussionIndividualTaggedBody(input SendGRBReviewDiscussionIndividualTaggedEmailInput) (string, error) { if sie.client.templates.grbReviewDiscussionIndividualTagged == nil { - return "", errors.New("grb review discussion reply template is nil") + return "", errors.New("grb review discussion individual tagged template is nil") } grbReviewPath := path.Join("it-governance", input.SystemIntakeID.String(), "grb-review") diff --git a/pkg/email/grb_review_presentation_links_updated.go b/pkg/email/grb_review_presentation_links_updated.go new file mode 100644 index 0000000000..ceb1a0f399 --- /dev/null +++ b/pkg/email/grb_review_presentation_links_updated.go @@ -0,0 +1,70 @@ +package email + +import ( + "bytes" + "context" + "errors" + "fmt" + "path" + + "github.com/google/uuid" + + "github.com/cms-enterprise/easi-app/pkg/models" +) + +type SendGRBReviewPresentationLinksUpdatedEmailInput struct { + SystemIntakeID uuid.UUID + ProjectName string + RequesterName string + RequesterComponent string + Recipients []models.EmailAddress +} + +type grbReviewPresentationLinksUpdatedBody struct { + ProjectName string + RequesterName string + RequesterComponent string + SystemIntakeLink string + ITGovernanceInboxAddress models.EmailAddress +} + +func (sie systemIntakeEmails) grbReviewPresentationLinksUpdatedBody(input SendGRBReviewPresentationLinksUpdatedEmailInput) (string, error) { + if sie.client.templates.grbReviewPresentationLinksUpdated == nil { + return "", errors.New("grb review presentation links updated template is nil") + } + + grbReviewPath := path.Join("it-governance", input.SystemIntakeID.String(), "grb-review") + + data := grbReviewPresentationLinksUpdatedBody{ + ProjectName: input.ProjectName, + SystemIntakeLink: sie.client.urlFromPath(grbReviewPath), + RequesterName: input.RequesterName, + RequesterComponent: input.RequesterComponent, + ITGovernanceInboxAddress: sie.client.config.GRTEmail, + } + + var b bytes.Buffer + if err := sie.client.templates.grbReviewPresentationLinksUpdated.Execute(&b, data); err != nil { + return "", err + } + + return b.String(), nil +} + +func (sie systemIntakeEmails) SendGRBReviewPresentationLinksUpdatedEmail(ctx context.Context, input SendGRBReviewPresentationLinksUpdatedEmailInput) error { + subject := fmt.Sprintf("Presentation links updated on the GRB review for %s", input.ProjectName) + + body, err := sie.grbReviewPresentationLinksUpdatedBody(input) + if err != nil { + return err + } + + return sie.client.sender.Send( + ctx, + NewEmail(). + WithToAddresses(input.Recipients). + WithCCAddresses([]models.EmailAddress{sie.client.config.GRTEmail}). + WithSubject(subject). + WithBody(body), + ) +} diff --git a/pkg/email/grb_review_presentation_links_updated_test.go b/pkg/email/grb_review_presentation_links_updated_test.go new file mode 100644 index 0000000000..aab1fcfbab --- /dev/null +++ b/pkg/email/grb_review_presentation_links_updated_test.go @@ -0,0 +1,76 @@ +package email + +import ( + "context" + "fmt" + "path" + + "github.com/google/uuid" + + "github.com/cms-enterprise/easi-app/pkg/models" +) + +func (s *EmailTestSuite) TestSendGRBReviewPresentationLinksUpdatedEmail() { + ctx := context.Background() + intakeID := uuid.MustParse("24dd7736-e4c2-4f67-8844-51187de49069") + requestName := "Presentation Links" + requester := "Nobody" + requesterComponent := "ABCD" + recipients := []models.EmailAddress{"someone@cms.gov"} + + sender := mockSender{} + client, err := NewClient(s.config, &sender) + s.NoError(err) + + err = client.SystemIntake.SendGRBReviewPresentationLinksUpdatedEmail( + ctx, + SendGRBReviewPresentationLinksUpdatedEmailInput{ + SystemIntakeID: intakeID, + ProjectName: requestName, + RequesterName: requester, + RequesterComponent: requesterComponent, + Recipients: recipients, + }, + ) + s.NoError(err) + + expectedSubject := fmt.Sprintf("Presentation links updated on the GRB review for %s", requestName) + s.Equal(expectedSubject, sender.subject) + + s.ElementsMatch(sender.toAddresses, recipients) + s.ElementsMatch(sender.ccAddresses, []models.EmailAddress{s.config.GRTEmail}) + + intakePath := path.Join("it-governance", intakeID.String(), "grb-review") + + grbReviewLink := client.urlFromPath(intakePath) + + expectedEmail := fmt.Sprintf(` +

EASi

+

Easy Access to System Information

+ +

The Governance Admin Team has updated the presentation recording links on the GRB review for %[1]s. You + may view the recording and/or slide deck using the link below.

+ +

View this request in EASi

+ +
+
+

Request summary:

+

Project title: %[1]s

+

Requester: %[3]s, %[4]s

+
+ +
+

If you have questions, please contact the Governance Team at %[5]s.

+
+

You will continue to receive email notifications about this request until it is closed.

`, + requestName, + grbReviewLink, + requester, + requesterComponent, + s.config.GRTEmail.String(), + ) + + s.EqualHTML(expectedEmail, sender.body) +} diff --git a/pkg/email/system_intake_admin_upload_doc.go b/pkg/email/system_intake_admin_upload_doc.go index 5b6b095c4b..49fd1430c8 100644 --- a/pkg/email/system_intake_admin_upload_doc.go +++ b/pkg/email/system_intake_admin_upload_doc.go @@ -29,6 +29,10 @@ type systemIntakeAdminUploadDocBody struct { } func (sie systemIntakeEmails) systemIntakeAdminUploadDocBody(input SendSystemIntakeAdminUploadDocEmailInput) (string, error) { + if sie.client.templates.systemIntakeAdminUploadDocTemplate == nil { + return "", errors.New("system intake admin upload doc template is nil") + } + link := path.Join("it-governance", input.SystemIntakeID.String(), "grb-review") data := systemIntakeAdminUploadDocBody{ @@ -39,10 +43,6 @@ func (sie systemIntakeEmails) systemIntakeAdminUploadDocBody(input SendSystemInt ITGovernanceInboxAddress: sie.client.config.GRTEmail.String(), } - if sie.client.templates.systemIntakeAdminUploadDocTemplate == nil { - return "", errors.New("system intake admin upload doc template is nil") - } - var b bytes.Buffer if err := sie.client.templates.systemIntakeAdminUploadDocTemplate.Execute(&b, data); err != nil { return "", err diff --git a/pkg/email/system_intake_admin_upload_doc_test.go b/pkg/email/system_intake_admin_upload_doc_test.go index 53c573ebcb..c124a49f88 100644 --- a/pkg/email/system_intake_admin_upload_doc_test.go +++ b/pkg/email/system_intake_admin_upload_doc_test.go @@ -39,17 +39,15 @@ func (s *EmailTestSuite) TestSendSystemIntakeAdminUploadDocEmail() {
-

Request Summary

-

Project title: %[1]s

-

Requester: %[3]s, %[4]s -

+

Request summary:

+

Project title: %[1]s

+

Requester: %[3]s, %[4]s


If you have questions, please contact the Governance Team at %[5]s.

-

You will continue to receive email notifications about your request until it is closed.

`, requestName, diff --git a/pkg/email/templates/grb_review_presentation_links_updated.gohtml b/pkg/email/templates/grb_review_presentation_links_updated.gohtml new file mode 100644 index 0000000000..d769270b7c --- /dev/null +++ b/pkg/email/templates/grb_review_presentation_links_updated.gohtml @@ -0,0 +1,19 @@ +{{template "easi_header.gohtml"}} + +

The Governance Admin Team has updated the presentation recording links on the GRB review for {{.ProjectName}}. You + may view the recording and/or slide deck using the link below.

+ +

View this request in EASi

+ +
+
+

Request summary:

+

Project title: {{.ProjectName}}

+

Requester: {{.RequesterName}}, {{.RequesterComponent}}

+
+ +
+

If you have questions, please contact the Governance Team at {{.ITGovernanceInboxAddress}}.

+
+

You will continue to receive email notifications about this request until it is closed.

diff --git a/pkg/email/templates/system_intake_admin_upload_doc.gohtml b/pkg/email/templates/system_intake_admin_upload_doc.gohtml index bd089f5948..bab9386639 100644 --- a/pkg/email/templates/system_intake_admin_upload_doc.gohtml +++ b/pkg/email/templates/system_intake_admin_upload_doc.gohtml @@ -8,15 +8,14 @@
-

Request Summary

-

Project title: {{.RequestName}}

-

Requester: {{.RequesterName}}, {{.RequestComponent}}

+

Request summary:

+

Project title: {{.RequestName}}

+

Requester: {{.RequesterName}}, {{.RequestComponent}}


If you have questions, please contact the Governance Team at {{.ITGovernanceInboxAddress}}.

-

You will continue to receive email notifications about your request until it is closed.

From a804487f6e72b24abafcbfd466769912d3c8da15 Mon Sep 17 00:00:00 2001 From: samoddball <156127704+samoddball@users.noreply.github.com> Date: Fri, 17 Jan 2025 08:59:10 -0700 Subject: [PATCH 4/6] Easi 4697/delete links mutation (#2953) * add sql file, sqlqueries file, storage file * add to schema/resolvers * err when row not found * whoops * add some form of a test --- pkg/graph/generated/generated.go | 142 ++++++++++++++++++ pkg/graph/schema.graphql | 5 + pkg/graph/schema.resolvers.go | 5 + pkg/models/models_gen.go | 4 + .../delete.sql | 3 + .../system_intake_grb_presentation_links.go | 16 ++ .../system_intake_grb_presentation_links.go | 34 +++++ ...stem_intake_grb_presentation_links_test.go | 26 ++++ src/gql/gen/graphql.ts | 11 ++ 9 files changed, 246 insertions(+) create mode 100644 pkg/sqlqueries/SQL/system_intake_grb_presentation_links/delete.sql create mode 100644 pkg/sqlqueries/system_intake_grb_presentation_links.go create mode 100644 pkg/storage/system_intake_grb_presentation_links.go create mode 100644 pkg/storage/system_intake_grb_presentation_links_test.go diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go index 63a234302c..d44737073a 100644 --- a/pkg/graph/generated/generated.go +++ b/pkg/graph/generated/generated.go @@ -583,6 +583,7 @@ type ComplexityRoot struct { DeleteCedarSystemBookmark func(childComplexity int, input models.CreateCedarSystemBookmarkInput) int DeleteSystemIntakeContact func(childComplexity int, input models.DeleteSystemIntakeContactInput) int DeleteSystemIntakeDocument func(childComplexity int, id uuid.UUID) int + DeleteSystemIntakeGRBPresentationLinks func(childComplexity int, input models.DeleteSystemIntakeGRBPresentationLinksInput) int DeleteSystemIntakeGRBReviewer func(childComplexity int, input models.DeleteSystemIntakeGRBReviewerInput) int DeleteTRBGuidanceLetterInsight func(childComplexity int, id uuid.UUID) int DeleteTRBRequestAttendee func(childComplexity int, id uuid.UUID) int @@ -1257,6 +1258,7 @@ type MutationResolver interface { CreateSystemIntakeGRBDiscussionReply(ctx context.Context, input models.CreateSystemIntakeGRBDiscussionReplyInput) (*models.SystemIntakeGRBReviewDiscussionPost, error) UpdateSystemIntakeLinkedCedarSystem(ctx context.Context, input models.UpdateSystemIntakeLinkedCedarSystemInput) (*models.UpdateSystemIntakePayload, error) SetSystemIntakeGRBPresentationLinks(ctx context.Context, input models.SystemIntakeGRBPresentationLinksInput) (*models.SystemIntakeGRBPresentationLinks, error) + DeleteSystemIntakeGRBPresentationLinks(ctx context.Context, input models.DeleteSystemIntakeGRBPresentationLinksInput) (uuid.UUID, error) ArchiveSystemIntake(ctx context.Context, id uuid.UUID) (*models.SystemIntake, error) SendFeedbackEmail(ctx context.Context, input models.SendFeedbackEmailInput) (*string, error) SendCantFindSomethingEmail(ctx context.Context, input models.SendCantFindSomethingEmailInput) (*string, error) @@ -4404,6 +4406,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.DeleteSystemIntakeDocument(childComplexity, args["id"].(uuid.UUID)), true + case "Mutation.deleteSystemIntakeGRBPresentationLinks": + if e.complexity.Mutation.DeleteSystemIntakeGRBPresentationLinks == nil { + break + } + + args, err := ec.field_Mutation_deleteSystemIntakeGRBPresentationLinks_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteSystemIntakeGRBPresentationLinks(childComplexity, args["input"].(models.DeleteSystemIntakeGRBPresentationLinksInput)), true + case "Mutation.deleteSystemIntakeGRBReviewer": if e.complexity.Mutation.DeleteSystemIntakeGRBReviewer == nil { break @@ -7922,6 +7936,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCreateTRBRequestDocumentInput, ec.unmarshalInputCreateTRBRequestFeedbackInput, ec.unmarshalInputDeleteSystemIntakeContactInput, + ec.unmarshalInputDeleteSystemIntakeGRBPresentationLinksInput, ec.unmarshalInputDeleteSystemIntakeGRBReviewerInput, ec.unmarshalInputDeleteTRBRequestFundingSourcesInput, ec.unmarshalInputEmailNotificationRecipients, @@ -8799,6 +8814,10 @@ input SystemIntakeGRBPresentationLinksInput { presentationDeckFileData: Upload } +input DeleteSystemIntakeGRBPresentationLinksInput { + systemIntakeID: UUID! +} + """ Represents an IT governance request for a system """ @@ -10685,6 +10704,7 @@ type Mutation { updateSystemIntakeLinkedCedarSystem(input: UpdateSystemIntakeLinkedCedarSystemInput!): UpdateSystemIntakePayload setSystemIntakeGRBPresentationLinks(input: SystemIntakeGRBPresentationLinksInput!): SystemIntakeGRBPresentationLinks + deleteSystemIntakeGRBPresentationLinks(input: DeleteSystemIntakeGRBPresentationLinksInput!): UUID! archiveSystemIntake(id: UUID!): SystemIntake! @@ -12359,6 +12379,34 @@ func (ec *executionContext) field_Mutation_deleteSystemIntakeDocument_argsID( return zeroVal, nil } +func (ec *executionContext) field_Mutation_deleteSystemIntakeGRBPresentationLinks_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { + var err error + args := map[string]any{} + arg0, err := ec.field_Mutation_deleteSystemIntakeGRBPresentationLinks_argsInput(ctx, rawArgs) + if err != nil { + return nil, err + } + args["input"] = arg0 + return args, nil +} +func (ec *executionContext) field_Mutation_deleteSystemIntakeGRBPresentationLinks_argsInput( + ctx context.Context, + rawArgs map[string]any, +) (models.DeleteSystemIntakeGRBPresentationLinksInput, error) { + if _, ok := rawArgs["input"]; !ok { + var zeroVal models.DeleteSystemIntakeGRBPresentationLinksInput + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + if tmp, ok := rawArgs["input"]; ok { + return ec.unmarshalNDeleteSystemIntakeGRBPresentationLinksInput2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐDeleteSystemIntakeGRBPresentationLinksInput(ctx, tmp) + } + + var zeroVal models.DeleteSystemIntakeGRBPresentationLinksInput + return zeroVal, nil +} + func (ec *executionContext) field_Mutation_deleteSystemIntakeGRBReviewer_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} @@ -33286,6 +33334,61 @@ func (ec *executionContext) fieldContext_Mutation_setSystemIntakeGRBPresentation return fc, nil } +func (ec *executionContext) _Mutation_deleteSystemIntakeGRBPresentationLinks(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_deleteSystemIntakeGRBPresentationLinks(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) (any, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteSystemIntakeGRBPresentationLinks(rctx, fc.Args["input"].(models.DeleteSystemIntakeGRBPresentationLinksInput)) + }) + 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_Mutation_deleteSystemIntakeGRBPresentationLinks(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type UUID does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Mutation_deleteSystemIntakeGRBPresentationLinks_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _Mutation_archiveSystemIntake(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Mutation_archiveSystemIntake(ctx, field) if err != nil { @@ -61315,6 +61418,33 @@ func (ec *executionContext) unmarshalInputDeleteSystemIntakeContactInput(ctx con return it, nil } +func (ec *executionContext) unmarshalInputDeleteSystemIntakeGRBPresentationLinksInput(ctx context.Context, obj any) (models.DeleteSystemIntakeGRBPresentationLinksInput, error) { + var it models.DeleteSystemIntakeGRBPresentationLinksInput + asMap := map[string]any{} + for k, v := range obj.(map[string]any) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"systemIntakeID"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "systemIntakeID": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("systemIntakeID")) + data, err := ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + it.SystemIntakeID = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputDeleteSystemIntakeGRBReviewerInput(ctx context.Context, obj any) (models.DeleteSystemIntakeGRBReviewerInput, error) { var it models.DeleteSystemIntakeGRBReviewerInput asMap := map[string]any{} @@ -67695,6 +67825,13 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_setSystemIntakeGRBPresentationLinks(ctx, field) }) + case "deleteSystemIntakeGRBPresentationLinks": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_deleteSystemIntakeGRBPresentationLinks(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ + } case "archiveSystemIntake": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_archiveSystemIntake(ctx, field) @@ -75843,6 +75980,11 @@ func (ec *executionContext) unmarshalNDeleteSystemIntakeContactInput2githubᚗco return res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalNDeleteSystemIntakeGRBPresentationLinksInput2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐDeleteSystemIntakeGRBPresentationLinksInput(ctx context.Context, v any) (models.DeleteSystemIntakeGRBPresentationLinksInput, error) { + res, err := ec.unmarshalInputDeleteSystemIntakeGRBPresentationLinksInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNDeleteSystemIntakeGRBReviewerInput2githubᚗcomᚋcmsᚑenterpriseᚋeasiᚑappᚋpkgᚋmodelsᚐDeleteSystemIntakeGRBReviewerInput(ctx context.Context, v any) (models.DeleteSystemIntakeGRBReviewerInput, error) { res, err := ec.unmarshalInputDeleteSystemIntakeGRBReviewerInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) diff --git a/pkg/graph/schema.graphql b/pkg/graph/schema.graphql index 3eba09a619..24811062b6 100644 --- a/pkg/graph/schema.graphql +++ b/pkg/graph/schema.graphql @@ -715,6 +715,10 @@ input SystemIntakeGRBPresentationLinksInput { presentationDeckFileData: Upload } +input DeleteSystemIntakeGRBPresentationLinksInput { + systemIntakeID: UUID! +} + """ Represents an IT governance request for a system """ @@ -2601,6 +2605,7 @@ type Mutation { updateSystemIntakeLinkedCedarSystem(input: UpdateSystemIntakeLinkedCedarSystemInput!): UpdateSystemIntakePayload setSystemIntakeGRBPresentationLinks(input: SystemIntakeGRBPresentationLinksInput!): SystemIntakeGRBPresentationLinks + deleteSystemIntakeGRBPresentationLinks(input: DeleteSystemIntakeGRBPresentationLinksInput!): UUID! archiveSystemIntake(id: UUID!): SystemIntake! diff --git a/pkg/graph/schema.resolvers.go b/pkg/graph/schema.resolvers.go index 6c7704d3ce..7eb930a0d9 100644 --- a/pkg/graph/schema.resolvers.go +++ b/pkg/graph/schema.resolvers.go @@ -718,6 +718,11 @@ func (r *mutationResolver) SetSystemIntakeGRBPresentationLinks(ctx context.Conte return mockPresentationLinks, nil } +// DeleteSystemIntakeGRBPresentationLinks is the resolver for the deleteSystemIntakeGRBPresentationLinks field. +func (r *mutationResolver) DeleteSystemIntakeGRBPresentationLinks(ctx context.Context, input models.DeleteSystemIntakeGRBPresentationLinksInput) (uuid.UUID, error) { + return input.SystemIntakeID, r.store.DeleteSystemIntakeGRBPresentationLinks(ctx, input.SystemIntakeID) +} + // ArchiveSystemIntake is the resolver for the archiveSystemIntake field. func (r *mutationResolver) ArchiveSystemIntake(ctx context.Context, id uuid.UUID) (*models.SystemIntake, error) { intake, err := r.store.FetchSystemIntakeByID(ctx, id) diff --git a/pkg/models/models_gen.go b/pkg/models/models_gen.go index a39f9d492f..d7be9cb308 100644 --- a/pkg/models/models_gen.go +++ b/pkg/models/models_gen.go @@ -306,6 +306,10 @@ type DeleteSystemIntakeDocumentPayload struct { Document *SystemIntakeDocument `json:"document,omitempty"` } +type DeleteSystemIntakeGRBPresentationLinksInput struct { + SystemIntakeID uuid.UUID `json:"systemIntakeID"` +} + type DeleteSystemIntakeGRBReviewerInput struct { ReviewerID uuid.UUID `json:"reviewerID"` } diff --git a/pkg/sqlqueries/SQL/system_intake_grb_presentation_links/delete.sql b/pkg/sqlqueries/SQL/system_intake_grb_presentation_links/delete.sql new file mode 100644 index 0000000000..5f2ca68707 --- /dev/null +++ b/pkg/sqlqueries/SQL/system_intake_grb_presentation_links/delete.sql @@ -0,0 +1,3 @@ +DELETE +FROM system_intake_grb_presentation_links +WHERE system_intake_id = :system_intake_id; diff --git a/pkg/sqlqueries/system_intake_grb_presentation_links.go b/pkg/sqlqueries/system_intake_grb_presentation_links.go new file mode 100644 index 0000000000..48b9a713cb --- /dev/null +++ b/pkg/sqlqueries/system_intake_grb_presentation_links.go @@ -0,0 +1,16 @@ +package sqlqueries + +import ( + _ "embed" +) + +//go:embed SQL/system_intake_grb_presentation_links/delete.sql +var deleteSystemIntakeGRBPresentationLinksSQL string + +var SystemIntakeGRBPresentationLinks = systemIntakeGRBPresentationLinksScripts{ + Delete: deleteSystemIntakeGRBPresentationLinksSQL, +} + +type systemIntakeGRBPresentationLinksScripts struct { + Delete string +} diff --git a/pkg/storage/system_intake_grb_presentation_links.go b/pkg/storage/system_intake_grb_presentation_links.go new file mode 100644 index 0000000000..962de257b9 --- /dev/null +++ b/pkg/storage/system_intake_grb_presentation_links.go @@ -0,0 +1,34 @@ +package storage + +import ( + "context" + "fmt" + + "github.com/google/uuid" + "go.uber.org/zap" + + "github.com/cms-enterprise/easi-app/pkg/appcontext" + "github.com/cms-enterprise/easi-app/pkg/sqlqueries" +) + +func (s *Store) DeleteSystemIntakeGRBPresentationLinks(ctx context.Context, systemIntakeID uuid.UUID) error { + res, err := namedExec(ctx, s.db, sqlqueries.SystemIntakeGRBPresentationLinks.Delete, args{ + "system_intake_id": systemIntakeID, + }) + if err != nil { + appcontext.ZLogger(ctx).Error("failed to delete GRB presentation links", zap.Error(err)) + return err + } + + rowsAffected, err := res.RowsAffected() + if err != nil { + appcontext.ZLogger(ctx).Error("failed to get rows affected when deleting GRB presentation links", zap.Error(err)) + // don't return here - prefer to err from the below + } + + if rowsAffected != 1 { + return fmt.Errorf("problem deleting GRB presentation links, expected 1 row deleted, got %d", rowsAffected) + } + + return nil +} diff --git a/pkg/storage/system_intake_grb_presentation_links_test.go b/pkg/storage/system_intake_grb_presentation_links_test.go new file mode 100644 index 0000000000..b89c07819e --- /dev/null +++ b/pkg/storage/system_intake_grb_presentation_links_test.go @@ -0,0 +1,26 @@ +package storage + +import ( + "context" + + "github.com/guregu/null" + + "github.com/cms-enterprise/easi-app/pkg/models" +) + +func (s *StoreTestSuite) TestDeleteSystemIntakeGRBPresentationLinks() { + ctx := context.Background() + euaID := "ABCD" + + intake, err := s.store.CreateSystemIntake(ctx, &models.SystemIntake{ + RequestType: models.SystemIntakeRequestTypeNEW, + EUAUserID: null.StringFrom(euaID), + }) + s.NoError(err) + s.NotNil(intake) + + s.Run("test error case (only case for now)", func() { + err := s.store.DeleteSystemIntakeGRBPresentationLinks(ctx, intake.ID) + s.Error(err) + }) +} diff --git a/src/gql/gen/graphql.ts b/src/gql/gen/graphql.ts index 03d4527a28..30c439561f 100644 --- a/src/gql/gen/graphql.ts +++ b/src/gql/gen/graphql.ts @@ -694,6 +694,10 @@ export type DeleteSystemIntakeDocumentPayload = { document?: Maybe; }; +export type DeleteSystemIntakeGRBPresentationLinksInput = { + systemIntakeID: Scalars['UUID']['input']; +}; + export type DeleteSystemIntakeGRBReviewerInput = { reviewerID: Scalars['UUID']['input']; }; @@ -986,6 +990,7 @@ export type Mutation = { deleteCedarSystemBookmark?: Maybe; deleteSystemIntakeContact?: Maybe; deleteSystemIntakeDocument?: Maybe; + deleteSystemIntakeGRBPresentationLinks: Scalars['UUID']['output']; deleteSystemIntakeGRBReviewer: Scalars['UUID']['output']; deleteTRBGuidanceLetterInsight: TRBGuidanceLetterInsight; deleteTRBRequestAttendee: TRBRequestAttendee; @@ -1261,6 +1266,12 @@ export type MutationDeleteSystemIntakeDocumentArgs = { }; +/** Defines the mutations for the schema */ +export type MutationDeleteSystemIntakeGRBPresentationLinksArgs = { + input: DeleteSystemIntakeGRBPresentationLinksInput; +}; + + /** Defines the mutations for the schema */ export type MutationDeleteSystemIntakeGRBReviewerArgs = { input: DeleteSystemIntakeGRBReviewerInput; From 881c7d38c2e6c43039e968b4d5120768e9b9a7a6 Mon Sep 17 00:00:00 2001 From: Lee Warrick <32332479+mynar7@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:08:35 -0500 Subject: [PATCH 5/6] [EASI-4711] Remove required presentation links fields (#2954) * remove requirement * add semicolon --- .../V199__Add_async_GRB_presentation_links.sql | 8 ++++++++ pkg/graph/generated/generated.go | 18 +++++++----------- pkg/graph/schema.graphql | 6 ++++-- pkg/graph/schema.resolvers.go | 2 +- pkg/models/models_gen.go | 3 ++- .../system_intake_grb_presentation_links.go | 2 +- src/gql/gen/graphql.ts | 14 ++++++++++---- 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/migrations/V199__Add_async_GRB_presentation_links.sql b/migrations/V199__Add_async_GRB_presentation_links.sql index 07abb3fbb8..cbbbf08a91 100644 --- a/migrations/V199__Add_async_GRB_presentation_links.sql +++ b/migrations/V199__Add_async_GRB_presentation_links.sql @@ -38,9 +38,17 @@ CREATE TABLE IF NOT EXISTS system_intake_grb_presentation_links ( presentation_deck_s3_key IS NOT NULL AND presentation_deck_file_name IS NOT NULL ) + ), + CONSTRAINT one_value_present_null_check CHECK ( + recording_link IS NOT NULL OR + transcript_link IS NOT NULL OR + transcript_s3_key IS NOT NULL OR + presentation_deck_s3_key IS NOT NULL ) ); COMMENT ON CONSTRAINT transcript_link_or_doc_null_check ON system_intake_grb_presentation_links IS 'Ensures either a transcript link OR document is inserted and that the file name and s3 key are present if transcript is a document'; COMMENT ON CONSTRAINT presentation_deck_null_check ON system_intake_grb_presentation_links IS 'Ensures presentation deck file name and s3 key are both present or both null'; + +COMMENT ON CONSTRAINT one_value_present_null_check ON system_intake_grb_presentation_links IS 'Ensures at least one presentation link value is inserted in a row to prevent a row of only metadata'; diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go index d44737073a..8f23e78d1d 100644 --- a/pkg/graph/generated/generated.go +++ b/pkg/graph/generated/generated.go @@ -8784,6 +8784,7 @@ type SystemIntakeRequester { """ Represents a single row of presentation link and document data for a system intake's Async GRB review +All data values are optional but there is a constraint to require one data value on insertion """ type SystemIntakeGRBPresentationLinks { systemIntakeID: UUID! @@ -8791,7 +8792,7 @@ type SystemIntakeGRBPresentationLinks { createdAt: Time! modifiedBy: UUID modifiedAt: Time - recordingLink: String! + recordingLink: String recordingPasscode: String transcriptLink: String transcriptFileName: String @@ -8804,10 +8805,11 @@ type SystemIntakeGRBPresentationLinks { """ Data needed to add system intake presentation link data +One of the optional link/files values is required to pass the database constraint """ input SystemIntakeGRBPresentationLinksInput { systemIntakeID: UUID! - recordingLink: String! + recordingLink: String recordingPasscode: String transcriptLink: String transcriptFileData: Upload @@ -47872,14 +47874,11 @@ func (ec *executionContext) _SystemIntakeGRBPresentationLinks_recordingLink(ctx return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } func (ec *executionContext) fieldContext_SystemIntakeGRBPresentationLinks_recordingLink(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { @@ -62700,7 +62699,7 @@ func (ec *executionContext) unmarshalInputSystemIntakeGRBPresentationLinksInput( it.SystemIntakeID = data case "recordingLink": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("recordingLink")) - data, err := ec.unmarshalNString2string(ctx, v) + data, err := ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } @@ -71197,9 +71196,6 @@ func (ec *executionContext) _SystemIntakeGRBPresentationLinks(ctx context.Contex out.Values[i] = ec._SystemIntakeGRBPresentationLinks_modifiedAt(ctx, field, obj) case "recordingLink": out.Values[i] = ec._SystemIntakeGRBPresentationLinks_recordingLink(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&out.Invalids, 1) - } case "recordingPasscode": out.Values[i] = ec._SystemIntakeGRBPresentationLinks_recordingPasscode(ctx, field, obj) case "transcriptLink": diff --git a/pkg/graph/schema.graphql b/pkg/graph/schema.graphql index 24811062b6..f7403f07af 100644 --- a/pkg/graph/schema.graphql +++ b/pkg/graph/schema.graphql @@ -685,6 +685,7 @@ type SystemIntakeRequester { """ Represents a single row of presentation link and document data for a system intake's Async GRB review +All data values are optional but there is a constraint to require one data value on insertion """ type SystemIntakeGRBPresentationLinks { systemIntakeID: UUID! @@ -692,7 +693,7 @@ type SystemIntakeGRBPresentationLinks { createdAt: Time! modifiedBy: UUID modifiedAt: Time - recordingLink: String! + recordingLink: String recordingPasscode: String transcriptLink: String transcriptFileName: String @@ -705,10 +706,11 @@ type SystemIntakeGRBPresentationLinks { """ Data needed to add system intake presentation link data +One of the optional link/files values is required to pass the database constraint """ input SystemIntakeGRBPresentationLinksInput { systemIntakeID: UUID! - recordingLink: String! + recordingLink: String recordingPasscode: String transcriptLink: String transcriptFileData: Upload diff --git a/pkg/graph/schema.resolvers.go b/pkg/graph/schema.resolvers.go index 7eb930a0d9..9204aa8e42 100644 --- a/pkg/graph/schema.resolvers.go +++ b/pkg/graph/schema.resolvers.go @@ -1956,7 +1956,7 @@ func (r *systemIntakeResolver) GrbPresentationLinks(ctx context.Context, obj *mo mockPresentationLinks.SystemIntakeID = uuid.MustParse("5af245bc-fc54-4677-bab1-1b3e798bb43c") mockPresentationLinks.CreatedBy = appcontext.Principal(ctx).Account().ID mockPresentationLinks.CreatedAt = time.Now() - mockPresentationLinks.RecordingLink = "https://google.com" + mockPresentationLinks.RecordingLink = helpers.PointerTo("https://google.com") mockPresentationLinks.RecordingPasscode = helpers.PointerTo("123456") mockPresentationLinks.TranscriptLink = nil mockPresentationLinks.TranscriptFileName = helpers.PointerTo("transcript.doc") diff --git a/pkg/models/models_gen.go b/pkg/models/models_gen.go index d7be9cb308..528e1ea318 100644 --- a/pkg/models/models_gen.go +++ b/pkg/models/models_gen.go @@ -621,9 +621,10 @@ type SystemIntakeFundingSourcesInput struct { } // Data needed to add system intake presentation link data +// One of the optional link/files values is required to pass the database constraint type SystemIntakeGRBPresentationLinksInput struct { SystemIntakeID uuid.UUID `json:"systemIntakeID"` - RecordingLink string `json:"recordingLink"` + RecordingLink *string `json:"recordingLink,omitempty"` RecordingPasscode *string `json:"recordingPasscode,omitempty"` TranscriptLink *string `json:"transcriptLink,omitempty"` TranscriptFileData *graphql.Upload `json:"transcriptFileData,omitempty"` diff --git a/pkg/models/system_intake_grb_presentation_links.go b/pkg/models/system_intake_grb_presentation_links.go index b5cfbcbc3e..cb84147afe 100644 --- a/pkg/models/system_intake_grb_presentation_links.go +++ b/pkg/models/system_intake_grb_presentation_links.go @@ -7,7 +7,7 @@ import ( type SystemIntakeGRBPresentationLinks struct { BaseStructUser SystemIntakeID uuid.UUID `json:"systemIntakeId" db:"system_intake_id"` - RecordingLink string `json:"recordingLink" db:"recording_link"` + RecordingLink *string `json:"recordingLink" db:"recording_link"` RecordingPasscode *string `json:"recordingPasscode" db:"recording_passcode"` TranscriptLink *string `json:"transcriptLink" db:"transcript_link"` TranscriptS3Key *string `db:"transcript_s3_key"` diff --git a/src/gql/gen/graphql.ts b/src/gql/gen/graphql.ts index 30c439561f..bb7b921871 100644 --- a/src/gql/gen/graphql.ts +++ b/src/gql/gen/graphql.ts @@ -2246,7 +2246,10 @@ export type SystemIntakeFundingSourcesInput = { fundingSources: Array; }; -/** Represents a single row of presentation link and document data for a system intake's Async GRB review */ +/** + * Represents a single row of presentation link and document data for a system intake's Async GRB review + * All data values are optional but there is a constraint to require one data value on insertion + */ export type SystemIntakeGRBPresentationLinks = { __typename: 'SystemIntakeGRBPresentationLinks'; createdAt: Scalars['Time']['output']; @@ -2256,7 +2259,7 @@ export type SystemIntakeGRBPresentationLinks = { presentationDeckFileName?: Maybe; presentationDeckFileStatus?: Maybe; presentationDeckFileURL?: Maybe; - recordingLink: Scalars['String']['output']; + recordingLink?: Maybe; recordingPasscode?: Maybe; systemIntakeID: Scalars['UUID']['output']; transcriptFileName?: Maybe; @@ -2265,10 +2268,13 @@ export type SystemIntakeGRBPresentationLinks = { transcriptLink?: Maybe; }; -/** Data needed to add system intake presentation link data */ +/** + * Data needed to add system intake presentation link data + * One of the optional link/files values is required to pass the database constraint + */ export type SystemIntakeGRBPresentationLinksInput = { presentationDeckFileData?: InputMaybe; - recordingLink: Scalars['String']['input']; + recordingLink?: InputMaybe; recordingPasscode?: InputMaybe; systemIntakeID: Scalars['UUID']['input']; transcriptFileData?: InputMaybe; From 166851d36bfc63786a1ccb9f45517fa8d3ad11da Mon Sep 17 00:00:00 2001 From: samoddball <156127704+samoddball@users.noreply.github.com> Date: Wed, 22 Jan 2025 09:35:26 -0700 Subject: [PATCH 6/6] Easi 4528/query links (#2957) * working on dataloaders + storage * app code should be done, working on tests * remove mock code * add quick test to be expanded on later * remove todos --- .../system_intake_grb_presentation_links.go | 1 + pkg/dataloaders/dataloaders.go | 2 ++ .../system_intake_grb_presentation_links.go | 29 +++++++++++++++++++ pkg/graph/schema.resolvers.go | 11 +------ .../system_intake_grb_presentation_links.go | 8 +++++ .../get_by_intake_IDs.sql | 3 ++ .../system_intake_grb_presentation_links.go | 9 ++++-- .../system_intake_grb_presentation_links.go | 14 +++++++++ ...stem_intake_grb_presentation_links_test.go | 20 +++++++++++++ 9 files changed, 85 insertions(+), 12 deletions(-) create mode 100644 cmd/devdata/system_intake_grb_presentation_links.go create mode 100644 pkg/dataloaders/system_intake_grb_presentation_links.go create mode 100644 pkg/sqlqueries/SQL/system_intake_grb_presentation_links/get_by_intake_IDs.sql diff --git a/cmd/devdata/system_intake_grb_presentation_links.go b/cmd/devdata/system_intake_grb_presentation_links.go new file mode 100644 index 0000000000..06ab7d0f9a --- /dev/null +++ b/cmd/devdata/system_intake_grb_presentation_links.go @@ -0,0 +1 @@ +package main diff --git a/pkg/dataloaders/dataloaders.go b/pkg/dataloaders/dataloaders.go index d9ba99d2b4..396681d735 100644 --- a/pkg/dataloaders/dataloaders.go +++ b/pkg/dataloaders/dataloaders.go @@ -79,6 +79,7 @@ type Dataloaders struct { SystemIntakeGovReqFeedback *dataloadgen.Loader[uuid.UUID, []*models.GovernanceRequestFeedback] SystemIntakeGRBReviewers *dataloadgen.Loader[uuid.UUID, []*models.SystemIntakeGRBReviewer] SystemIntakeGRBDiscussionPosts *dataloadgen.Loader[uuid.UUID, []*models.SystemIntakeGRBReviewDiscussionPost] + SystemIntakeGRBPresentationLinks *dataloadgen.Loader[uuid.UUID, *models.SystemIntakeGRBPresentationLinks] SystemIntakeNotes *dataloadgen.Loader[uuid.UUID, []*models.SystemIntakeNote] SystemIntakeRelatedSystemIntakes *dataloadgen.Loader[uuid.UUID, []*models.SystemIntake] SystemIntakeRelatedTRBRequests *dataloadgen.Loader[uuid.UUID, []*models.TRBRequest] @@ -122,6 +123,7 @@ func NewDataloaders(store *storage.Store, fetchUserInfos fetchUserInfosFunc, get SystemIntakeGovReqFeedback: dataloadgen.NewLoader(dr.batchSystemIntakeGovReqFeedbackByIntakeIDs), SystemIntakeGRBReviewers: dataloadgen.NewLoader(dr.batchSystemIntakeGRBReviewersBySystemIntakeIDs), SystemIntakeGRBDiscussionPosts: dataloadgen.NewLoader(dr.batchSystemIntakeGRBDiscussionPostsBySystemIntakeIDs), + SystemIntakeGRBPresentationLinks: dataloadgen.NewLoader(dr.batchSystemIntakeGRBPresentationLinksByIntakeIDs), SystemIntakeNotes: dataloadgen.NewLoader(dr.batchSystemIntakeNotesBySystemIntakeIDs), SystemIntakeRelatedSystemIntakes: dataloadgen.NewLoader(dr.batchRelatedSystemIntakesBySystemIntakeIDs), SystemIntakeRelatedTRBRequests: dataloadgen.NewLoader(dr.batchRelatedTRBRequestsBySystemIntakeIDs), diff --git a/pkg/dataloaders/system_intake_grb_presentation_links.go b/pkg/dataloaders/system_intake_grb_presentation_links.go new file mode 100644 index 0000000000..897f749398 --- /dev/null +++ b/pkg/dataloaders/system_intake_grb_presentation_links.go @@ -0,0 +1,29 @@ +package dataloaders + +import ( + "context" + "errors" + + "github.com/google/uuid" + + "github.com/cms-enterprise/easi-app/pkg/helpers" + "github.com/cms-enterprise/easi-app/pkg/models" +) + +func (d *dataReader) batchSystemIntakeGRBPresentationLinksByIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeGRBPresentationLinks, []error) { + data, err := d.db.SystemIntakeGRBPresentationLinksByIntakeIDs(ctx, systemIntakeIDs) + if err != nil { + return nil, []error{err} + } + + return helpers.OneToOne(systemIntakeIDs, data), nil +} + +func GetSystemIntakeGRBPresentationLinksByIntakeID(ctx context.Context, systemIntakeID uuid.UUID) (*models.SystemIntakeGRBPresentationLinks, error) { + loaders, ok := loadersFromCTX(ctx) + if !ok { + return nil, errors.New("unexpected nil loaders in GetSystemIntakeGRBPresentationLinksByIntakeID") + } + + return loaders.SystemIntakeGRBPresentationLinks.Load(ctx, systemIntakeID) +} diff --git a/pkg/graph/schema.resolvers.go b/pkg/graph/schema.resolvers.go index 9204aa8e42..5d38be8555 100644 --- a/pkg/graph/schema.resolvers.go +++ b/pkg/graph/schema.resolvers.go @@ -1952,16 +1952,7 @@ func (r *systemIntakeResolver) GrbDiscussions(ctx context.Context, obj *models.S // GrbPresentationLinks is the resolver for the grbPresentationLinks field. func (r *systemIntakeResolver) GrbPresentationLinks(ctx context.Context, obj *models.SystemIntake) (*models.SystemIntakeGRBPresentationLinks, error) { - mockPresentationLinks := models.NewSystemIntakeGRBPresentationLinks(appcontext.Principal(ctx).Account().ID) - mockPresentationLinks.SystemIntakeID = uuid.MustParse("5af245bc-fc54-4677-bab1-1b3e798bb43c") - mockPresentationLinks.CreatedBy = appcontext.Principal(ctx).Account().ID - mockPresentationLinks.CreatedAt = time.Now() - mockPresentationLinks.RecordingLink = helpers.PointerTo("https://google.com") - mockPresentationLinks.RecordingPasscode = helpers.PointerTo("123456") - mockPresentationLinks.TranscriptLink = nil - mockPresentationLinks.TranscriptFileName = helpers.PointerTo("transcript.doc") - mockPresentationLinks.PresentationDeckFileName = helpers.PointerTo("presentationDeck.pptx") - return mockPresentationLinks, nil + return dataloaders.GetSystemIntakeGRBPresentationLinksByIntakeID(ctx, obj.ID) } // DocumentType is the resolver for the documentType field. diff --git a/pkg/models/system_intake_grb_presentation_links.go b/pkg/models/system_intake_grb_presentation_links.go index cb84147afe..b90893d99a 100644 --- a/pkg/models/system_intake_grb_presentation_links.go +++ b/pkg/models/system_intake_grb_presentation_links.go @@ -16,6 +16,14 @@ type SystemIntakeGRBPresentationLinks struct { PresentationDeckFileName *string `json:"presentationDeckFileName" db:"presentation_deck_file_name"` } +func (s SystemIntakeGRBPresentationLinks) GetMappingKey() uuid.UUID { + return s.SystemIntakeID +} + +func (s SystemIntakeGRBPresentationLinks) GetMappingVal() *SystemIntakeGRBPresentationLinks { + return &s +} + func NewSystemIntakeGRBPresentationLinks(createdByUserAcctID uuid.UUID) *SystemIntakeGRBPresentationLinks { return &SystemIntakeGRBPresentationLinks{ BaseStructUser: NewBaseStructUser(createdByUserAcctID), diff --git a/pkg/sqlqueries/SQL/system_intake_grb_presentation_links/get_by_intake_IDs.sql b/pkg/sqlqueries/SQL/system_intake_grb_presentation_links/get_by_intake_IDs.sql new file mode 100644 index 0000000000..a3e40aaaf3 --- /dev/null +++ b/pkg/sqlqueries/SQL/system_intake_grb_presentation_links/get_by_intake_IDs.sql @@ -0,0 +1,3 @@ +SELECT * +FROM system_intake_grb_presentation_links +WHERE system_intake_id = ANY(:system_intake_ids); diff --git a/pkg/sqlqueries/system_intake_grb_presentation_links.go b/pkg/sqlqueries/system_intake_grb_presentation_links.go index 48b9a713cb..ef4428ce56 100644 --- a/pkg/sqlqueries/system_intake_grb_presentation_links.go +++ b/pkg/sqlqueries/system_intake_grb_presentation_links.go @@ -7,10 +7,15 @@ import ( //go:embed SQL/system_intake_grb_presentation_links/delete.sql var deleteSystemIntakeGRBPresentationLinksSQL string +//go:embed SQL/system_intake_grb_presentation_links/get_by_intake_IDs.sql +var getSystemIntakeGRBPresentationLinksByIntakeIDsSQL string + var SystemIntakeGRBPresentationLinks = systemIntakeGRBPresentationLinksScripts{ - Delete: deleteSystemIntakeGRBPresentationLinksSQL, + Delete: deleteSystemIntakeGRBPresentationLinksSQL, + GetByIntakeIDs: getSystemIntakeGRBPresentationLinksByIntakeIDsSQL, } type systemIntakeGRBPresentationLinksScripts struct { - Delete string + Delete string + GetByIntakeIDs string } diff --git a/pkg/storage/system_intake_grb_presentation_links.go b/pkg/storage/system_intake_grb_presentation_links.go index 962de257b9..b227f68368 100644 --- a/pkg/storage/system_intake_grb_presentation_links.go +++ b/pkg/storage/system_intake_grb_presentation_links.go @@ -5,12 +5,26 @@ import ( "fmt" "github.com/google/uuid" + "github.com/lib/pq" "go.uber.org/zap" "github.com/cms-enterprise/easi-app/pkg/appcontext" + "github.com/cms-enterprise/easi-app/pkg/models" "github.com/cms-enterprise/easi-app/pkg/sqlqueries" ) +func (s *Store) SystemIntakeGRBPresentationLinksByIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeGRBPresentationLinks, error) { + var links []*models.SystemIntakeGRBPresentationLinks + if err := namedSelect(ctx, s.db, &links, sqlqueries.SystemIntakeGRBPresentationLinks.GetByIntakeIDs, args{ + "system_intake_ids": pq.Array(systemIntakeIDs), + }); err != nil { + appcontext.ZLogger(ctx).Error("failed to fetch system intake GRB presentation links by intake IDs", zap.Error(err)) + return nil, err + } + + return links, nil +} + func (s *Store) DeleteSystemIntakeGRBPresentationLinks(ctx context.Context, systemIntakeID uuid.UUID) error { res, err := namedExec(ctx, s.db, sqlqueries.SystemIntakeGRBPresentationLinks.Delete, args{ "system_intake_id": systemIntakeID, diff --git a/pkg/storage/system_intake_grb_presentation_links_test.go b/pkg/storage/system_intake_grb_presentation_links_test.go index b89c07819e..2da2db9461 100644 --- a/pkg/storage/system_intake_grb_presentation_links_test.go +++ b/pkg/storage/system_intake_grb_presentation_links_test.go @@ -3,11 +3,31 @@ package storage import ( "context" + "github.com/google/uuid" "github.com/guregu/null" "github.com/cms-enterprise/easi-app/pkg/models" ) +func (s *StoreTestSuite) TestSystemIntakeGRBPresentationLinksByIntakeIDs() { + ctx := context.Background() + + euaID := "ABCD" + + intake, err := s.store.CreateSystemIntake(ctx, &models.SystemIntake{ + RequestType: models.SystemIntakeRequestTypeNEW, + EUAUserID: null.StringFrom(euaID), + }) + s.NoError(err) + s.NotNil(intake) + + s.Run("query given intake id", func() { + data, err := s.store.SystemIntakeGRBPresentationLinksByIntakeIDs(ctx, []uuid.UUID{intake.ID}) + s.NoError(err) + s.Len(data, 0) + }) +} + func (s *StoreTestSuite) TestDeleteSystemIntakeGRBPresentationLinks() { ctx := context.Background() euaID := "ABCD"