resolvers

package
v0.0.0-...-64a628e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyChangesAndMetaData

func ApplyChangesAndMetaData(changes map[string]interface{}, bs models.IBaseStruct, principal authentication.Principal) error

ApplyChangesAndMetaData is a hook to call before updating a baseStruct object in the database it will 1. Update the base struct meta data 2. Apply changes from the changes object to the provided IBaseStruct

func BizCaseDraftStatus

func BizCaseDraftStatus(intake *models.SystemIntake) (models.ITGovDraftBusinessCaseStatus, error)

BizCaseDraftStatus calculates the ITGovDraftBusinessCaseStatus for the BizCaseDraft section for the system intake task list for the requester view

func BizCaseFinalStatus

func BizCaseFinalStatus(intake *models.SystemIntake) (models.ITGovFinalBusinessCaseStatus, error)

BizCaseFinalStatus calculates the ITGovFinalBusinessCaseStatus for the BizCaseFinal section for the system intake task list for the requester view

func CalculateSystemIntakeAdminStatus

func CalculateSystemIntakeAdminStatus(intake *models.SystemIntake) (models.SystemIntakeStatusAdmin, error)

CalculateSystemIntakeAdminStatus calculates the status to display in the admin view for a System Intake request, based on the current step, and the state of that step and the overall state

func CalculateSystemIntakeRequesterStatus

func CalculateSystemIntakeRequesterStatus(intake *models.SystemIntake, currentTime time.Time) (models.SystemIntakeStatusRequester, error)

CalculateSystemIntakeRequesterStatus calculates the status to display in the requester view for a System Intake request, based on the intake's current step, the state of that step, and the overall intake state (open/closed)

func CanDeleteDocument

func CanDeleteDocument(ctx context.Context, document *models.SystemIntakeDocument) bool

CanDeleteDocument determines if a user can delete a document

func CanViewDocument

func CanViewDocument(ctx context.Context, grbUsers []*models.SystemIntakeGRBReviewer, document *models.SystemIntakeDocument) bool

CanViewDocument determines if a user can view a document

func CedarSystemLinkedSystemIntakes

func CedarSystemLinkedSystemIntakes(ctx context.Context, cedarSystemID string, state models.SystemIntakeState) ([]*models.SystemIntake, error)

func CedarSystemLinkedTRBRequests

func CedarSystemLinkedTRBRequests(ctx context.Context, cedarSystemID string, state models.TRBRequestState) ([]*models.TRBRequest, error)

func ChangeLCIDRetirementDate

func ChangeLCIDRetirementDate(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeChangeLCIDRetirementDateInput,
) (*models.SystemIntake, error)

ChangeLCIDRetirementDate handles a Change LCID Retirement Date action on an intake as part of Admin Actions v2

func CloseTRBRequest

func CloseTRBRequest(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	fetchUserInfos func(context.Context, []string) ([]*models.UserInfo, error),
	id uuid.UUID,
	reasonClosed models.HTML,
	copyTRBMailbox bool,
	notifyEUAIDs []string,
) (*models.TRBRequest, error)

CloseTRBRequest closes a TRB request and sends an email if recipients are specified

func ConfirmLCID

func ConfirmLCID(ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeConfirmLCIDInput,
) (*models.SystemIntake, error)

ConfirmLCID is used to confirm the choices of an already issued LCID. All fields are required, and should come back pre-populated by the front end with the previous answer

func CreateSystemIntake

func CreateSystemIntake(
	ctx context.Context,
	store *storage.Store,
	input models.CreateSystemIntakeInput,
) (*models.SystemIntake, error)

CreateSystemIntake creates a system intake.

func CreateSystemIntakeActionCloseRequest

func CreateSystemIntakeActionCloseRequest(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeCloseRequestInput,
) (*models.SystemIntake, error)

CreateSystemIntakeActionCloseRequest closes an intake request

func CreateSystemIntakeActionNotITGovRequest

func CreateSystemIntakeActionNotITGovRequest(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeNotITGovReqInput,
) (*models.SystemIntake, error)

CreateSystemIntakeActionNotITGovRequest marks a request as closed, sets a decision of not an IT Gov req, and progress the step to decision

func CreateSystemIntakeActionReopenRequest

func CreateSystemIntakeActionReopenRequest(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeReopenRequestInput,
) (*models.SystemIntake, error)

CreateSystemIntakeActionReopenRequest reopens an intake request

func CreateSystemIntakeActionRequestEdits

func CreateSystemIntakeActionRequestEdits(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeRequestEditsInput,
) (*models.SystemIntake, error)

