resolvers

package
v0.0.0-...-b3f093e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 30 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 ChangeLCIDRetirementDate

func ChangeLCIDRetirementDate(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input model.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 model.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 model.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 model.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 model.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 model.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 model.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, input model.CreateSystemIntakeDocumentInput) (*models.SystemIntakeDocument, error)

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

func CreateSystemIntakeNote

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

CreateSystemIntakeNote creates a system intake note.

func CreateTRBAdviceLetter

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

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

func CreateTRBAdviceLetterRecommendation

func CreateTRBAdviceLetterRecommendation(
	ctx context.Context,
	store *storage.Store,
	recommendation *models.TRBAdviceLetterRecommendation,
) (*models.TRBAdviceLetterRecommendation, error)

CreateTRBAdviceLetterRecommendation creates a TRBAdviceLetterRecommendation 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 model.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 SystemIntakeDocumet, given its ID.

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

func DeleteTRBAdviceLetterRecommendation

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

DeleteTRBAdviceLetterRecommendation deletes a TRBAdviceLetterRecommendation 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 model.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 GetFundingSourcesByRequestID

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

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

func GetGovernanceRequestFeedbackAuthor

func GetGovernanceRequestFeedbackAuthor(
	ctx context.Context,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	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, store *storage.Store, id uuid.UUID) ([]*models.GovernanceRequestFeedback, error)

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

func GetMyTRBRequests

func GetMyTRBRequests(ctx context.Context, archived bool, store *storage.Store) ([]*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, store *storage.Store, s3Client *upload.S3Client, 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) (model.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, store *storage.Store, trbRequestID uuid.UUID) ([]*models.TRBAdminNote, error)

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

func GetTRBAdviceLetterByTRBRequestID

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

GetTRBAdviceLetterByTRBRequestID fetches a TRB advice letter record by its associated request's ID.

func GetTRBAdviceLetterRecommendationsByTRBRequestID

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

GetTRBAdviceLetterRecommendationsByTRBRequestID retrieves TRB request advice 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, store *storage.Store, id uuid.UUID) ([]*models.TRBRequestAttendee, error)

GetTRBRequestAttendeesByTRBRequestID retrieves a list of attendees associated with a TRB request

func GetTRBRequestByID

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

GetTRBRequestByID returns a TRB request by it's ID

func GetTRBRequestDocumentsByRequestID

func GetTRBRequestDocumentsByRequestID(ctx context.Context, store *storage.Store, s3Client *upload.S3Client, 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, store *storage.Store, 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, store *storage.Store, id uuid.UUID) (*models.TRBRequestForm, error)

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

func GetTRBRequestStatus

func GetTRBRequestStatus(ctx context.Context, store *storage.Store, trbRequest models.TRBRequest) (models.TRBRequestStatus, error)

GetTRBRequestStatus calculates the overall status of the TRB request

func GetTRBRequestSystemIntakesByTRBRequestID

func GetTRBRequestSystemIntakesByTRBRequestID(ctx context.Context, store *storage.Store, trbRequestID uuid.UUID) ([]*models.SystemIntake, error)

GetTRBRequestSystemIntakesByTRBRequestID retrieves all SystemIntakes that have been associated with a 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, archived bool, store *storage.Store) ([]*models.TRBRequest, error)

GetTRBRequests returns all TRB Requests

func GetTRBTaskStatuses

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

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

func GetTRBUserComponent

func GetTRBUserComponent(ctx context.Context, store *storage.Store, euaID *string, trbRequestID uuid.UUID) (*string, error)

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

func GetURLForSystemIntakeDocument

func GetURLForSystemIntakeDocument(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 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 model.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 model.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 model.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 RequestReviewForTRBAdviceLetter

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

RequestReviewForTRBAdviceLetter sets a TRB advice 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 model.SystemIntakeRetireLCIDInput,
) (*models.SystemIntake, error)

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

func SendTRBAdviceLetter

func SendTRBAdviceLetter(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.TRBAdviceLetter, error)

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

func SetSystemIntakeRelationExistingService

func SetSystemIntakeRelationExistingService(
	ctx context.Context,
	store *storage.Store,
	input *model.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 *model.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 *model.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 model.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 model.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 model.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 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 model.SubmitIntakeInput,
) (*model.UpdateSystemIntakePayload, error)

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

func SystemIntakeContractNumbers

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

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

func SystemIntakeNoteAuthor

func SystemIntakeNoteAuthor(obj *models.SystemIntakeNote) (*model.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,
	store *storage.Store,
	obj *models.SystemIntake,
) ([]*models.SystemIntakeNote, error)

SystemIntakeNotes fetches notes by System Intake ID

func SystemIntakeSystems

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

SystemIntakeSystems utilizies a dataloader 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 model.UpdateSystemIntakeContactDetailsInput) (*model.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 model.UpdateSystemIntakeContractDetailsInput) (*model.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 TRBRequestContractNumbers

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

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

func TRBRequestSystems

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

TRBRequestSystems utilizies a dataloader 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 UpdateLCID

func UpdateLCID(
	ctx context.Context,
	store *storage.Store,
	emailClient *email.Client,
	fetchUserInfo func(context.Context, string) (*models.UserInfo, error),
	input model.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 model.UpdateSystemIntakeNoteInput,
) (*models.SystemIntakeNote, error)

UpdateSystemIntakeNote updates a system intake note.

func UpdateTRBAdviceLetter

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

UpdateTRBAdviceLetter handles general updates to a TRB advice letter

func UpdateTRBAdviceLetterRecommendation

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

UpdateTRBAdviceLetterRecommendation updates a TRBAdviceLetterRecommendation record in the database

func UpdateTRBAdviceLetterRecommendationOrder

func UpdateTRBAdviceLetterRecommendationOrder(
	ctx context.Context,
	store *storage.Store,
	trbRequestID uuid.UUID,
	newOrder []uuid.UUID,
) ([]*models.TRBAdviceLetterRecommendation, error)

UpdateTRBAdviceLetterRecommendationOrder updates the order that TRB advice 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 UserAccountGetByIDLOADER

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

UserAccountGetByIDLOADER returns a user account by it's internal ID, utilizing a data loader

func UserAccountGetByUsername

func UserAccountGetByUsername(store *storage.Store, 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