Documentation ¶
Index ¶
- Constants
- type DBConfig
- type Store
- func (s *Store) Beginx() (*sqlx.Tx, error)
- func (s *Store) CreateAction(ctx context.Context, action *models.Action) (*models.Action, error)
- func (s *Store) CreateBusinessCase(ctx context.Context, businessCase *models.BusinessCaseWithCosts) (*models.BusinessCaseWithCosts, error)
- func (s *Store) CreateCedarSystemBookmark(ctx context.Context, cedarSystemBookmark *models.CedarSystemBookmark) (*models.CedarSystemBookmark, error)
- func (s *Store) CreateGovernanceRequestFeedback(ctx context.Context, requestFeedback *models.GovernanceRequestFeedback) (*models.GovernanceRequestFeedback, error)
- func (s *Store) CreateSystemIntake(ctx context.Context, intake *models.SystemIntake) (*models.SystemIntake, error)
- func (s *Store) CreateSystemIntakeContact(ctx context.Context, systemIntakeContact *models.SystemIntakeContact) (*models.SystemIntakeContact, error)
- func (s *Store) CreateSystemIntakeDocument(ctx context.Context, document *models.SystemIntakeDocument) (*models.SystemIntakeDocument, error)
- func (s *Store) CreateSystemIntakeGRBReviewer(ctx context.Context, np sqlutils.NamedPreparer, ...) error
- func (s *Store) CreateSystemIntakeNote(ctx context.Context, note *models.SystemIntakeNote) (*models.SystemIntakeNote, error)
- func (s *Store) CreateTRBAdminNote(ctx context.Context, note *models.TRBAdminNote) (*models.TRBAdminNote, error)
- func (s *Store) CreateTRBAdminNoteTRBDocumentLinks(ctx context.Context, trbRequestID uuid.UUID, trbAdminNoteID uuid.UUID, ...) ([]*models.TRBAdminNoteTRBRequestDocumentLink, error)
- func (s *Store) CreateTRBAdminNoteTRBRecommendationLinks(ctx context.Context, trbRequestID uuid.UUID, trbAdminNoteID uuid.UUID, ...) ([]*models.TRBAdminNoteTRBAdviceLetterRecommendationLink, error)
- func (s *Store) CreateTRBAdviceLetter(ctx context.Context, createdBy string, trbRequestID uuid.UUID) (*models.TRBAdviceLetter, error)
- func (s *Store) CreateTRBAdviceLetterRecommendation(ctx context.Context, recommendation *models.TRBAdviceLetterRecommendation) (*models.TRBAdviceLetterRecommendation, error)
- func (s *Store) CreateTRBLeadOption(ctx context.Context, leadOption *models.TRBLeadOption) (*models.TRBLeadOption, error)
- func (s *Store) CreateTRBRequest(ctx context.Context, np sqlutils.NamedPreparer, trb *models.TRBRequest) (*models.TRBRequest, error)
- func (s *Store) CreateTRBRequestAttendee(ctx context.Context, np sqlutils.NamedPreparer, ...) (*models.TRBRequestAttendee, error)
- func (s *Store) CreateTRBRequestDocument(ctx context.Context, document *models.TRBRequestDocument) (*models.TRBRequestDocument, error)
- func (s *Store) CreateTRBRequestFeedback(ctx context.Context, feedback *models.TRBRequestFeedback, ...) (*models.TRBRequestFeedback, error)
- func (s *Store) CreateTRBRequestForm(ctx context.Context, np sqlutils.NamedPreparer, form *models.TRBRequestForm) (*models.TRBRequestForm, error)
- func (s *Store) CreateTRBRequestSystemIntakes(ctx context.Context, trbRequestID uuid.UUID, systemIntakeIDs []uuid.UUID) ([]*models.TRBRequestSystemIntake, error)
- func (s *Store) DeleteCedarSystemBookmark(ctx context.Context, cedarSystemBookmark *models.CedarSystemBookmark) (*models.CedarSystemBookmark, error)
- func (s *Store) DeleteSystemIntakeContact(ctx context.Context, systemIntakeContact *models.SystemIntakeContact) (*models.SystemIntakeContact, error)
- func (s *Store) DeleteSystemIntakeDocument(ctx context.Context, id uuid.UUID) (*models.SystemIntakeDocument, error)
- func (s *Store) DeleteSystemIntakeGRBReviewer(ctx context.Context, tx *sqlx.Tx, reviewerID uuid.UUID) error
- func (s *Store) DeleteTRBAdviceLetterRecommendation(ctx context.Context, id uuid.UUID) (*models.TRBAdviceLetterRecommendation, error)
- func (s *Store) DeleteTRBLeadOption(ctx context.Context, euaID string) (*models.TRBLeadOption, error)
- func (s *Store) DeleteTRBRequestAttendee(ctx context.Context, id uuid.UUID) (*models.TRBRequestAttendee, error)
- func (s *Store) DeleteTRBRequestDocument(ctx context.Context, id uuid.UUID) (*models.TRBRequestDocument, error)
- func (s *Store) DeleteTRBRequestForm(ctx context.Context, trbRequestID uuid.UUID) (*models.TRBRequestForm, error)
- func (s *Store) DeleteTRBRequestFundingSources(ctx context.Context, trbRequestID uuid.UUID, fundingNumber string) ([]*models.TRBFundingSource, error)
- func (s *Store) DeleteUserAccountDANGEROUS(username string) error
- func (s *Store) FetchBusinessCaseByID(ctx context.Context, businessCaseID uuid.UUID) (*models.BusinessCaseWithCosts, error)
- func (s *Store) FetchCedarSystemBookmarks(ctx context.Context) ([]*models.CedarSystemBookmark, error)
- func (s *Store) FetchCedarSystemIsBookmarkedByCedarSystemIDs(ctx context.Context, bookmarkRequests []models.BookmarkRequest) ([]bool, error)
- func (s *Store) FetchNotesBySystemIntakeID(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeNote, error)
- func (s *Store) FetchNotesBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeNote, error)
- func (s *Store) FetchOpenBusinessCaseByIntakeID(ctx context.Context, intakeID uuid.UUID) (*models.BusinessCaseWithCosts, error)
- func (s *Store) FetchSystemIntakeByID(ctx context.Context, id uuid.UUID) (*models.SystemIntake, error)
- func (s *Store) FetchSystemIntakeByIDNP(ctx context.Context, np sqlutils.NamedPreparer, id uuid.UUID) (*models.SystemIntake, error)
- func (s *Store) FetchSystemIntakeContactsBySystemIntakeID(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeContact, error)
- func (s *Store) FetchSystemIntakeFundingSourcesByIntakeID(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeFundingSource, error)
- func (s *Store) FetchSystemIntakeFundingSourcesByIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeFundingSource, error)
- func (s *Store) FetchSystemIntakeNoteByID(ctx context.Context, id uuid.UUID) (*models.SystemIntakeNote, error)
- func (s *Store) FetchSystemIntakes(ctx context.Context) (models.SystemIntakes, error)
- func (s *Store) FetchSystemIntakesByStateForAdmins(ctx context.Context, state models.SystemIntakeState) ([]*models.SystemIntake, error)
- func (s *Store) FetchSystemIntakesWithReviewRequested(ctx context.Context, userID uuid.UUID) ([]*models.SystemIntake, error)
- func (s *Store) GenerateLifecycleID(ctx context.Context) (string, error)
- func (s *Store) GetActionsBySystemIntakeID(ctx context.Context, systemIntakeID uuid.UUID) ([]models.Action, error)
- func (s *Store) GetActionsBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]models.Action, error)
- func (s *Store) GetAttendeeByEUAIDAndTRBID(ctx context.Context, euaID string, trbRequestID uuid.UUID) (*models.TRBRequestAttendee, error)
- func (s *Store) GetAttendeesByEUAIDsAndTRBIDs(ctx context.Context, euaIDs []string, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestAttendee, error)
- func (s *Store) GetBusinessCaseBySystemIntakeID(ctx context.Context, systemIntakeID uuid.UUID) (*models.BusinessCase, error)
- func (s *Store) GetBusinessCaseBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.BusinessCase, error)
- func (s *Store) GetGovernanceRequestFeedbacksByIntakeID(ctx context.Context, intakeID uuid.UUID) ([]*models.GovernanceRequestFeedback, error)
- func (s *Store) GetGovernanceRequestFeedbacksByIntakeIDs(ctx context.Context, intakeIDs []uuid.UUID) ([]*models.GovernanceRequestFeedback, error)
- func (s *Store) GetLifecycleCostsByBizCaseID(ctx context.Context, businessCaseID uuid.UUID) ([]*models.EstimatedLifecycleCost, error)
- func (s *Store) GetLifecycleCostsByBizCaseIDs(ctx context.Context, businessCaseIDs []uuid.UUID) ([]*models.EstimatedLifecycleCost, error)
- func (s *Store) GetMySystemIntakes(ctx context.Context) ([]*models.SystemIntake, error)
- func (s *Store) GetMyTRBRequests(ctx context.Context, archived bool) ([]*models.TRBRequest, error)
- func (s *Store) GetNewestTRBRequestFeedbackByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) (*models.TRBRequestFeedback, error)
- func (s *Store) GetNewestTRBRequestFeedbackByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestFeedback, error)
- func (s *Store) GetSystemIntakeDocumentByID(ctx context.Context, docID uuid.UUID) (*models.SystemIntakeDocument, error)
- func (s *Store) GetSystemIntakeDocumentByS3Key(ctx context.Context, s3Key string) (*models.SystemIntakeDocument, error)
- func (s *Store) GetSystemIntakeDocumentsByRequestID(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeDocument, error)
- func (s *Store) GetSystemIntakeDocumentsByRequestIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeDocument, error)
- func (s *Store) GetSystemIntakesWithLCIDs(ctx context.Context) ([]*models.SystemIntake, error)
- func (s *Store) GetTRBAdminNoteByID(ctx context.Context, id uuid.UUID) (*models.TRBAdminNote, error)
- func (s *Store) GetTRBAdminNotesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBAdminNote, error)
- func (s *Store) GetTRBAdminNotesByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBAdminNote, error)
- func (s *Store) GetTRBAdviceLetterByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) (*models.TRBAdviceLetter, error)
- func (s *Store) GetTRBAdviceLetterRecommendationByID(ctx context.Context, id uuid.UUID) (*models.TRBAdviceLetterRecommendation, error)
- func (s *Store) GetTRBAdviceLetterRecommendationsByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBAdviceLetterRecommendation, error)
- func (s *Store) GetTRBAdviceLetterRecommendationsSharingTRBRequestID(ctx context.Context, recommendationID uuid.UUID) ([]*models.TRBAdviceLetterRecommendation, error)
- func (s *Store) GetTRBAdviceLettersByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBAdviceLetter, error)
- func (s *Store) GetTRBFundingSourcesByRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBFundingSource, error)
- func (s *Store) GetTRBFundingSourcesByRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBFundingSource, error)
- func (s *Store) GetTRBLeadOptions(ctx context.Context) ([]*models.TRBLeadOption, error)
- func (s *Store) GetTRBRecommendationsByAdminNoteID(ctx context.Context, adminNoteID uuid.UUID) ([]*models.TRBAdviceLetterRecommendation, error)
- func (s *Store) GetTRBRequestAttendeesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequestAttendee, error)
- func (s *Store) GetTRBRequestAttendeesByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestAttendee, error)
- func (s *Store) GetTRBRequestByID(ctx context.Context, id uuid.UUID) (*models.TRBRequest, error)
- func (s *Store) GetTRBRequestByIDNP(ctx context.Context, np sqlutils.NamedPreparer, id uuid.UUID) (*models.TRBRequest, error)
- func (s *Store) GetTRBRequestDocumentsByAdminNoteID(ctx context.Context, adminNoteID uuid.UUID) ([]*models.TRBRequestDocument, error)
- func (s *Store) GetTRBRequestDocumentsByRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequestDocument, error)
- func (s *Store) GetTRBRequestDocumentsByRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestDocument, error)
- func (s *Store) GetTRBRequestFeedbackByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequestFeedback, error)
- func (s *Store) GetTRBRequestFeedbackByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestFeedback, error)
- func (s *Store) GetTRBRequestFormByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) (*models.TRBRequestForm, error)
- func (s *Store) GetTRBRequestFormSystemIntakesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.SystemIntake, error)
- func (s *Store) GetTRBRequestFormSystemIntakesByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.RelatedSystemIntake, error)
- func (s *Store) GetTRBRequestFormsByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestForm, error)
- func (s *Store) GetTRBRequests(ctx context.Context, archived bool) ([]*models.TRBRequest, error)
- func (s *Store) PrepareNamed(query string) (*sqlx.NamedStmt, error)
- func (s *Store) RelatedSystemIntakesBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.RelatedSystemIntake, error)
- func (s *Store) RelatedSystemIntakesByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.RelatedSystemIntake, error)
- func (s *Store) RelatedTRBRequestsBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.RelatedTRBRequest, error)
- func (s *Store) RelatedTRBRequestsByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.RelatedTRBRequest, error)
- func (s *Store) SetSystemIntakeContractNumbers(ctx context.Context, tx *sqlx.Tx, systemIntakeID uuid.UUID, ...) error
- func (s *Store) SetSystemIntakeSystems(ctx context.Context, tx *sqlx.Tx, systemIntakeID uuid.UUID, systemIDs []string) error
- func (s *Store) SetTRBAdminNoteArchived(ctx context.Context, id uuid.UUID, isArchived bool, modifiedBy string) (*models.TRBAdminNote, error)
- func (s *Store) SetTRBRequestContractNumbers(ctx context.Context, tx *sqlx.Tx, trbRequestID uuid.UUID, ...) error
- func (s *Store) SetTRBRequestSystems(ctx context.Context, tx *sqlx.Tx, trbRequestID uuid.UUID, systemIDs []string) error
- func (s *Store) SystemIntakeContractNumbersBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeContractNumber, error)
- func (s *Store) SystemIntakeGRBReviewersBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeGRBReviewer, error)
- func (s *Store) SystemIntakeSystemsBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeSystem, error)
- func (s *Store) SystemIntakesByCedarSystemIDs(ctx context.Context, requests []models.SystemIntakesByCedarSystemIDsRequest) ([]*models.SystemIntakesByCedarSystemIDsResponse, error)
- func (s *Store) TRBRequestContractNumbersByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestContractNumber, error)
- func (s *Store) TRBRequestSystemsByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestSystem, error)
- func (s *Store) TRBRequestsByCedarSystemIDs(ctx context.Context, requests []models.TRBRequestsByCedarSystemIDsRequest) ([]*models.TRBRequestsByCedarSystemIDsResponse, error)
- func (s *Store) TruncateAllTablesDANGEROUS(logger *zap.Logger) error
- func (s *Store) UpdateAdminLead(ctx context.Context, id uuid.UUID, adminLead string) (string, error)
- func (s *Store) UpdateBusinessCase(ctx context.Context, businessCase *models.BusinessCaseWithCosts) (*models.BusinessCaseWithCosts, error)
- func (s *Store) UpdateReviewDates(ctx context.Context, id uuid.UUID, grbDate *time.Time, grtDate *time.Time) (*models.SystemIntake, error)
- func (s *Store) UpdateSystemIntake(ctx context.Context, intake *models.SystemIntake) (*models.SystemIntake, error)
- func (s *Store) UpdateSystemIntakeContact(ctx context.Context, systemIntakeContact *models.SystemIntakeContact) (*models.SystemIntakeContact, error)
- func (s *Store) UpdateSystemIntakeFundingSources(ctx context.Context, systemIntakeID uuid.UUID, ...) ([]*models.SystemIntakeFundingSource, error)
- func (s *Store) UpdateSystemIntakeFundingSourcesNP(ctx context.Context, tx *sqlx.Tx, systemIntakeID uuid.UUID, ...) ([]*models.SystemIntakeFundingSource, error)
- func (s *Store) UpdateSystemIntakeGRBReviewer(ctx context.Context, tx *sqlx.Tx, reviewerID uuid.UUID, ...) (*models.SystemIntakeGRBReviewer, error)
- func (s *Store) UpdateSystemIntakeLinkedCedarSystem(ctx context.Context, id uuid.UUID, cedarSystemID null.String) (*models.SystemIntake, error)
- func (s *Store) UpdateSystemIntakeNP(ctx context.Context, np sqlutils.NamedPreparer, intake *models.SystemIntake) (*models.SystemIntake, error)
- func (s *Store) UpdateSystemIntakeNote(ctx context.Context, note *models.SystemIntakeNote) (*models.SystemIntakeNote, error)
- func (s *Store) UpdateTRBAdviceLetter(ctx context.Context, letter *models.TRBAdviceLetter) (*models.TRBAdviceLetter, error)
- func (s *Store) UpdateTRBAdviceLetterRecommendation(ctx context.Context, recommendation *models.TRBAdviceLetterRecommendation) (*models.TRBAdviceLetterRecommendation, error)
- func (s *Store) UpdateTRBAdviceLetterRecommendationOrder(ctx context.Context, trbRequestID uuid.UUID, newOrder []uuid.UUID) ([]*models.TRBAdviceLetterRecommendation, error)
- func (s *Store) UpdateTRBAdviceLetterStatus(ctx context.Context, id uuid.UUID, status models.TRBAdviceLetterStatus) (*models.TRBAdviceLetter, error)
- func (s *Store) UpdateTRBRequest(ctx context.Context, trbRequest *models.TRBRequest) (*models.TRBRequest, error)
- func (s *Store) UpdateTRBRequestAttendee(ctx context.Context, attendee *models.TRBRequestAttendee) (*models.TRBRequestAttendee, error)
- func (s *Store) UpdateTRBRequestForm(ctx context.Context, form *models.TRBRequestForm) (*models.TRBRequestForm, error)
- func (s *Store) UpdateTRBRequestFundingSources(ctx context.Context, trbRequestID uuid.UUID, fundingNumber string, ...) ([]*models.TRBFundingSource, error)
- func (s *Store) UpdateTRBRequestNP(ctx context.Context, np sqlutils.NamedPreparer, trb *models.TRBRequest) (*models.TRBRequest, error)
- func (s *Store) UserAccountCreate(np sqlutils.NamedPreparer, userAccount *authentication.UserAccount) (*authentication.UserAccount, error)
- func (s *Store) UserAccountGetByCommonName(commonName string) (*authentication.UserAccount, error)
- func (s *Store) UserAccountGetByID(np sqlutils.NamedPreparer, id uuid.UUID) (*authentication.UserAccount, error)
- func (s *Store) UserAccountGetByUsername(username string) (*authentication.UserAccount, error)
- func (s *Store) UserAccountUpdateByUserName(np sqlutils.NamedPreparer, userAccount *authentication.UserAccount) (*authentication.UserAccount, error)
- func (s *Store) UserAccountsByIDs(ctx context.Context, userIDs []uuid.UUID) ([]*authentication.UserAccount, error)
Constants ¶
const EuaIDMsg = "" /* 177-byte string literal not displayed */
EuaIDMsg is the error we see when EUA doesn't meet EUA ID constraints
const IntakeExistsMsg = "" /* 208-byte string literal not displayed */
IntakeExistsMsg is the error we see when there is no valid system intake
const UniqueIntakeMsg = "pq: duplicate key value violates unique constraint \"unique_intake_per_biz_case\""
UniqueIntakeMsg is a match for an error we see when the system intake already has a biz case
const ValidStatusMsg = "pq: invalid input value for enum business_case_status: "
ValidStatusMsg is a match for an error we see when there is no valid status
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBConfig ¶
type DBConfig struct { Host string Port string Database string Username string Password string SSLMode string UseIAM bool MaxConnections int }
DBConfig holds the configurations for a database connection
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store performs database operations for EASi
func NewStore ¶
NewStore creates a new Store struct The `db` property on the Store will always be a *sqlx.DB, but a notable difference in the DB is that if config.UseIAM is true, that DB instance will be backed by a custom connector in iam_db.go that generates IAM auth tokens when making new connections to the database. If config.UseIAM is false, it will connect using the "postgres" driver that SQLx registers in its init() function https://github.com/jmoiron/sqlx/blob/75a7ebf246fd757c9c7742da7dc4d26c6fdb6b5b/bind.go#L33-L40
func (*Store) Beginx ¶
Beginx implements the TransactionPreparer interface Implementing the sqlutils.TransactionPreparer interfaces allows us to use a sqlx.DB or a storage.Store to create a transaction
func (*Store) CreateAction ¶
CreateAction creates an Action item in the database
func (*Store) CreateBusinessCase ¶
func (s *Store) CreateBusinessCase(ctx context.Context, businessCase *models.BusinessCaseWithCosts) (*models.BusinessCaseWithCosts, error)
CreateBusinessCase creates a business case
func (*Store) CreateCedarSystemBookmark ¶
func (s *Store) CreateCedarSystemBookmark(ctx context.Context, cedarSystemBookmark *models.CedarSystemBookmark) (*models.CedarSystemBookmark, error)
CreateCedarSystemBookmark creates a new cedar system bookmark object in the database
func (*Store) CreateGovernanceRequestFeedback ¶
func (s *Store) CreateGovernanceRequestFeedback(ctx context.Context, requestFeedback *models.GovernanceRequestFeedback) (*models.GovernanceRequestFeedback, error)
CreateGovernanceRequestFeedback creates a governance request feedback record in the database
func (*Store) CreateSystemIntake ¶
func (s *Store) CreateSystemIntake(ctx context.Context, intake *models.SystemIntake) (*models.SystemIntake, error)
CreateSystemIntake creates a system intake, though without saving values for LCID-related fields
func (*Store) CreateSystemIntakeContact ¶
func (s *Store) CreateSystemIntakeContact(ctx context.Context, systemIntakeContact *models.SystemIntakeContact) (*models.SystemIntakeContact, error)
CreateSystemIntakeContact creates a new system intake contact object in the database
func (*Store) CreateSystemIntakeDocument ¶
func (s *Store) CreateSystemIntakeDocument(ctx context.Context, document *models.SystemIntakeDocument) (*models.SystemIntakeDocument, error)
CreateSystemIntakeDocument creates a record for a SystemIntakeDocument in our database
func (*Store) CreateSystemIntakeGRBReviewer ¶
func (s *Store) CreateSystemIntakeGRBReviewer(ctx context.Context, np sqlutils.NamedPreparer, reviewer *models.SystemIntakeGRBReviewer) error
CreateSystemIntakeGRBReviewer creates a GRB Reviewer
func (*Store) CreateSystemIntakeNote ¶
func (s *Store) CreateSystemIntakeNote(ctx context.Context, note *models.SystemIntakeNote) (*models.SystemIntakeNote, error)
CreateSystemIntakeNote inserts a new note into the database
func (*Store) CreateTRBAdminNote ¶
func (s *Store) CreateTRBAdminNote(ctx context.Context, note *models.TRBAdminNote) (*models.TRBAdminNote, error)
CreateTRBAdminNote creates a new TRB admin note record in the database
func (*Store) CreateTRBAdminNoteTRBDocumentLinks ¶
func (s *Store) CreateTRBAdminNoteTRBDocumentLinks( ctx context.Context, trbRequestID uuid.UUID, trbAdminNoteID uuid.UUID, trbRequestDocumentIDs []uuid.UUID, ) ([]*models.TRBAdminNoteTRBRequestDocumentLink, error)
CreateTRBAdminNoteTRBDocumentLinks creates multiple link records relating a single TRB admin note to all TRB documents it references
func (*Store) CreateTRBAdminNoteTRBRecommendationLinks ¶
func (s *Store) CreateTRBAdminNoteTRBRecommendationLinks( ctx context.Context, trbRequestID uuid.UUID, trbAdminNoteID uuid.UUID, trbAdviceLetterRecommendationIDs []uuid.UUID, ) ([]*models.TRBAdminNoteTRBAdviceLetterRecommendationLink, error)
CreateTRBAdminNoteTRBRecommendationLinks creates multiple link records relating a single TRB admin note to all TRB advice letter recommendations it references
func (*Store) CreateTRBAdviceLetter ¶
func (s *Store) CreateTRBAdviceLetter(ctx context.Context, createdBy string, trbRequestID uuid.UUID) (*models.TRBAdviceLetter, error)
CreateTRBAdviceLetter creates an advice letter for a TRB request, in the "In Progress" status
func (*Store) CreateTRBAdviceLetterRecommendation ¶
func (s *Store) CreateTRBAdviceLetterRecommendation( ctx context.Context, recommendation *models.TRBAdviceLetterRecommendation, ) (*models.TRBAdviceLetterRecommendation, error)
CreateTRBAdviceLetterRecommendation creates a new TRB advice letter recommendation record in the database. This recommendation will be positioned at the end of the advice letter upon creation.
func (*Store) CreateTRBLeadOption ¶
func (s *Store) CreateTRBLeadOption(ctx context.Context, leadOption *models.TRBLeadOption) (*models.TRBLeadOption, error)
CreateTRBLeadOption creates a new TRB lead option record in the database
func (*Store) CreateTRBRequest ¶
func (s *Store) CreateTRBRequest(ctx context.Context, np sqlutils.NamedPreparer, trb *models.TRBRequest) (*models.TRBRequest, error)
CreateTRBRequest creates a new TRBRequest record Note this will be refactored to not use the store, but is left now for organization
func (*Store) CreateTRBRequestAttendee ¶
func (s *Store) CreateTRBRequestAttendee(ctx context.Context, np sqlutils.NamedPreparer, attendee *models.TRBRequestAttendee) (*models.TRBRequestAttendee, error)
CreateTRBRequestAttendee creates a new TRB request attendee record in the database Note this will be refactored to not use the store, but is left now for organization
func (*Store) CreateTRBRequestDocument ¶
func (s *Store) CreateTRBRequestDocument(ctx context.Context, document *models.TRBRequestDocument) (*models.TRBRequestDocument, error)
CreateTRBRequestDocument creates a record for a TRBRequestDocument in our database, *after* it's been uploaded to S3
func (*Store) CreateTRBRequestFeedback ¶
func (s *Store) CreateTRBRequestFeedback(ctx context.Context, feedback *models.TRBRequestFeedback, formToUpdate *models.TRBRequestForm) (*models.TRBRequestFeedback, error)
CreateTRBRequestFeedback creates a new TRB request feedback record in the database
func (*Store) CreateTRBRequestForm ¶
func (s *Store) CreateTRBRequestForm(ctx context.Context, np sqlutils.NamedPreparer, form *models.TRBRequestForm) (*models.TRBRequestForm, error)
CreateTRBRequestForm creates a new TRBRequestForm record Note this will be refactored to not use the store, but is left now for organization
func (*Store) CreateTRBRequestSystemIntakes ¶
func (s *Store) CreateTRBRequestSystemIntakes(ctx context.Context, trbRequestID uuid.UUID, systemIntakeIDs []uuid.UUID) ([]*models.TRBRequestSystemIntake, error)
CreateTRBRequestSystemIntakes deletes all TRB Intake relations for the given trbRequestID and recreates them
func (*Store) DeleteCedarSystemBookmark ¶
func (s *Store) DeleteCedarSystemBookmark(ctx context.Context, cedarSystemBookmark *models.CedarSystemBookmark) (*models.CedarSystemBookmark, error)
DeleteCedarSystemBookmark deletes an existing cedar system bookmark object in the database
func (*Store) DeleteSystemIntakeContact ¶
func (s *Store) DeleteSystemIntakeContact(ctx context.Context, systemIntakeContact *models.SystemIntakeContact) (*models.SystemIntakeContact, error)
DeleteSystemIntakeContact deletes an existing system intake contact object in the database
func (*Store) DeleteSystemIntakeDocument ¶
func (s *Store) DeleteSystemIntakeDocument(ctx context.Context, id uuid.UUID) (*models.SystemIntakeDocument, error)
DeleteSystemIntakeDocument deletes an existing SystemIntakeDocument, given its ID
func (*Store) DeleteSystemIntakeGRBReviewer ¶
func (*Store) DeleteTRBAdviceLetterRecommendation ¶
func (s *Store) DeleteTRBAdviceLetterRecommendation(ctx context.Context, id uuid.UUID) (*models.TRBAdviceLetterRecommendation, error)
DeleteTRBAdviceLetterRecommendation deletes an existing TRB advice letter recommendation record in the database
func (*Store) DeleteTRBLeadOption ¶
func (s *Store) DeleteTRBLeadOption(ctx context.Context, euaID string) (*models.TRBLeadOption, error)
DeleteTRBLeadOption deletes an existing TRB lead option record in the database
func (*Store) DeleteTRBRequestAttendee ¶
func (s *Store) DeleteTRBRequestAttendee(ctx context.Context, id uuid.UUID) (*models.TRBRequestAttendee, error)
DeleteTRBRequestAttendee deletes an existing TRB request attendee record in the database
func (*Store) DeleteTRBRequestDocument ¶
func (s *Store) DeleteTRBRequestDocument(ctx context.Context, id uuid.UUID) (*models.TRBRequestDocument, error)
DeleteTRBRequestDocument sets the deleted_at property on an existing TRBRequestDocument, given its ID
func (*Store) DeleteTRBRequestForm ¶
func (s *Store) DeleteTRBRequestForm(ctx context.Context, trbRequestID uuid.UUID) (*models.TRBRequestForm, error)
DeleteTRBRequestForm deletes an existing TRB request form record in the database
func (*Store) DeleteTRBRequestFundingSources ¶
func (s *Store) DeleteTRBRequestFundingSources( ctx context.Context, trbRequestID uuid.UUID, fundingNumber string, ) ([]*models.TRBFundingSource, error)
DeleteTRBRequestFundingSources deletes all funding sources from a TRB Request Form by funding number
func (*Store) DeleteUserAccountDANGEROUS ¶
DeleteUserAccountDANGEROUS deletes a given user account from the DB only to be used in test code as we do not truncate `user_account` table
func (*Store) FetchBusinessCaseByID ¶
func (s *Store) FetchBusinessCaseByID(ctx context.Context, businessCaseID uuid.UUID) (*models.BusinessCaseWithCosts, error)
FetchBusinessCaseByID queries the DB for a business case matching the given ID This is legacy code used in REST endpoints
func (*Store) FetchCedarSystemBookmarks ¶
func (s *Store) FetchCedarSystemBookmarks(ctx context.Context) ([]*models.CedarSystemBookmark, error)
FetchCedarSystemBookmarks queries the DB for all the cedar system bookmarks matching the given user's EUA ID
func (*Store) FetchCedarSystemIsBookmarkedByCedarSystemIDs ¶
func (s *Store) FetchCedarSystemIsBookmarkedByCedarSystemIDs(ctx context.Context, bookmarkRequests []models.BookmarkRequest) ([]bool, error)
FetchCedarSystemIsBookmarkedByCedarSystemIDs returns a slice of `bool` for each incoming BookmarkRequest. This method differs from other Store methods used by dataloaders as it IS responsible for ordering the output. Once this function exits, we lose all context of what came back from the DB, so we order in here before returning to the caller
func (*Store) FetchNotesBySystemIntakeID ¶
func (s *Store) FetchNotesBySystemIntakeID(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeNote, error)
FetchNotesBySystemIntakeID retrieves all (non archived/deleted) Notes associated with a specific SystemIntake
func (*Store) FetchNotesBySystemIntakeIDs ¶
func (s *Store) FetchNotesBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeNote, error)
FetchNotesBySystemIntakeIDs retrieves all (non archived/deleted) Notes associated with a list of intake IDs
func (*Store) FetchOpenBusinessCaseByIntakeID ¶
func (s *Store) FetchOpenBusinessCaseByIntakeID(ctx context.Context, intakeID uuid.UUID) (*models.BusinessCaseWithCosts, error)
FetchOpenBusinessCaseByIntakeID queries the DB for an open business case matching the given intake ID This is legacy code used in REST endpoints
func (*Store) FetchSystemIntakeByID ¶
func (s *Store) FetchSystemIntakeByID(ctx context.Context, id uuid.UUID) (*models.SystemIntake, error)
FetchSystemIntakeByID serves as a wrapper for FetchSystemIntakeByIDNP, which is the actual implementation for fetching System Intakes by ID.
This method only exists to provide a transactional wrapper around the actual implementation, as a vast majority of the codebase was written before the introduction of transactions in the storage layer. This method should eventually be removed in favor of using FetchSystemIntakeByIDNP directly (and that function renamed).
func (*Store) FetchSystemIntakeByIDNP ¶
func (s *Store) FetchSystemIntakeByIDNP(ctx context.Context, np sqlutils.NamedPreparer, id uuid.UUID) (*models.SystemIntake, error)
FetchSystemIntakeByIDNP queries the DB for a system intake matching the given ID
The "NP" suffix stands for "NamedPreparer", as this function was written to avoid the need to update all of the existing code that uses FetchSystemIntakeByID to use a transactional wrapper.
func (*Store) FetchSystemIntakeContactsBySystemIntakeID ¶
func (s *Store) FetchSystemIntakeContactsBySystemIntakeID(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeContact, error)
FetchSystemIntakeContactsBySystemIntakeID queries the DB for all the system intake contacts matching the given system intake ID
func (*Store) FetchSystemIntakeFundingSourcesByIntakeID ¶
func (s *Store) FetchSystemIntakeFundingSourcesByIntakeID(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeFundingSource, error)
FetchSystemIntakeFundingSourcesByIntakeID fetches all funding sources for a system intake
func (*Store) FetchSystemIntakeFundingSourcesByIntakeIDs ¶
func (s *Store) FetchSystemIntakeFundingSourcesByIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeFundingSource, error)
FetchSystemIntakeFundingSourcesByIntakeIDs fetches all funding sources for a slice of system intake IDs
func (*Store) FetchSystemIntakeNoteByID ¶
func (s *Store) FetchSystemIntakeNoteByID(ctx context.Context, id uuid.UUID) (*models.SystemIntakeNote, error)
FetchSystemIntakeNoteByID retrieves a single Note by its primary key identifier
func (*Store) FetchSystemIntakes ¶
FetchSystemIntakes queries the DB for all system intakes
func (*Store) FetchSystemIntakesByStateForAdmins ¶
func (s *Store) FetchSystemIntakesByStateForAdmins(ctx context.Context, state models.SystemIntakeState) ([]*models.SystemIntake, error)
FetchSystemIntakesByStateForAdmins queries the DB for all system intakes with a matching state The intent of this query is to return all intakes that are in a state that is relevant to admins (i.e. not in a draft state, not archived)
func (*Store) FetchSystemIntakesWithReviewRequested ¶
func (s *Store) FetchSystemIntakesWithReviewRequested(ctx context.Context, userID uuid.UUID) ([]*models.SystemIntake, error)
FetchSystemIntakesWithReviewRequested queries the DB for all open system intakes where user is requested
func (*Store) GenerateLifecycleID ¶
GenerateLifecycleID returns what the next LCID is expected to be for the current date
The expected format is a 6-digit number in the form of "YYdddP" where YY - the 2-digit YEAR ddd - the 3-digit ORDINAL DATE, e.g. the number of days elapsed in the given year P - the 1-digit count of how many LCIDs already generated for the given day This routine assumes the LCIDs are being generated in Eastern Time Zone (FYI - the "YYddd" construct is referred to as the "Julian Day" in mainframe programmer circles, though this term seems to be a misappropriation of what astronomers use to mean a count of days since 24 Nov in the year 4714 BC.)
func (*Store) GetActionsBySystemIntakeID ¶
func (s *Store) GetActionsBySystemIntakeID(ctx context.Context, systemIntakeID uuid.UUID) ([]models.Action, error)
GetActionsBySystemIntakeID fetches actions for a particular intake
func (*Store) GetActionsBySystemIntakeIDs ¶
func (s *Store) GetActionsBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]models.Action, error)
GetActionsBySystemIntakeIDs fetches actions for a multiple intakes
func (*Store) GetAttendeeByEUAIDAndTRBID ¶
func (s *Store) GetAttendeeByEUAIDAndTRBID(ctx context.Context, euaID string, trbRequestID uuid.UUID) (*models.TRBRequestAttendee, error)
GetAttendeeByEUAIDAndTRBID attempts to retrieve an attendee of a given EUA user ID and TRB Request ID
func (*Store) GetAttendeesByEUAIDsAndTRBIDs ¶
func (s *Store) GetAttendeesByEUAIDsAndTRBIDs(ctx context.Context, euaIDs []string, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestAttendee, error)
GetAttendeesByEUAIDsAndTRBIDs attempts to retrieve a list of attendees given EUA user IDs and TRB Request IDs
func (*Store) GetBusinessCaseBySystemIntakeID ¶
func (s *Store) GetBusinessCaseBySystemIntakeID(ctx context.Context, systemIntakeID uuid.UUID) (*models.BusinessCase, error)
GetBusinessCaseBySystemIntakeID queries the DB for a business case matching the given ID of the System Intake
func (*Store) GetBusinessCaseBySystemIntakeIDs ¶
func (s *Store) GetBusinessCaseBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.BusinessCase, error)
GetBusinessCaseBySystemIntakeIDs queries the DB for a business case matching the given ID of the System Intake
func (*Store) GetGovernanceRequestFeedbacksByIntakeID ¶
func (s *Store) GetGovernanceRequestFeedbacksByIntakeID(ctx context.Context, intakeID uuid.UUID) ([]*models.GovernanceRequestFeedback, error)
GetGovernanceRequestFeedbacksByIntakeID returns all governance request feedback items for a given system intake
func (*Store) GetGovernanceRequestFeedbacksByIntakeIDs ¶
func (s *Store) GetGovernanceRequestFeedbacksByIntakeIDs(ctx context.Context, intakeIDs []uuid.UUID) ([]*models.GovernanceRequestFeedback, error)
GetGovernanceRequestFeedbacksByIntakeIDs returns all governance request feedback items for a list of intake IDs
func (*Store) GetLifecycleCostsByBizCaseID ¶
func (s *Store) GetLifecycleCostsByBizCaseID(ctx context.Context, businessCaseID uuid.UUID) ([]*models.EstimatedLifecycleCost, error)
GetLifecycleCostsByBizCaseID queries the DB for a lifecycle costs by biz case ID
func (*Store) GetLifecycleCostsByBizCaseIDs ¶
func (s *Store) GetLifecycleCostsByBizCaseIDs(ctx context.Context, businessCaseIDs []uuid.UUID) ([]*models.EstimatedLifecycleCost, error)
GetLifecycleCostsByBizCaseIDs queries the DB for a lifecycle costs by biz case ID
func (*Store) GetMySystemIntakes ¶
func (*Store) GetMyTRBRequests ¶
GetMyTRBRequests returns the collection of TRB requests that belong to the user in the context
func (*Store) GetNewestTRBRequestFeedbackByTRBRequestID ¶
func (s *Store) GetNewestTRBRequestFeedbackByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) (*models.TRBRequestFeedback, error)
GetNewestTRBRequestFeedbackByTRBRequestID queries the DB the newest TRB request feedback record matching the given TRB request ID
func (*Store) GetNewestTRBRequestFeedbackByTRBRequestIDs ¶
func (s *Store) GetNewestTRBRequestFeedbackByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestFeedback, error)
GetNewestTRBRequestFeedbackByTRBRequestIDs queries the DB the newest TRB request feedback records matching the given TRB request IDs
func (*Store) GetSystemIntakeDocumentByID ¶
func (*Store) GetSystemIntakeDocumentByS3Key ¶
func (*Store) GetSystemIntakeDocumentsByRequestID ¶
func (s *Store) GetSystemIntakeDocumentsByRequestID(ctx context.Context, systemIntakeID uuid.UUID) ([]*models.SystemIntakeDocument, error)
GetSystemIntakeDocumentsByRequestID queries the DB for all documents attached to the system intake with the given ID
func (*Store) GetSystemIntakeDocumentsByRequestIDs ¶
func (s *Store) GetSystemIntakeDocumentsByRequestIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.SystemIntakeDocument, error)
GetSystemIntakeDocumentsByRequestIDs queries the DB for all documents attached to system intakes with the given IDs
func (*Store) GetSystemIntakesWithLCIDs ¶
GetSystemIntakesWithLCIDs retrieves all LCIDs that are in use
func (*Store) GetTRBAdminNoteByID ¶
func (s *Store) GetTRBAdminNoteByID(ctx context.Context, id uuid.UUID) (*models.TRBAdminNote, error)
GetTRBAdminNoteByID retrieves a single admin note by its ID
func (*Store) GetTRBAdminNotesByTRBRequestID ¶
func (s *Store) GetTRBAdminNotesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBAdminNote, error)
GetTRBAdminNotesByTRBRequestID returns all notes for a given TRB request
func (*Store) GetTRBAdminNotesByTRBRequestIDs ¶
func (s *Store) GetTRBAdminNotesByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBAdminNote, error)
GetTRBAdminNotesByTRBRequestIDs returns all notes for a given TRB request
func (*Store) GetTRBAdviceLetterByTRBRequestID ¶
func (s *Store) GetTRBAdviceLetterByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) (*models.TRBAdviceLetter, error)
GetTRBAdviceLetterByTRBRequestID fetches a TRB advice letter record by its associated request's ID
func (*Store) GetTRBAdviceLetterRecommendationByID ¶
func (s *Store) GetTRBAdviceLetterRecommendationByID(ctx context.Context, id uuid.UUID) (*models.TRBAdviceLetterRecommendation, error)
GetTRBAdviceLetterRecommendationByID retrieves a TRB advice letter recommendation record from the database It will not return any entities that have a deleted_at value
func (*Store) GetTRBAdviceLetterRecommendationsByTRBRequestID ¶
func (s *Store) GetTRBAdviceLetterRecommendationsByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBAdviceLetterRecommendation, error)
GetTRBAdviceLetterRecommendationsByTRBRequestID queries the DB for all the TRB advice letter recommendations, filtering by the given TRB request ID and ordered in the user-specified positions
func (*Store) GetTRBAdviceLetterRecommendationsSharingTRBRequestID ¶
func (s *Store) GetTRBAdviceLetterRecommendationsSharingTRBRequestID(ctx context.Context, recommendationID uuid.UUID) ([]*models.TRBAdviceLetterRecommendation, error)
GetTRBAdviceLetterRecommendationsSharingTRBRequestID queries the DB for all TRB advice letter recommendations with the same TRB request ID as the given recommendation It will not return any entities that have a deleted_at value
func (*Store) GetTRBAdviceLettersByTRBRequestIDs ¶
func (s *Store) GetTRBAdviceLettersByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBAdviceLetter, error)
GetTRBAdviceLettersByTRBRequestIDs fetches a TRB advice letter records by associated request IDs
func (*Store) GetTRBFundingSourcesByRequestID ¶
func (s *Store) GetTRBFundingSourcesByRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBFundingSource, error)
GetTRBFundingSourcesByRequestID queries the DB for all the TRB request form funding sources matching the given TRB request ID
func (*Store) GetTRBFundingSourcesByRequestIDs ¶
func (s *Store) GetTRBFundingSourcesByRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBFundingSource, error)
GetTRBFundingSourcesByRequestIDs queries the DB for all the TRB request form funding sources matching the given TRB request IDs
func (*Store) GetTRBLeadOptions ¶
GetTRBLeadOptions retrieves all TRB lead option records from the database
func (*Store) GetTRBRecommendationsByAdminNoteID ¶
func (s *Store) GetTRBRecommendationsByAdminNoteID(ctx context.Context, adminNoteID uuid.UUID) ([]*models.TRBAdviceLetterRecommendation, error)
GetTRBRecommendationsByAdminNoteID fetches all TRB advice letter documents linked to a TRB admin note This function specifically fetches all recommendations (even deleted ones), as this function is called by the resolver for TRB Admin Notes, which need to display previously deleted recommendation titles
func (*Store) GetTRBRequestAttendeesByTRBRequestID ¶
func (s *Store) GetTRBRequestAttendeesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequestAttendee, error)
GetTRBRequestAttendeesByTRBRequestID queries the DB for all the TRB request attendee records matching the given TRB request ID
func (*Store) GetTRBRequestAttendeesByTRBRequestIDs ¶
func (s *Store) GetTRBRequestAttendeesByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestAttendee, error)
GetTRBRequestAttendeesByTRBRequestIDs queries the DB for all the TRB request attendee records matching the given TRB request IDs
func (*Store) GetTRBRequestByID ¶
GetTRBRequestByID takes in a NamedPreparer (db, tx) and returns an TRBRequest from the db for a given id
func (*Store) GetTRBRequestByIDNP ¶
func (s *Store) GetTRBRequestByIDNP(ctx context.Context, np sqlutils.NamedPreparer, id uuid.UUID) (*models.TRBRequest, error)
GetTRBRequestByIDNP returns an TRBRequest from the db for a given id
func (*Store) GetTRBRequestDocumentsByAdminNoteID ¶
func (s *Store) GetTRBRequestDocumentsByAdminNoteID(ctx context.Context, adminNoteID uuid.UUID) ([]*models.TRBRequestDocument, error)
GetTRBRequestDocumentsByAdminNoteID fetches all TRB request documents linked to a TRB admin note This function specifically fetches all documents (even deleted ones), as this function is called by the resolver for TRB Admin Notes, which need to display previously deleted document names
func (*Store) GetTRBRequestDocumentsByRequestID ¶
func (s *Store) GetTRBRequestDocumentsByRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequestDocument, error)
GetTRBRequestDocumentsByRequestID queries the DB for all documents attached to the TRB request with the given ID It will NOT return any items that have been soft-deleted (deleted_at NOT NULL)
func (*Store) GetTRBRequestDocumentsByRequestIDs ¶
func (s *Store) GetTRBRequestDocumentsByRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestDocument, error)
GetTRBRequestDocumentsByRequestIDs queries the DB for all documents attached to a list of TRB requests It will NOT return any items that have been soft-deleted (deleted_at NOT NULL)
func (*Store) GetTRBRequestFeedbackByTRBRequestID ¶
func (s *Store) GetTRBRequestFeedbackByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.TRBRequestFeedback, error)
GetTRBRequestFeedbackByTRBRequestID queries the DB for all the TRB request feedback records matching the given TRB request ID
func (*Store) GetTRBRequestFeedbackByTRBRequestIDs ¶
func (s *Store) GetTRBRequestFeedbackByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestFeedback, error)
GetTRBRequestFeedbackByTRBRequestIDs queries the DB for all the TRB request feedback records matching the given TRB request IDs
func (*Store) GetTRBRequestFormByTRBRequestID ¶
func (s *Store) GetTRBRequestFormByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) (*models.TRBRequestForm, error)
GetTRBRequestFormByTRBRequestID queries the DB for the TRB request form record matching the given TRB request ID
func (*Store) GetTRBRequestFormSystemIntakesByTRBRequestID ¶
func (s *Store) GetTRBRequestFormSystemIntakesByTRBRequestID(ctx context.Context, trbRequestID uuid.UUID) ([]*models.SystemIntake, error)
GetTRBRequestFormSystemIntakesByTRBRequestID retrieves all system intakes that have been related to a given TRB request ID
func (*Store) GetTRBRequestFormSystemIntakesByTRBRequestIDs ¶
func (s *Store) GetTRBRequestFormSystemIntakesByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.RelatedSystemIntake, error)
GetTRBRequestFormSystemIntakesByTRBRequestIDs retrieves all system intakes that have been related to a list of TRB request IDs
func (*Store) GetTRBRequestFormsByTRBRequestIDs ¶
func (s *Store) GetTRBRequestFormsByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.TRBRequestForm, error)
GetTRBRequestFormsByTRBRequestIDs queries the DB for TRB request form records matching the given TRB request IDs
func (*Store) GetTRBRequests ¶
GetTRBRequests returns the collection of TRB requests
func (*Store) PrepareNamed ¶
PrepareNamed implements the NamedPreparer interface Implementing the sqlutils.NamedPreparer interface allows us to use a sqlx.Tx or a storage.Store as a parameter in our DB calls (the former for when we want to implement transactions, the latter for when we don't)
func (*Store) RelatedSystemIntakesBySystemIntakeIDs ¶
func (s *Store) RelatedSystemIntakesBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.RelatedSystemIntake, error)
RelatedSystemIntakesBySystemIntakeIDs retrieves related system intakes by system intake ID
func (*Store) RelatedSystemIntakesByTRBRequestIDs ¶
func (s *Store) RelatedSystemIntakesByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.RelatedSystemIntake, error)
RelatedSystemIntakesByTRBRequestIDs retrieves related system intakes by TRB Request ID
func (*Store) RelatedTRBRequestsBySystemIntakeIDs ¶
func (s *Store) RelatedTRBRequestsBySystemIntakeIDs(ctx context.Context, systemIntakeIDs []uuid.UUID) ([]*models.RelatedTRBRequest, error)
RelatedTRBRequestsBySystemIntakeIDs retrieves related TRB Requests by system intake ID
func (*Store) RelatedTRBRequestsByTRBRequestIDs ¶
func (s *Store) RelatedTRBRequestsByTRBRequestIDs(ctx context.Context, trbRequestIDs []uuid.UUID) ([]*models.RelatedTRBRequest, error)
RelatedTRBRequestsByTRBRequestIDs retrieves related TRB Requests by TRB Request ID
func (*Store) SetSystemIntakeContractNumbers ¶
func (s *Store) SetSystemIntakeContractNumbers(ctx context.Context, tx *sqlx.Tx, systemIntakeID uuid.UUID, contractNumbers []string) error
SetSystemIntakeContractNumbers links given Contract Numbers to given System Intake ID This function opts to take a *sqlx.Tx instead of a NamedPreparer because the SQL calls inside this function are heavily intertwined, and we never want to call them outside the scope of a transaction
func (*Store) SetSystemIntakeSystems ¶
func (s *Store) SetSystemIntakeSystems(ctx context.Context, tx *sqlx.Tx, systemIntakeID uuid.UUID, systemIDs []string) error
SetSystemIntakeSystems links given System IDs to given System Intake ID This function opts to take a *sqlx.Tx instead of a NamedPreparer because the SQL calls inside this function are heavily intertwined, and we never want to call them outside the scope of a transaction
func (*Store) SetTRBAdminNoteArchived ¶
func (s *Store) SetTRBAdminNoteArchived(ctx context.Context, id uuid.UUID, isArchived bool, modifiedBy string) (*models.TRBAdminNote, error)
SetTRBAdminNoteArchived sets whether a TRB admin note is archived (soft-deleted) It takes a modifiedBy argument because it doesn't take a full TRBAdminNote as an argument, and ModifiedBy fields are usually set by the resolver.
func (*Store) SetTRBRequestContractNumbers ¶
func (s *Store) SetTRBRequestContractNumbers(ctx context.Context, tx *sqlx.Tx, trbRequestID uuid.UUID, contractNumbers []string) error
SetTRBRequestContractNumbers links given Contract Numbers to given TRB Request ID This function opts to take a *sqlx.Tx instead of a NamedPreparer because the SQL calls inside this function are heavily intertwined, and we never want to call them outside the scope of a transaction
func (*Store) SetTRBRequestSystems ¶
func (s *Store) SetTRBRequestSystems(ctx context.Context, tx *sqlx.Tx, trbRequestID uuid.UUID, systemIDs []string) error
SetTRBRequestSystems links given System IDs to given TRB Request ID This function opts to take a *sqlx.Tx instead of a NamedPreparer because the SQL calls inside this function are heavily intertwined, and we never want to call them outside the scope of a transaction
func (*Store) SystemIntakeContractNumbersBySystemIntakeIDs ¶
func (*Store) SystemIntakeGRBReviewersBySystemIntakeIDs ¶
func (*Store) SystemIntakeSystemsBySystemIntakeIDs ¶
func (*Store) SystemIntakesByCedarSystemIDs ¶
func (s *Store) SystemIntakesByCedarSystemIDs(ctx context.Context, requests []models.SystemIntakesByCedarSystemIDsRequest) ([]*models.SystemIntakesByCedarSystemIDsResponse, error)
func (*Store) TRBRequestContractNumbersByTRBRequestIDs ¶
func (*Store) TRBRequestSystemsByTRBRequestIDs ¶
func (*Store) TRBRequestsByCedarSystemIDs ¶
func (s *Store) TRBRequestsByCedarSystemIDs(ctx context.Context, requests []models.TRBRequestsByCedarSystemIDsRequest) ([]*models.TRBRequestsByCedarSystemIDsResponse, error)
func (*Store) TruncateAllTablesDANGEROUS ¶
TruncateAllTablesDANGEROUS is a function to reset all tables in the DB. It should only be called within test code. this list of tables should match the list of tables in scripts/dev's db:clean task
NOTE: we DO NOT truncate the `user_account` table - it would remove the default users, which is behavior we do not want
func (*Store) UpdateAdminLead ¶
func (s *Store) UpdateAdminLead(ctx context.Context, id uuid.UUID, adminLead string) (string, error)
UpdateAdminLead updates the admin lead for an intake
func (*Store) UpdateBusinessCase ¶
func (s *Store) UpdateBusinessCase(ctx context.Context, businessCase *models.BusinessCaseWithCosts) (*models.BusinessCaseWithCosts, error)
UpdateBusinessCase creates a business case
func (*Store) UpdateReviewDates ¶
func (s *Store) UpdateReviewDates(ctx context.Context, id uuid.UUID, grbDate *time.Time, grtDate *time.Time) (*models.SystemIntake, error)
UpdateReviewDates updates the admin lead for an intake
func (*Store) UpdateSystemIntake ¶
func (s *Store) UpdateSystemIntake(ctx context.Context, intake *models.SystemIntake) (*models.SystemIntake, error)
UpdateSystemIntake serves as a wrapper for UpdateSystemIntakeNP, which is the actual implementation for updating System Intakes.
This method only exists to provide a transactional wrapper around the actual implementation, as a vast majority of the codebase was written before the introduction of transactions in the storage layer. This method should eventually be removed in favor of using UpdateSystemIntakeNP directly (and that function renamed).
func (*Store) UpdateSystemIntakeContact ¶
func (s *Store) UpdateSystemIntakeContact(ctx context.Context, systemIntakeContact *models.SystemIntakeContact) (*models.SystemIntakeContact, error)
UpdateSystemIntakeContact updates a system intake contact object in the database
func (*Store) UpdateSystemIntakeFundingSources ¶
func (s *Store) UpdateSystemIntakeFundingSources(ctx context.Context, systemIntakeID uuid.UUID, fundingSources []*models.SystemIntakeFundingSource) ([]*models.SystemIntakeFundingSource, error)
UpdateSystemIntakeFundingSources clears and updates the funding sources of a system intake using an automatically created transaction
func (*Store) UpdateSystemIntakeFundingSourcesNP ¶
func (s *Store) UpdateSystemIntakeFundingSourcesNP(ctx context.Context, tx *sqlx.Tx, systemIntakeID uuid.UUID, fundingSources []*models.SystemIntakeFundingSource) ([]*models.SystemIntakeFundingSource, error)
UpdateSystemIntakeFundingSourcesNP clears and updates the funding sources of a system intake
func (*Store) UpdateSystemIntakeGRBReviewer ¶
func (s *Store) UpdateSystemIntakeGRBReviewer(ctx context.Context, tx *sqlx.Tx, reviewerID uuid.UUID, votingRole models.SystemIntakeGRBReviewerVotingRole, grbRole models.SystemIntakeGRBReviewerRole) (*models.SystemIntakeGRBReviewer, error)
func (*Store) UpdateSystemIntakeLinkedCedarSystem ¶
func (s *Store) UpdateSystemIntakeLinkedCedarSystem(ctx context.Context, id uuid.UUID, cedarSystemID null.String) (*models.SystemIntake, error)
UpdateSystemIntakeLinkedCedarSystem updates the CEDAR system ID that is linked to a system intake
func (*Store) UpdateSystemIntakeNP ¶
func (s *Store) UpdateSystemIntakeNP(ctx context.Context, np sqlutils.NamedPreparer, intake *models.SystemIntake) (*models.SystemIntake, error)
UpdateSystemIntakeNP does an upsert for a system intake The caller is responsible for setting intake.UpdatedAt if they want to update that field
The "NP" suffix stands for "NamedPreparer", as this function was written to avoid the need to update all of the existing code that uses UpdateSystemIntake to use a transactional wrapper.
func (*Store) UpdateSystemIntakeNote ¶
func (s *Store) UpdateSystemIntakeNote(ctx context.Context, note *models.SystemIntakeNote) (*models.SystemIntakeNote, error)
UpdateSystemIntakeNote updates all of a IT governance admin note's mutable fields. The note's IsArchived field _can_ be set, though SetNoteArchived() should be used when archiving a note.
func (*Store) UpdateTRBAdviceLetter ¶
func (s *Store) UpdateTRBAdviceLetter(ctx context.Context, letter *models.TRBAdviceLetter) (*models.TRBAdviceLetter, error)
UpdateTRBAdviceLetter updates all of a TRB advice letter's mutable fields. The letter's status _can_ be set, though UpdateTRBAdviceLetterStatus() should be used when setting a letter ready for review or sending a letter.
func (*Store) UpdateTRBAdviceLetterRecommendation ¶
func (s *Store) UpdateTRBAdviceLetterRecommendation(ctx context.Context, recommendation *models.TRBAdviceLetterRecommendation) (*models.TRBAdviceLetterRecommendation, error)
UpdateTRBAdviceLetterRecommendation updates an existing TRB advice letter recommendation record in the database This purposely does not update the position_in_letter column - to update that, use UpdateTRBAdviceLetterRecommendationOrder()
func (*Store) UpdateTRBAdviceLetterRecommendationOrder ¶
func (s *Store) UpdateTRBAdviceLetterRecommendationOrder( ctx context.Context, trbRequestID uuid.UUID, newOrder []uuid.UUID, ) ([]*models.TRBAdviceLetterRecommendation, error)
UpdateTRBAdviceLetterRecommendationOrder updates the ordering of recommendations for a given advice letter, using the order of the recommendation IDs passed in as newOrder. No other recommendation columns/fields are updated.
func (*Store) UpdateTRBAdviceLetterStatus ¶
func (s *Store) UpdateTRBAdviceLetterStatus(ctx context.Context, id uuid.UUID, status models.TRBAdviceLetterStatus) (*models.TRBAdviceLetter, error)
UpdateTRBAdviceLetterStatus sets the status of a TRB advice letter, for setting the letter as ready to review or sending the letter. When it sends the letter, it also updates the DateSent field.
func (*Store) UpdateTRBRequest ¶
func (s *Store) UpdateTRBRequest(ctx context.Context, trbRequest *models.TRBRequest) (*models.TRBRequest, error)
UpdateTRBRequest returns an TRBRequest from the db for a given id
func (*Store) UpdateTRBRequestAttendee ¶
func (s *Store) UpdateTRBRequestAttendee(ctx context.Context, attendee *models.TRBRequestAttendee) (*models.TRBRequestAttendee, error)
UpdateTRBRequestAttendee updates a TRB request attendee record in the database
func (*Store) UpdateTRBRequestForm ¶
func (s *Store) UpdateTRBRequestForm(ctx context.Context, form *models.TRBRequestForm) (*models.TRBRequestForm, error)
UpdateTRBRequestForm updates a TRB request form record in the database
func (*Store) UpdateTRBRequestFundingSources ¶
func (s *Store) UpdateTRBRequestFundingSources( ctx context.Context, trbRequestID uuid.UUID, fundingNumber string, fundingSources []*models.TRBFundingSource, ) ([]*models.TRBFundingSource, error)
UpdateTRBRequestFundingSources upserts a list of funding sources to a TRB Request Form by funding number
func (*Store) UpdateTRBRequestNP ¶
func (s *Store) UpdateTRBRequestNP(ctx context.Context, np sqlutils.NamedPreparer, trb *models.TRBRequest) (*models.TRBRequest, error)
UpdateTRBRequestNP takes in a NamedPreparer (db, tx) and returns an TRBRequest from the db for a given id
func (*Store) UserAccountCreate ¶
func (s *Store) UserAccountCreate(np sqlutils.NamedPreparer, userAccount *authentication.UserAccount) (*authentication.UserAccount, error)
UserAccountCreate creates a new user account for a given username
func (*Store) UserAccountGetByCommonName ¶
func (s *Store) UserAccountGetByCommonName(commonName string) (*authentication.UserAccount, error)
UserAccountGetByCommonName gets a user account by a give username
func (*Store) UserAccountGetByID ¶
func (s *Store) UserAccountGetByID(np sqlutils.NamedPreparer, id uuid.UUID) (*authentication.UserAccount, error)
UserAccountGetByID gets a User account from the database by its internal id.
func (*Store) UserAccountGetByUsername ¶
func (s *Store) UserAccountGetByUsername(username string) (*authentication.UserAccount, error)
UserAccountGetByUsername gets a user account by a give username
func (*Store) UserAccountUpdateByUserName ¶
func (s *Store) UserAccountUpdateByUserName(np sqlutils.NamedPreparer, userAccount *authentication.UserAccount) ( *authentication.UserAccount, error, )
UserAccountUpdateByUserName updates an existing user account for a given username
func (*Store) UserAccountsByIDs ¶
func (s *Store) UserAccountsByIDs(ctx context.Context, userIDs []uuid.UUID) ([]*authentication.UserAccount, error)
UserAccountsByIDs gets user accounts by user ID
Source Files ¶
- action.go
- business_case.go
- cedar_system_bookmark.go
- governance_request_feedback.go
- iam_db.go
- related_requests.go
- store.go
- system_intake.go
- system_intake_contact.go
- system_intake_contract_number.go
- system_intake_document.go
- system_intake_funding_source.go
- system_intake_grb_reviewer.go
- system_intake_note.go
- system_intake_system.go
- trb_admin_note.go
- trb_admin_note_trb_recommendation_link.go
- trb_admin_note_trb_request_document_link.go
- trb_advice_letter.go
- trb_advice_letter_recommendation.go
- trb_lead_option.go
- trb_request.go
- trb_request_attendee.go
- trb_request_contract_number.go
- trb_request_document.go
- trb_request_feedback.go
- trb_request_form.go
- trb_request_funding_source.go
- trb_request_system.go
- trb_request_system_intake.go
- truncate.go
- user_account_store.go