CreateSystemIntakeActionRequestEdits creates a new action to request edits on an intake form as part of Admin Actions v2

func CreateSystemIntakeContact

CreateSystemIntakeContact creates a system intake's contact info.

func CreateSystemIntakeDocument

func CreateSystemIntakeDocument(
	ctx context.Context,
	store *storage.Store,
	s3Client *upload.S3Client,
	emailClient *email.Client,
	input models.CreateSystemIntakeDocumentInput,
) (*models.SystemIntakeDocument, error)

CreateSystemIntakeDocument uploads a document to S3, then saves its metadata to our database.

func CreateSystemIntakeGRBReviewers

func CreateSystemIntakeGRBReviewers(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUsers userhelpers.GetAccountInfosFunc,
	input *models.CreateSystemIntakeGRBReviewersInput,
) (*models.CreateSystemIntakeGRBReviewersPayload, error)

CreateSystemIntakeGRBReviewers creates GRB Reviewers for a System Intake

func CreateSystemIntakeNote

func CreateSystemIntakeNote(
	ctx context.Context,
	store *storage.Store,
	input models.CreateSystemIntakeNoteInput,
) (*models.SystemIntakeNote, error)

CreateSystemIntakeNote creates a system intake note.

func CreateTRBGuidanceLetter

func CreateTRBGuidanceLetter(ctx context.Context, store *storage.Store, trbRequestID uuid.UUID) (*models.TRBGuidanceLetter, error)

CreateTRBGuidanceLetter creates a guidance letter for a TRB request, in the "In Progress" status, when the guidance letter is ready to be worked on.

func CreateTRBGuidanceLetterRecommendation

func CreateTRBGuidanceLetterRecommendation(
	ctx context.Context,
	store *storage.Store,
	recommendation *models.TRBGuidanceLetterRecommendation,
) (*models.TRBGuidanceLetterRecommendation, error)

CreateTRBGuidanceLetterRecommendation creates a TRBGuidanceLetterRecommendation in the database

func CreateTRBLeadOption

func CreateTRBLeadOption(
	ctx context.Context,
	store *storage.Store,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	euaID string,
) (*models.UserInfo, error)

CreateTRBLeadOption creates a TRBLeadOption in the database and returns the user info for the created lead option

func CreateTRBRequest

func CreateTRBRequest(
	ctx context.Context,
	requestType models.TRBRequestType,
	store *storage.Store,
) (*models.TRBRequest, error)

CreateTRBRequest makes a new TRB request

func CreateTRBRequestAttendee

func CreateTRBRequestAttendee(
	ctx context.Context,
	store *storage.Store,
	sendTRBAttendeeAddedNotification func(
		ctx context.Context,
		attendeeEmail models.EmailAddress,
		requestName string,
		requesterName string,
	) error,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	attendee *models.TRBRequestAttendee,
) (*models.TRBRequestAttendee, error)

CreateTRBRequestAttendee creates a TRBRequestAttendee in the database

func CreateTRBRequestDocument

func CreateTRBRequestDocument(ctx context.Context, store *storage.Store, s3Client *upload.S3Client, input models.CreateTRBRequestDocumentInput) (*models.TRBRequestDocument, error)

CreateTRBRequestDocument uploads a document to S3, then saves its metadata to our database.

func CreateTRBRequestFeedback

func CreateTRBRequestFeedback(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	fetchUserInfos func(context.Context, []string) ([]*models.UserInfo, error),
	feedback *models.TRBRequestFeedback,
) (*models.TRBRequestFeedback, error)

CreateTRBRequestFeedback creates a TRBRequestFeedback in the database

func DecisionAndNextStepsStatus

func DecisionAndNextStepsStatus(intake *models.SystemIntake) (models.ITGovDecisionStatus, error)

DecisionAndNextStepsStatus calculates the ITGovDecisionStatus for the Decisions section for the system intake task list for the requester view

func DeleteSystemIntakeDocument

func DeleteSystemIntakeDocument(ctx context.Context, store *storage.Store, id uuid.UUID) (*models.SystemIntakeDocument, error)

DeleteSystemIntakeDocument deletes an existing SystemIntakeDocument, given its ID.

Does *not* delete the uploaded file from S3, following the example of TRB request documents.

func DeleteSystemIntakeGRBReviewer

func DeleteSystemIntakeGRBReviewer(
	ctx context.Context,
	store *storage.Store,
	reviewerID uuid.UUID,
) error

func DeleteTRBGuidanceLetterRecommendation

func DeleteTRBGuidanceLetterRecommendation(
	ctx context.Context,
	store *storage.Store,
	id uuid.UUID,
) (*models.TRBGuidanceLetterRecommendation, error)

DeleteTRBGuidanceLetterRecommendation deletes a TRBGuidanceLetterRecommendation record from the database

func DeleteTRBLeadOption

func DeleteTRBLeadOption(ctx context.Context, store *storage.Store, euaID string) (bool, error)

DeleteTRBLeadOption deletes a TRBLeadOption record from the database

func DeleteTRBRequestAttendee

func DeleteTRBRequestAttendee(ctx context.Context, store *storage.Store, id uuid.UUID) (*models.TRBRequestAttendee, error)

DeleteTRBRequestAttendee deletes a TRBRequestAttendee record from the database

func DeleteTRBRequestDocument

func DeleteTRBRequestDocument(ctx context.Context, store *storage.Store, id uuid.UUID) (*models.TRBRequestDocument, error)

DeleteTRBRequestDocument deletes an existing TRBRequestDocument, given its ID.

Does *not* delete the uploaded file from S3.

func DeleteTRBRequestFundingSources

func DeleteTRBRequestFundingSources(
	ctx context.Context,
	store *storage.Store,
	trbRequestID uuid.UUID,
	fundingNumber string,
) ([]*models.TRBFundingSource, error)

DeleteTRBRequestFundingSources deletes funding sources for a TRB request form by TRB request ID and funding number

func ExpireLCID

func ExpireLCID(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeExpireLCIDInput,
) (*models.SystemIntake, error)

ExpireLCID handles an Expire LCID action on an intake as part of Admin Actions v2

func FeedbackFromInitialReviewStatus

func FeedbackFromInitialReviewStatus(intake *models.SystemIntake) (models.ITGovFeedbackStatus, error)

FeedbackFromInitialReviewStatus calculates the ITGovTaskListStatus for the feedback section of a system intake task list for the requester view

func GetCedarSystemIsBookmarked

func GetCedarSystemIsBookmarked(ctx context.Context, cedarSystemID string) (bool, error)

func GetGovernanceRequestFeedbackAuthor

func GetGovernanceRequestFeedbackAuthor(
	ctx context.Context,
	feedbackAuthorEUAID *string,
) (*models.UserInfo, error)

GetGovernanceRequestFeedbackAuthor returns the full user info for a feedback item's author nil values for feedbackAuthorEUAID are allowed and will return a nil *models.UserInfo

func GetGovernanceRequestFeedbacksByIntakeID

func GetGovernanceRequestFeedbacksByIntakeID(ctx context.Context, id uuid.UUID) ([]*models.GovernanceRequestFeedback, error)

GetGovernanceRequestFeedbacksByIntakeID returns all governance request feedback items for a given system intake

func GetLifecycleCostLinesByBusinessCaseID

func GetLifecycleCostLinesByBusinessCaseID(ctx context.Context, businessCaseID uuid.UUID) ([]*models.EstimatedLifecycleCost, error)

func GetMySystemIntakes

func GetMySystemIntakes(ctx context.Context, store *storage.Store) ([]*models.SystemIntake, error)

func GetMyTRBRequests

func GetMyTRBRequests(ctx context.Context, store *storage.Store, archived bool) ([]*models.TRBRequest, error)

GetMyTRBRequests returns all TRB Requests that belong to the principal in the context

func GetStatusForSystemIntakeDocument

func GetStatusForSystemIntakeDocument(s3Client *upload.S3Client, s3Key string) (models.SystemIntakeDocumentStatus, error)

GetStatusForSystemIntakeDocument queries S3 for the virus-scanning status of a document with the given s3Key

func GetStatusForTRBRequestDocument

func GetStatusForTRBRequestDocument(s3Client *upload.S3Client, s3Key string) (models.TRBRequestDocumentStatus, error)

GetStatusForTRBRequestDocument queries S3 for the virus-scanning status of a document with the given s3Key

func GetSystemIntakeDocumentsByRequestID

func GetSystemIntakeDocumentsByRequestID(ctx context.Context, id uuid.UUID) ([]*models.SystemIntakeDocument, error)

GetSystemIntakeDocumentsByRequestID fetches all documents attached to the system intake with the given ID.

func GetTRBAdminNoteByID

func GetTRBAdminNoteByID(ctx context.Context, store *storage.Store, id uuid.UUID) (*models.TRBAdminNote, error)

GetTRBAdminNoteByID retrieves a single admin note by its ID

func GetTRBAdminNoteCategorySpecificData

func GetTRBAdminNoteCategorySpecificData(ctx context.Context, store *storage.Store, note *models.TRBAdminNote) (models.TRBAdminNoteCategorySpecificData, error)

GetTRBAdminNoteCategorySpecificData returns the category-specific data for TRB admin notes that can be loaded from the database; fields that require querying other data sources (such as documents' Status and URL fields, which require querying S3) are handled by other resolvers if they're requested

func GetTRBAdminNotesByTRBRequestID

func GetTRBAdminNotesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBAdminNote, error)

GetTRBAdminNotesByTRBRequestID retrieves a list of admin notes associated with a TRB request

func GetTRBAttendeeComponent

func GetTRBAttendeeComponent(ctx context.Context, euaID *string, trbRequestID uuid.UUID) (*string, error)

GetTRBAttendeeComponent retrieves the component of a TRB user from the TRB attendees table

func GetTRBFundingSourcesByRequestID

func GetTRBFundingSourcesByRequestID(ctx context.Context, id uuid.UUID) ([]*models.TRBFundingSource, error)

GetTRBFundingSourcesByRequestID retrieves funding sources for a TRB request form by TRB request ID

func GetTRBGuidanceLetterByTRBRequestID

func GetTRBGuidanceLetterByTRBRequestID(ctx context.Context, id uuid.UUID) (*models.TRBGuidanceLetter, error)

GetTRBGuidanceLetterByTRBRequestID fetches a TRB guidance letter record by its associated request's ID.

func GetTRBGuidanceLetterRecommendationsByTRBRequestID

func GetTRBGuidanceLetterRecommendationsByTRBRequestID(ctx context.Context, store *storage.Store, id uuid.UUID) ([]*models.TRBGuidanceLetterRecommendation, error)

GetTRBGuidanceLetterRecommendationsByTRBRequestID retrieves TRB request guidance letter recommendations records for a given TRB request ID, ordering them in the user-specified positions

func GetTRBLeadInfo

func GetTRBLeadInfo(ctx context.Context, trbLead *string) (*models.UserInfo, error)

GetTRBLeadInfo retrieves the user info of a TRB request's lead

func GetTRBLeadOptions

func GetTRBLeadOptions(
	ctx context.Context,
	store *storage.Store,
	fetchUserInfos func(context.Context, []string) ([]*models.UserInfo, error),
) ([]*models.UserInfo, error)

GetTRBLeadOptions retrieves TRB options from the database and returns EUA user info for each lead option

func GetTRBRequestAttendeesByTRBRequestID

func GetTRBRequestAttendeesByTRBRequestID(ctx context.Context, id uuid.UUID) ([]*models.TRBRequestAttendee, error)

GetTRBRequestAttendeesByTRBRequestID retrieves a list of attendees associated with a TRB request

func GetTRBRequestByID

func GetTRBRequestByID(ctx context.Context, store *storage.Store, id uuid.UUID) (*models.TRBRequest, error)

GetTRBRequestByID returns a TRB request by it's ID

func GetTRBRequestDocumentsByRequestID

func GetTRBRequestDocumentsByRequestID(ctx context.Context, id uuid.UUID) ([]*models.TRBRequestDocument, error)

GetTRBRequestDocumentsByRequestID fetches all documents attached to the TRB request with the given ID.

func GetTRBRequestFeedbackByTRBRequestID

func GetTRBRequestFeedbackByTRBRequestID(ctx context.Context, id uuid.UUID) ([]*models.TRBRequestFeedback, error)

GetTRBRequestFeedbackByTRBRequestID retrieves TRB request feedback records for a given TRB request ID

func GetTRBRequestFormByTRBRequestID

func GetTRBRequestFormByTRBRequestID(ctx context.Context, id uuid.UUID) (*models.TRBRequestForm, error)

GetTRBRequestFormByTRBRequestID retrieves a TRB request form record for a given TRB request ID

func GetTRBRequestFormSystemIntakesByTRBRequestID

func GetTRBRequestFormSystemIntakesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.SystemIntake, error)

GetTRBRequestFormSystemIntakesByTRBRequestID retrieves all SystemIntakes that have been associated with a TRB request

func GetTRBRequestStatus

func GetTRBRequestStatus(ctx context.Context, trbRequest models.TRBRequest) (models.TRBRequestStatus, error)

GetTRBRequestStatus calculates the overall status of the TRB request

func GetTRBRequesterInfo

func GetTRBRequesterInfo(ctx context.Context, requesterEUA string) (*models.UserInfo, error)

GetTRBRequesterInfo retrieves the user info of a TRB request's requester

func GetTRBRequests

func GetTRBRequests(ctx context.Context, store *storage.Store, archived bool) ([]*models.TRBRequest, error)

GetTRBRequests returns all TRB Requests

func GetTRBTaskStatuses

func GetTRBTaskStatuses(ctx context.Context, trbRequest models.TRBRequest) (*models.TRBTaskStatuses, error)

GetTRBTaskStatuses retrieves all of the statuses for the steps of a given TRB request's task list

func GetURLForSystemIntakeDocument

func GetURLForSystemIntakeDocument(ctx context.Context, store *storage.Store, s3Client *upload.S3Client, s3Key string) (*string, error)

GetURLForSystemIntakeDocument queries S3 for a presigned URL that can be used to fetch the document with the given s3Key

func GetURLForTRBRequestDocument

func GetURLForTRBRequestDocument(s3Client *upload.S3Client, s3Key string) (string, error)

GetURLForTRBRequestDocument queries S3 for a presigned URL that can be used to fetch the document with the given s3Key

func GetUserAccountByID

func GetUserAccountByID(ctx context.Context, id uuid.UUID) (*authentication.UserAccount, error)

GetUserAccountByID returns a user account by its internal ID, utilizing a dataloader

func GrbMeetingStatus

func GrbMeetingStatus(intake *models.SystemIntake) (models.ITGovGRBStatus, error)

GrbMeetingStatus calculates the ITGovGRBStatus for the GrbMeeting section for the system intake task list for the requester view

func GrtMeetingStatus

func GrtMeetingStatus(intake *models.SystemIntake) (models.ITGovGRTStatus, error)

GrtMeetingStatus calculates the ITGovGRTStatus for the GrtMeeting section for the system intake task list for the requester view

func IntakeFormStatus

func IntakeFormStatus(intake *models.SystemIntake) (models.ITGovIntakeFormStatus, error)

IntakeFormStatus calculates the ITGovTaskListStatus of a system intake for the requester view

func IsRecentTRBRequest

func IsRecentTRBRequest(ctx context.Context, obj *models.TRBRequest, now time.Time) bool

IsRecentTRBRequest determines if a TRB Request should be determined to be flagged as "recent" or not.

func IssueLCID

func IssueLCID(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeIssueLCIDInput,
) (*models.SystemIntake, error)

IssueLCID handles an Issue LCID action on an intake as part of Admin Actions v2

func ProgressIntake

func ProgressIntake(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeProgressToNewStepsInput,
) (*models.SystemIntake, error)

ProgressIntake handles a Progress to New Step action on an intake as part of Admin Actions v2

func RejectIntakeAsNotApproved

func RejectIntakeAsNotApproved(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeRejectIntakeInput,
) (*models.SystemIntake, error)

RejectIntakeAsNotApproved handles a Not Approved by GRB action on an intake as part of Admin Actions v2

func ReopenTRBRequest

func ReopenTRBRequest(
	ctx context.Context,
	store *storage.Store,
	id uuid.UUID,
	reasonReopened models.HTML,
	copyTRBMailbox bool,
	notifyEUAIDs []string,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	fetchUserInfos func(context.Context, []string) ([]*models.UserInfo, error),
) (*models.TRBRequest, error)

ReopenTRBRequest re-opens a TRB request and sends an email to the requester and attendees

func RequestReviewForTRBGuidanceLetter

func RequestReviewForTRBGuidanceLetter(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	id uuid.UUID,
) (*models.TRBGuidanceLetter, error)

RequestReviewForTRBGuidanceLetter sets a TRB guidance letter as ready for review and notifies the given recipients.

func RetireLCID

func RetireLCID(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeRetireLCIDInput,
) (*models.SystemIntake, error)

RetireLCID handles a Retire LCID action on an intake as part of Admin Actions v2

func SendTRBGuidanceLetter

func SendTRBGuidanceLetter(ctx context.Context,
	store *storage.Store,
	id uuid.UUID,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	fetchUserInfos func(context.Context, []string) ([]*models.UserInfo, error),
	copyTRBMailbox bool,
	notifyEUAIDs []string,
) (*models.TRBGuidanceLetter, error)

SendTRBGuidanceLetter sends a TRB guidance letter, setting its DateSent field, and (TODO) notifies the given recipients.

func SetRolesForUserOnCEDARSystem

func SetRolesForUserOnCEDARSystem(
	ctx context.Context,
	fetchUserInfos func(context.Context, []string) ([]*models.UserInfo, error),
	cedarCoreClient *cedarcore.Client,
	emailClient *email.Client,
	input models.SetRolesForUserOnSystemInput,
) (*string, error)

func SetSystemIntakeRelationExistingService

func SetSystemIntakeRelationExistingService(
	ctx context.Context,
	store *storage.Store,
	input *models.SetSystemIntakeRelationExistingServiceInput,
) (*models.SystemIntake, error)

SetSystemIntakeRelationExistingService sets the relationship between a system intake and an existing service by setting a free-text contract/service name, clearing relationships between intakes and CEDAR systems, and setting any contract number relationships

func SetSystemIntakeRelationExistingSystem

func SetSystemIntakeRelationExistingSystem(
	ctx context.Context,
	store *storage.Store,
	getCedarSystem func(ctx context.Context, systemID string) (*models.CedarSystem, error),
	input *models.SetSystemIntakeRelationExistingSystemInput,
) (*models.SystemIntake, error)

SetSystemIntakeRelationExistingSystem sets the relationship between a system intake and a list of CEDAR Systems by setting an array of CEDAR System IDs, clearing any data about contract/service names, and setting any contract number relationships.

func SetSystemIntakeRelationNewSystem

func SetSystemIntakeRelationNewSystem(
	ctx context.Context,
	store *storage.Store,
	input *models.SetSystemIntakeRelationNewSystemInput,
) (*models.SystemIntake, error)

SetSystemIntakeRelationNewSystem effectively clears the relationship between a system intake and any previously set list of CEDAR Systems and contract/service names. It also sets any contract number relationships.

func SetTRBAdminNoteArchived

func SetTRBAdminNoteArchived(ctx context.Context, store *storage.Store, id uuid.UUID, isArchived bool) (*models.TRBAdminNote, error)

SetTRBAdminNoteArchived sets whether a TRB admin note is archived (soft-deleted)

func SetTRBRequestRelationExistingService

func SetTRBRequestRelationExistingService(
	ctx context.Context,
	store *storage.Store,
	input models.SetTRBRequestRelationExistingServiceInput,
) (*models.TRBRequest, error)

SetTRBRequestRelationExistingService sets the relationship between a TRB Request and an existing service by setting a free-text contract/service name, clearing relationships between TRB Requests and CEDAR systems, and setting any contract number relationships

func SetTRBRequestRelationExistingSystem

func SetTRBRequestRelationExistingSystem(
	ctx context.Context,
	store *storage.Store,
	getCedarSystem func(ctx context.Context, systemID string) (*models.CedarSystem, error),
	input models.SetTRBRequestRelationExistingSystemInput,
) (*models.TRBRequest, error)

SetTRBRequestRelationExistingSystem sets the relationship between a TRB Request and a list of CEDAR systems by setting an array of CEDAR system IDs, clearing any data about contract/service names, and setting any contract number relationships

func SetTRBRequestRelationNewSystem

func SetTRBRequestRelationNewSystem(
	ctx context.Context,
	store *storage.Store,
	input models.SetTRBRequestRelationNewSystemInput,
) (*models.TRBRequest, error)

SetTRBRequestRelationNewSystem effectively clears the relationship between a TRB Request and any previously set list of CEDAR systems and contract/service names. It also sets any contract number relationships

func StartGRBReview

func StartGRBReview(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	intakeID uuid.UUID,
) (*string, error)

func SubmitIntake

func SubmitIntake(
	ctx context.Context,
	store *storage.Store,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	submitIntake func(context.Context, *models.SystemIntake, *models.Action) error,
	input models.SubmitIntakeInput,
) (*models.UpdateSystemIntakePayload, error)

SubmitIntake is the resolver to submit the initial request form of a system intake

func SystemIntakeCompareGRBReviewers

func SystemIntakeCompareGRBReviewers(
	ctx context.Context,
	store *storage.Store,
	intakeID uuid.UUID,
) ([]*models.GRBReviewerComparisonIntake, error)

func SystemIntakeContractNumbers

func SystemIntakeContractNumbers(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeContractNumber, error)

SystemIntakeContractNumbers utilizes a dataloader to retrieve contract numbers linked to a given system intake ID

func SystemIntakeGRBReviewers

func SystemIntakeGRBReviewers(
	ctx context.Context,
	intakeID uuid.UUID,
) ([]*models.SystemIntakeGRBReviewer, error)

func SystemIntakeLastMeetingDate

func SystemIntakeLastMeetingDate(ctx context.Context, obj *models.SystemIntake, now time.Time) *time.Time

func SystemIntakeNextMeetingDate

func SystemIntakeNextMeetingDate(ctx context.Context, obj *models.SystemIntake, now time.Time) *time.Time

func SystemIntakeNoteAuthor

func SystemIntakeNoteAuthor(obj *models.SystemIntakeNote) (*models.SystemIntakeNoteAuthor, error)

SystemIntakeNoteAuthor returns the system intake note author

func SystemIntakeNoteEditor

func SystemIntakeNoteEditor(ctx context.Context, obj *models.SystemIntakeNote) (*models.UserInfo, error)

SystemIntakeNoteEditor returns the system intake note editor

func SystemIntakeNotes

func SystemIntakeNotes(
	ctx context.Context,
	obj *models.SystemIntake,
) ([]*models.SystemIntakeNote, error)

SystemIntakeNotes fetches notes by System Intake ID

func SystemIntakeRelatedSystemIntakes

func SystemIntakeRelatedSystemIntakes(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntake, error)

SystemIntakeRelatedSystemIntakes gets related intakes by intake ID

func SystemIntakeRelatedTRBRequests

func SystemIntakeRelatedTRBRequests(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.TRBRequest, error)

SystemIntakeRelatedTRBRequests gets related TRB Requests by intake ID

func SystemIntakeSystems

func SystemIntakeSystems(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.CedarSystem, error)

SystemIntakeSystems utilizes dataloaders to retrieve systems linked to a given system intake ID

func SystemIntakeUpdate

SystemIntakeUpdate takes a UpdateSystemIntakeRequestDetailsInput struct and updates the database with the provided information. It also updates the request form state to show in progress, unless the state was EDITS_REQUESTED

func SystemIntakeUpdateContactDetails

func SystemIntakeUpdateContactDetails(ctx context.Context, store *storage.Store, input models.UpdateSystemIntakeContactDetailsInput) (*models.UpdateSystemIntakePayload, error)

SystemIntakeUpdateContactDetails updates the various contacts requested from the input. It also updates the request form state to show in progress, unless the state was EDITS_REQUESTED

func SystemIntakeUpdateContractDetails

func SystemIntakeUpdateContractDetails(ctx context.Context, store *storage.Store, input models.UpdateSystemIntakeContractDetailsInput) (*models.UpdateSystemIntakePayload, error)

SystemIntakeUpdateContractDetails updates specific contract information about a system intake It also updates the request form state to show in progress, unless the state was EDITS_REQUESTED

func SystemIntakes

func SystemIntakes(ctx context.Context, store *storage.Store, openRequests bool) ([]*models.SystemIntake, error)

SystemIntakes returns a list of System Intakes for the admin table (which is why it uses the FetchSystemIntakesByStateForAdmins store method)

func SystemIntakesWithReviewRequested

func SystemIntakesWithReviewRequested(ctx context.Context, store *storage.Store) ([]*models.SystemIntake, error)

func TRBRequestContractNumbers

func TRBRequestContractNumbers(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequestContractNumber, error)

TRBRequestContractNumbers utilizes a dataloader to retrieve contract numbers linked to a given TRB Request ID

func TRBRequestLastMeetingDate

func TRBRequestLastMeetingDate(ctx context.Context, obj *models.TRBRequest, now time.Time) *time.Time

func TRBRequestNextMeetingDate

func TRBRequestNextMeetingDate(ctx context.Context, obj *models.TRBRequest, now time.Time) *time.Time

func TRBRequestRelatedSystemIntakes

func TRBRequestRelatedSystemIntakes(ctx context.Context, trbRequestID uuid.UUID) ([]*models.SystemIntake, error)

TRBRequestRelatedSystemIntakes gets related System Intakes by TRB Request ID

func TRBRequestRelatedTRBRequests

func TRBRequestRelatedTRBRequests(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequest, error)

TRBRequestRelatedTRBRequests gets related TRB Requests by TRB Request ID

func TRBRequestSystems

func TRBRequestSystems(ctx context.Context, trbRequestID uuid.UUID) ([]*models.CedarSystem, error)

TRBRequestSystems utilizes dataloaders to retrieve systems linked to a given trb request ID

func UnlinkSystemIntakeRelation

func UnlinkSystemIntakeRelation(
	ctx context.Context,
	store *storage.Store,
	intakeID uuid.UUID,
) (*models.SystemIntake, error)

UnlinkSystemIntakeRelation clears all the relationship information on a system intake. This includes clearing the system relation type, contract name, contract number relationships, and CEDAR system relationships (TODO).

func UnlinkTRBRequestRelation

func UnlinkTRBRequestRelation(
	ctx context.Context,
	store *storage.Store,
	trbRequestID uuid.UUID,
) (*models.TRBRequest, error)

UnlinkTRBRequestRelation clears all the relationship information on a TRB Request This includes clearing the system relation type, contract name, contract number relationships, and CEDAR system relationships

func UnretireLCID

func UnretireLCID(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeUnretireLCIDInput,
) (*models.SystemIntake, error)

UnretireLCID handles an Unretire LCID action on an intake as part of Admin Actions v2

func UpdateLCID

func UpdateLCID(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.SystemIntakeUpdateLCIDInput,
) (*models.SystemIntake, error)

UpdateLCID is used to update the LCID on a system intake.

func UpdateSystemIntakeContact

UpdateSystemIntakeContact updates a system intake's contact info.

func UpdateSystemIntakeNote

func UpdateSystemIntakeNote(
	ctx context.Context,
	store *storage.Store,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input models.UpdateSystemIntakeNoteInput,
) (*models.SystemIntakeNote, error)

UpdateSystemIntakeNote updates a system intake note.

func UpdateSystemIntakeRequestType

func UpdateSystemIntakeRequestType(ctx context.Context, store *storage.Store, systemIntakeID uuid.UUID, newType models.SystemIntakeRequestType) (*models.SystemIntake, error)

UpdateSystemIntakeRequestType updates a system intake's request type and returns the updated intake. It will return an error if the intake is not found by the ID, or the update fails for any reason.

func UpdateTRBGuidanceLetter

func UpdateTRBGuidanceLetter(ctx context.Context, store *storage.Store, input map[string]interface{}) (*models.TRBGuidanceLetter, error)

UpdateTRBGuidanceLetter handles general updates to a TRB guidance letter

func UpdateTRBGuidanceLetterRecommendation

func UpdateTRBGuidanceLetterRecommendation(ctx context.Context, store *storage.Store, changes map[string]interface{}) (*models.TRBGuidanceLetterRecommendation, error)

UpdateTRBGuidanceLetterRecommendation updates a TRBGuidanceLetterRecommendation record in the database

func UpdateTRBGuidanceLetterRecommendationOrder

func UpdateTRBGuidanceLetterRecommendationOrder(
	ctx context.Context,
	store *storage.Store,
	input models.UpdateTRBGuidanceLetterRecommendationOrderInput,
) ([]*models.TRBGuidanceLetterRecommendation, error)

UpdateTRBGuidanceLetterRecommendationOrder updates the order that TRB guidance letter recommendations are displayed in

func UpdateTRBRequest

func UpdateTRBRequest(ctx context.Context, id uuid.UUID, changes map[string]interface{}, store *storage.Store) (*models.TRBRequest, error)

UpdateTRBRequest updates a TRB request

func UpdateTRBRequestAttendee

func UpdateTRBRequestAttendee(ctx context.Context, store *storage.Store, attendee *models.TRBRequestAttendee) (*models.TRBRequestAttendee, error)

UpdateTRBRequestAttendee updates a TRBRequestAttendee record in the database

func UpdateTRBRequestConsultMeetingTime

func UpdateTRBRequestConsultMeetingTime(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	fetchUserInfos func(context.Context, []string) ([]*models.UserInfo, error),
	id uuid.UUID,
	meetingTime time.Time,
	copyTRBMailbox bool,
	notifyEUAIDs []string,
	notes string,
) (*models.TRBRequest, error)

UpdateTRBRequestConsultMeetingTime sets the TRB consult meeting time and sends the related emails

func UpdateTRBRequestForm

func UpdateTRBRequestForm(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input map[string]interface{},
) (*models.TRBRequestForm, error)

UpdateTRBRequestForm updates a TRBRequestForm record in the database

func UpdateTRBRequestFundingSources

func UpdateTRBRequestFundingSources(
	ctx context.Context,
	store *storage.Store,
	trbRequestID uuid.UUID,
	fundingNumber string,
	sources []string,
) ([]*models.TRBFundingSource, error)

UpdateTRBRequestFundingSources upserts funding sources for a TRB request form by TRB request ID and funding number

func UpdateTRBRequestTRBLead

func UpdateTRBRequestTRBLead(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	id uuid.UUID,
	trbLead string,
) (*models.TRBRequest, error)

UpdateTRBRequestTRBLead sets the TRB lead and sends the related emails

func UserAccountGetByUsername

func UserAccountGetByUsername(ctx context.Context, store *storage.Store, np sqlutils.NamedPreparer, userName string) (*authentication.UserAccount, error)

UserAccountGetByUsername returns a user account by it's userName

Types

This section is empty.

Directories

Path Synopsis
itgovactions
systemintake
trb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL