storage

package
v0.0.0-...-4dfcd00 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzedAuditGetByModelPlanIDsAndDate

func AnalyzedAuditGetByModelPlanIDsAndDate(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	modelPlanIDs []uuid.UUID,
	date time.Time,
) ([]*models.AnalyzedAudit, error)

AnalyzedAuditGetByModelPlanIDsAndDate gets and returns all AnalyzedAudits by modelPlanIDs and date

func AnalyzedAuditGetByModelPlanIDsAndDateLoader

func AnalyzedAuditGetByModelPlanIDsAndDateLoader(
	np sqlutils.NamedPreparer,
	paramTableJSON string,
) ([]*models.AnalyzedAudit, error)

AnalyzedAuditGetByModelPlanIDsAndDateLoader gets and returns all AnalyzedAudits by modelPlanIDs and date using a dataLoader

func AuditChangeCollectionGetByModelPlanIDandTimeRange

func AuditChangeCollectionGetByModelPlanIDandTimeRange(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	modelPlanID uuid.UUID,
	timeStart time.Time,
	timeEnd time.Time,
) ([]*models.AuditChange, error)

AuditChangeCollectionGetByModelPlanIDandTimeRange gets all audit_changes associated with a Model Plan for a specific date range It joins on the foreign key field to trace every relevant change back to it's parent model_plan_id. It currently knows how to handle model_plan_id, discussion_id, operational_need_id, and solution_id. If another level of relationships is added that point back to model_plan_id, this should be updated.

func AuditChangeGetNotProcessed

func AuditChangeGetNotProcessed(
	np sqlutils.NamedPreparer,
	_ zap.Logger,
) ([]*models.AuditChangeWithModelPlanID, error)

AuditChangeGetNotProcessed returns all audit changes that have yet to be processed in the processing queue

func AuditChangeWithModelPlanGetByID

func AuditChangeWithModelPlanGetByID(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	auditID int,
) (*models.AuditChangeWithModelPlanID, error)

func DiscussionReplyCreate

func DiscussionReplyCreate(
	logger *zap.Logger,
	reply *models.DiscussionReply,
	np sqlutils.NamedPreparer,
) (*models.DiscussionReply, error)

DiscussionReplyCreate creates a discussion reply the method is expected to be part of a larger transaction and does not handle committing or rolling back the transactions if the *sqlx.Tx is nil, this function will create one. The returned tx is the same as the one in the parameters.

func ExistingModelGetByID

func ExistingModelGetByID(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	id int,
) (*models.ExistingModel, error)

ExistingModelGetByID returns the existing model for a single model plan id

func GetChangesPerModelLoader

func GetChangesPerModelLoader(np sqlutils.NamedPreparer, _ *zap.Logger) ([]*models.ModelChangesAnalytics, error)

func GetMTOSolutionSelectedDetails

func GetMTOSolutionSelectedDetails(np sqlutils.NamedPreparer, solutionID uuid.UUID) (*email.MTOSolutionSelectedDB, error)

GetMTOSolutionSelectedDetails queries the database to return information that is useful

func GetNumberOfFollowersPerModelLoader

func GetNumberOfFollowersPerModelLoader(np sqlutils.NamedPreparer, _ *zap.Logger) ([]*models.ModelFollowersAnalytics, error)

func GetTotalNumberOfModelsLoader

func GetTotalNumberOfModelsLoader(np sqlutils.NamedPreparer, _ *zap.Logger) ([]*models.ModelCountAnalytics, error)

func MTOCategoryAndSubCategoriesGetByModelPlanIDLoader

func MTOCategoryAndSubCategoriesGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.MTOCategory, error)

MTOCategoryAndSubCategoriesGetByModelPlanIDLoader returns all mto categories for a slice of model plan ids

func MTOCategoryCreate

func MTOCategoryCreate(np sqlutils.NamedPreparer, _ *zap.Logger, MTOCategory *models.MTOCategory) (*models.MTOCategory, error)

MTOCategoryCreate creates a new MTOCategory in the database

func MTOCategoryCreateAllowConflicts

func MTOCategoryCreateAllowConflicts(np sqlutils.NamedPreparer, _ *zap.Logger, MTOCategory *models.MTOCategory) (*models.MTOCategory, error)

MTOCategoryCreateAllowConflicts creates a new MTOCategory in the database, but in the case of a conflict, instead just returns the conflicting row (and doesn't return an error) In all other ways, it is effectively equivalent to MTOCategoryCreate

func MTOCategoryDelete

func MTOCategoryDelete(tx *sqlx.Tx, actorUserID uuid.UUID, id uuid.UUID) error

MTOCategoryDelete deletes an existing MTOCategory from the database

func MTOCategoryGetByID

func MTOCategoryGetByID(np sqlutils.NamedPreparer, _ *zap.Logger, id uuid.UUID) (*models.MTOCategory, error)

MTOCategoryGetByID returns an existing MTOCategory from the database

func MTOCategoryGetByIDLoader

func MTOCategoryGetByIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, ids []uuid.UUID) ([]*models.MTOCategory, error)

MTOCategoryGetByIDLoader returns all categories by the provided

func MTOCategoryGetByModelPlanIDLoader

func MTOCategoryGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.MTOCategory, error)

MTOCategoryGetByModelPlanIDLoader returns all top level categories for a slice of model plan ids

func MTOCategoryUpdate

func MTOCategoryUpdate(np sqlutils.NamedPreparer, _ *zap.Logger, MTOCategory *models.MTOCategory) (*models.MTOCategory, error)

MTOCategoryUpdate updates a new MTOCategory in the database

func MTOCommonMilestoneGetByKeyLoader

func MTOCommonMilestoneGetByKeyLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []models.MTOCommonMilestoneKey) ([]*models.MTOCommonMilestone, error)

MTOCommonMilestoneGetByKeyLoader returns all common milestones for a slice of milestone keys

func MTOCommonMilestoneGetByModelPlanIDLoader

func MTOCommonMilestoneGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.MTOCommonMilestone, error)

MTOCommonMilestoneGetByModelPlanIDLoader returns all common milestones, with the context of the model plan id to determine if it was added or not if model plan id is null, contextual data will show up as false (is_added, is_suggested)

func MTOCommonSolutionContactGetByCommonSolutionKeyLoader

func MTOCommonSolutionContactGetByCommonSolutionKeyLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []models.MTOCommonSolutionKey) ([]*models.MTOCommonSolutionContact, error)

MTOCommonSolutionContactGetByCommonSolutionKeyLoader returns a list of common solution contacts associated with

func MTOCommonSolutionContactGetByIDsLoader

func MTOCommonSolutionContactGetByIDsLoader(np sqlutils.NamedPreparer, _ *zap.Logger, ids []uuid.UUID) ([]*models.MTOCommonSolutionContact, error)

func MTOCommonSolutionContactUnsetPrimaryContactByKey

func MTOCommonSolutionContactUnsetPrimaryContactByKey(np sqlutils.NamedPreparer, _ *zap.Logger, existingContact *models.MTOCommonSolutionContact) error

MTOCommonSolutionContactUnsetPrimaryContactByKey unsets the primary contact for a given common solution key.

func MTOCommonSolutionContractorGetByCommonSolutionKeyLoader

func MTOCommonSolutionContractorGetByCommonSolutionKeyLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []models.MTOCommonSolutionKey) ([]*models.MTOCommonSolutionContractor, error)

MTOCommonSolutionContractorGetByCommonSolutionKeyLoader returns a list of contractors associated with the given keys.

func MTOCommonSolutionContractorGetByIDLoader

func MTOCommonSolutionContractorGetByIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, ids []uuid.UUID) ([]*models.MTOCommonSolutionContractor, error)

MTOCommonSolutionContractorGetByIDLoader returns a list of contractors associated with the given keys.

func MTOCommonSolutionCreateContact

func MTOCommonSolutionCreateContact(np sqlutils.NamedPreparer, _ *zap.Logger, MTOCommonSolutionContact *models.MTOCommonSolutionContact) (*models.MTOCommonSolutionContact, error)

MTOCommonSolutionCreateContact creates a new MTOCommonSolutionContact in the database.

func MTOCommonSolutionCreateContractor

func MTOCommonSolutionCreateContractor(np sqlutils.NamedPreparer, _ *zap.Logger, contractor *models.MTOCommonSolutionContractor) (*models.MTOCommonSolutionContractor, error)

MTOCommonSolutionCreateContractor creates a new MTOCommonSolutionContractor in the database.

func MTOCommonSolutionCreateSystemOwner

func MTOCommonSolutionCreateSystemOwner(np sqlutils.NamedPreparer, _ *zap.Logger, systemOwner *models.MTOCommonSolutionSystemOwner) (*models.MTOCommonSolutionSystemOwner, error)

MTOCommonSolutionCreateSystemOwner creates a new MTOCommonSolutionSystemOwner in the database.

func MTOCommonSolutionDeleteContactByID

func MTOCommonSolutionDeleteContactByID(tx *sqlx.Tx, actorUserID uuid.UUID, _ *zap.Logger, id uuid.UUID) (*models.MTOCommonSolutionContact, error)

func MTOCommonSolutionDeleteContractorByID

func MTOCommonSolutionDeleteContractorByID(tx *sqlx.Tx, actorUserID uuid.UUID, _ *zap.Logger, id uuid.UUID) (*models.MTOCommonSolutionContractor, error)

MTOCommonSolutionDeleteContractorByID deletes a contractor by its ID.

func MTOCommonSolutionGetByCommonMilestoneKeyLoader

func MTOCommonSolutionGetByCommonMilestoneKeyLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []models.MTOCommonMilestoneKey) ([]*models.MTOCommonSolution, error)

MTOCommonSolutionGetByCommonMilestoneKeyLoader returns all common solutions associated with a Common Milestone Key

func MTOCommonSolutionGetByIDLoader

func MTOCommonSolutionGetByIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, ids []uuid.UUID) ([]*models.MTOCommonSolution, error)

MTOCommonSolutionGetByIDLoader returns all MTO common solutions associated by a list of ids

func MTOCommonSolutionGetByKeyLoader

func MTOCommonSolutionGetByKeyLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []models.MTOCommonSolutionKey) ([]*models.MTOCommonSolution, error)

MTOCommonSolutionGetByKeyLoader returns all Common Solutions associated by a list of keys

func MTOCommonSolutionGetByModelPlanIDLoader

func MTOCommonSolutionGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.MTOCommonSolution, error)

MTOCommonSolutionGetByModelPlanIDLoader returns all common solutions, with the context of the model plan id to determine if it was added or not if model plan id is null, contextual data will show up as false (is_added, is_suggested)

func MTOCommonSolutionGetContractorByID

func MTOCommonSolutionGetContractorByID(np sqlutils.NamedPreparer, _ *zap.Logger, id uuid.UUID) (*models.MTOCommonSolutionContractor, error)

MTOCommonSolutionGetContractorByID fetches a contractor by its ID.

func MTOCommonSolutionSystemOwnerDeleteByID

func MTOCommonSolutionSystemOwnerDeleteByID(tx *sqlx.Tx, actorUserID uuid.UUID, _ *zap.Logger, id uuid.UUID) (*models.MTOCommonSolutionSystemOwner, error)

MTOCommonSolutionSystemOwnerDeleteByID deletes a system owner by its ID.

func MTOCommonSolutionSystemOwnerGetByCommonSolutionKeyLoader

func MTOCommonSolutionSystemOwnerGetByCommonSolutionKeyLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []models.MTOCommonSolutionKey) ([]*models.MTOCommonSolutionSystemOwner, error)

MTOCommonSolutionSystemOwnerGetByCommonSolutionKeyLoader returns a list of system owners associated with the given keys.

func MTOCommonSolutionSystemOwnerGetByID

func MTOCommonSolutionSystemOwnerGetByID(np sqlutils.NamedPreparer, _ *zap.Logger, id uuid.UUID) (*models.MTOCommonSolutionSystemOwner, error)

MTOCommonSolutionSystemOwnerGetByID fetches a system owner by its ID.

func MTOCommonSolutionSystemOwnerGetByIDLoader

func MTOCommonSolutionSystemOwnerGetByIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, ids []uuid.UUID) ([]*models.MTOCommonSolutionSystemOwner, error)

MTOCommonSolutionSystemOwnerGetByIDLoader returns a list of system owners associated with the given IDs.

func MTOCommonSolutionSystemOwnerUpdate

func MTOCommonSolutionSystemOwnerUpdate(np sqlutils.NamedPreparer, _ *zap.Logger, systemOwner *models.MTOCommonSolutionSystemOwner) (*models.MTOCommonSolutionSystemOwner, error)

MTOCommonSolutionSystemOwnerUpdate updates an existing system owner.

func MTOCommonSolutionUpdateContact

func MTOCommonSolutionUpdateContact(np sqlutils.NamedPreparer, _ *zap.Logger, MTOCommonSolutionContact *models.MTOCommonSolutionContact) (*models.MTOCommonSolutionContact, error)

func MTOCommonSolutionUpdateContractor

func MTOCommonSolutionUpdateContractor(np sqlutils.NamedPreparer, _ *zap.Logger, contractor *models.MTOCommonSolutionContractor) (*models.MTOCommonSolutionContractor, error)

MTOCommonSolutionUpdateContractor updates an existing contractor.

func MTOInfoCreate

func MTOInfoCreate(np sqlutils.NamedPreparer, _ *zap.Logger, MTOInfo *models.MTOInfo) (*models.MTOInfo, error)

MTOInfoCreate creates a new MTOInfo in the database

func MTOInfoGetByModelPlanIDLoader

func MTOInfoGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.MTOInfo, error)

MTOInfoGetByModelPlanIDLoader returns all mto info records for a slice of model plan ids

func MTOInfoUpdate

func MTOInfoUpdate(np sqlutils.NamedPreparer, _ *zap.Logger, MTOInfo *models.MTOInfo) (*models.MTOInfo, error)

MTOInfoUpdate updates a new MTOInfo in the database

func MTOMilestoneCreate

func MTOMilestoneCreate(np sqlutils.NamedPreparer, _ *zap.Logger, MTOMilestone *models.MTOMilestone) (*models.MTOMilestone, error)

MTOMilestoneCreate creates a new MTOMilestone in the database

NOTE: This method is used for creating both Custom and Library-sourced (Common) milestones. It WILL return an error if you try to create one that has both custom info (like a `name`) and a CommonMilestoneKey This is controlled not by application code, but by constraints initially added in this migration: migrations/V185__Add_MTO_Milestone.sql

func MTOMilestoneDelete

func MTOMilestoneDelete(tx *sqlx.Tx, actorUserID uuid.UUID, _ *zap.Logger, milestoneID uuid.UUID) error

MTOMilestoneDelete deletes an MTOMilestone in the database

func MTOMilestoneGetByID

func MTOMilestoneGetByID(np sqlutils.NamedPreparer, _ *zap.Logger, id uuid.UUID) (*models.MTOMilestone, error)

MTOMilestoneGetByID returns an existing MTOMilestone from the database

func MTOMilestoneGetByIDLoader

func MTOMilestoneGetByIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, ids []uuid.UUID) ([]*models.MTOMilestone, error)

MTOMilestoneGetByIDLoader returns all milestones by the provided ids

func MTOMilestoneGetByModelPlanIDAndCategoryIDLoader

func MTOMilestoneGetByModelPlanIDAndCategoryIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []MTOMilestoneByModelPlanAndCategoryKey) ([]*models.MTOMilestone, error)

MTOMilestoneGetByModelPlanIDAndCategoryIDLoader returns mto milestones that are associated with a model plan id and category

func MTOMilestoneGetByModelPlanIDLoader

func MTOMilestoneGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.MTOMilestone, error)

MTOMilestoneGetByModelPlanIDLoader returns all top level categories for a slice of model plan ids

func MTOMilestoneGetByModelPlanIDNoLinkedSolutionLoader

func MTOMilestoneGetByModelPlanIDNoLinkedSolutionLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.MTOMilestone, error)

MTOMilestoneGetByModelPlanIDNoLinkedSolutionLoader returns all milestones by a model plan ID that are not linked to a solution

func MTOMilestoneGetBySolutionIDLoader

func MTOMilestoneGetBySolutionIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, solutionIDs []uuid.UUID) ([]*models.MTOMilestoneWithSolutionID, error)

func MTOMilestoneNoteCreate

func MTOMilestoneNoteCreate(np sqlutils.NamedPreparer, _ *zap.Logger, MTOMilestoneNote *models.MTOMilestoneNote) (*models.MTOMilestoneNote, error)

func MTOMilestoneNoteDelete

func MTOMilestoneNoteDelete(np sqlutils.NamedPreparer, _ *zap.Logger, MTOMilestoneNote *models.MTOMilestoneNote) (*models.MTOMilestoneNote, error)

func MTOMilestoneNoteGetByIDLoader

func MTOMilestoneNoteGetByIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, ids []uuid.UUID) ([]*models.MTOMilestoneNote, error)

MTOMilestoneNoteGetByIDLoader returns all milestone notes by the provided ids

func MTOMilestoneNoteGetByMilestoneIDLoader

func MTOMilestoneNoteGetByMilestoneIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, milestoneIDs []uuid.UUID) ([]*models.MTOMilestoneNote, error)

func MTOMilestoneNoteUpdate

func MTOMilestoneNoteUpdate(np sqlutils.NamedPreparer, _ *zap.Logger, MTOMilestoneNote *models.MTOMilestoneNote) (*models.MTOMilestoneNote, error)

func MTOMilestoneSolutionLinkCreate

func MTOMilestoneSolutionLinkCreate(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	mtoMilestoneSolutionLink *models.MTOMilestoneSolutionLink,
) (*models.MTOMilestoneSolutionLink, error)

MTOMilestoneSolutionLinkCreate creates a new MTO Milestone-Solution link in the database

func MTOMilestoneSolutionLinkGetByMilestoneID

func MTOMilestoneSolutionLinkGetByMilestoneID(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	milestoneID uuid.UUID,
) ([]*models.MTOMilestoneSolutionLink, error)

MTOMilestoneSolutionLinkGetByMilestoneID returns all MTO Milestone-Solution links for a given Milestone ID

func MTOMilestoneSolutionLinkMergeSolutionsToMilestones

func MTOMilestoneSolutionLinkMergeSolutionsToMilestones(
	tx *sqlx.Tx,
	_ *zap.Logger,
	milestoneID uuid.UUID,
	solutionIDs []uuid.UUID,
	actorID uuid.UUID,
) ([]*models.MTOSolution, error)

MTOMilestoneSolutionLinkMergeSolutionsToMilestones takes a list of solution ids, and will merge them to a milestone the end result is that solutions not included here have their link removed

func MTOMilestoneSolutionLinkMilestonesToSolution

func MTOMilestoneSolutionLinkMilestonesToSolution(
	tx *sqlx.Tx,
	logger *zap.Logger,
	solutionID uuid.UUID,
	milestoneIDs []uuid.UUID,
	actorID uuid.UUID,
) ([]*models.MTOMilestone, error)

MTOMilestoneSolutionLinkMilestonesToSolution takes a list of milestone IDs and links them to a solution. The end result is that milestones not included here are unlinked from the solution.

func MTOMilestoneUpdate

func MTOMilestoneUpdate(np sqlutils.NamedPreparer, _ *zap.Logger, MTOMilestone *models.MTOMilestone) (*models.MTOMilestone, error)

MTOMilestoneUpdate updates a new MTOMilestone in the database

NOTE: This method is used for updating both Custom and Library-sourced (Common) milestones. It WILL return an error if you try to update one that has both custom info (like a `name`) and a CommonMilestoneKey This is controlled not by application code, but by constraints initially added in this migration: migrations/V185__Add_MTO_Milestone.sql

func MTOSolutionCreate

func MTOSolutionCreate(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	mtoSolution *models.MTOSolution,
) (*models.MTOSolution, error)

MTOSolutionCreate creates a new MTOSolution in the database

func MTOSolutionCreateCommonAllowConflictsSQL

func MTOSolutionCreateCommonAllowConflictsSQL(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	commonSolutionKeys []models.MTOCommonSolutionKey,
	modelPlanID uuid.UUID,
	createdBy uuid.UUID,
) ([]*models.MTOSolutionWithNewlyInsertedStatus, error)

MTOSolutionCreateCommonAllowConflictsSQL takes a list of common solution keys for a model plan id, and inserts ones that don't exist it will return existing data, or newly inserted data

func MTOSolutionDelete

func MTOSolutionDelete(tx *sqlx.Tx, actorUserID uuid.UUID, _ *zap.Logger, milestoneID uuid.UUID) error

func MTOSolutionGetByCommonMilestoneKeyLoader

func MTOSolutionGetByCommonMilestoneKeyLoader(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	keys []models.MTOCommonMilestoneKey,
) ([]*models.MTOCommonSolution, error)

MTOSolutionGetByCommonMilestoneKeyLoader returns all solutions associated with a Common Milestone Key

func MTOSolutionGetByIDLoader

func MTOSolutionGetByIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, ids []uuid.UUID) ([]*models.MTOSolution, error)

MTOSolutionGetByIDLoader returns solutions by ID

func MTOSolutionGetByKeyLoader

func MTOSolutionGetByKeyLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []models.MTOCommonSolutionKey) ([]*models.MTOSolution, error)

MTOSolutionGetByKeyLoader returns all solutions associated by a list of keys

func MTOSolutionGetByMilestoneIDLoader

func MTOSolutionGetByMilestoneIDLoader(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	milestoneIDs []uuid.UUID,
) ([]*models.MTOSolutionWithMilestoneID, error)

func MTOSolutionGetByModelPlanIDAndFilterViewLoader

func MTOSolutionGetByModelPlanIDAndFilterViewLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []MTOSolutionByModelPlanIDAndFilterViewKey) ([]*models.MTOSolutionWithModelFilterView, error)

MTOSolutionGetByModelPlanIDAndFilterViewLoader returns all solutions associated with a model plan id and filter view

func MTOSolutionGetByModelPlanIDLoader

func MTOSolutionGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.MTOSolution, error)

MTOSolutionGetByModelPlanIDLoader returns all solutions, with the context of the model plan id to determine if it was added or not if model plan id is null, contextual data will show up as false (is_added, is_suggested)

func MTOSolutionUpdate

func MTOSolutionUpdate(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	mtoSolution *models.MTOSolution,
) (*models.MTOSolution, error)

MTOSolutionUpdate updates a new MTOSolution in the database

func MTOSubcategoryGetByParentIDLoader

func MTOSubcategoryGetByParentIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, parentIDs []uuid.UUID) ([]*models.MTOSubcategory, error)

MTOSubcategoryGetByParentIDLoader returns the categories that are sub categories for a slice of category ids Note, this returns the object as a subcategory, but it is the same table

func ModelPlanCollectionApproachingClearance

func ModelPlanCollectionApproachingClearance(np sqlutils.NamedPreparer, logger *zap.Logger) ([]*models.ModelPlan, error)

func ModelPlansGetByModePlanIDsLOADER

func ModelPlansGetByModePlanIDsLOADER(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.ModelPlan, error)

func OperationalSolutionAndPossibleCollectionGetByOperationalNeedIDLOADER

func OperationalSolutionAndPossibleCollectionGetByOperationalNeedIDLOADER(np sqlutils.NamedPreparer, _ *zap.Logger, keys []SolutionAndPossibleKey) ([]*models.OperationalSolution, error)

OperationalSolutionAndPossibleCollectionGetByOperationalNeedIDLOADER returns an array of

func OperationalSolutionGetByIDLOADER

func OperationalSolutionGetByIDLOADER(np sqlutils.NamedPreparer, logger *zap.Logger, ids []uuid.UUID) ([]*models.OperationalSolution, error)

OperationalSolutionGetByIDLOADER returns an operational solution by ID using a DataLoader

func OperationalSolutionGetByIDWithNumberOfSubtasks

func OperationalSolutionGetByIDWithNumberOfSubtasks(np sqlutils.NamedPreparer, _ *zap.Logger, id uuid.UUID) (*models.OperationalSolutionWithNumberOfSubtasks, error)

OperationalSolutionGetByIDWithNumberOfSubtasks returns an operational solution by ID, along with a count of the number of subtasks

func PlanBasicsGetByModelPlanIDLoader

func PlanBasicsGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.PlanBasics, error)

PlanBasicsGetByModelPlanIDLoader returns the plan basics for a slice of model plan ids

func PlanCollaboratorGetIDLOADER

func PlanCollaboratorGetIDLOADER(
	np sqlutils.NamedPreparer,
	paramTableJSON string,
) ([]*models.PlanCollaborator, error)

PlanCollaboratorGetIDLOADER returns the plan collaborators corresponding to an array of plan collaborator IDs stored in JSON array

func PlanDataExchangeApproachCreate

func PlanDataExchangeApproachCreate(np sqlutils.NamedPreparer, _ *zap.Logger, approach *models.PlanDataExchangeApproach) (*models.PlanDataExchangeApproach, error)

PlanDataExchangeApproachCreate creates a new plan data exchange approach

func PlanDataExchangeApproachGetByID

func PlanDataExchangeApproachGetByID(np sqlutils.NamedPreparer, _ *zap.Logger, id uuid.UUID) (*models.PlanDataExchangeApproach, error)

PlanDataExchangeApproachGetByID returns the plan data exchange approach for a given id

func PlanDataExchangeApproachGetByModelPlanIDLoader

func PlanDataExchangeApproachGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.PlanDataExchangeApproach, error)

PlanDataExchangeApproachGetByModelPlanIDLoader returns the plan date exchange approach for a slice of model plan ids

func PlanDataExchangeApproachUpdate

func PlanDataExchangeApproachUpdate(np sqlutils.NamedPreparer, logger *zap.Logger, approach *models.PlanDataExchangeApproach) (*models.PlanDataExchangeApproach, error)

PlanDataExchangeApproachUpdate updates the plan data exchange approach for a given id

func PlanDiscussionByIDWithNumberOfReplies

func PlanDiscussionByIDWithNumberOfReplies(np sqlutils.NamedPreparer, _ *zap.Logger, id uuid.UUID, timeToCheck time.Time) (*models.PlanDiscussionWithNumberOfReplies, error)

PlanDiscussionByIDWithNumberOfReplies retrieves the plan discussion for a given id, and also returns the number of replies the discussion has

func PlanDiscussionGetByModelPlanIDLOADER

func PlanDiscussionGetByModelPlanIDLOADER(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	modelPlanIDs []uuid.UUID,
) ([]*models.PlanDiscussion, error)

PlanDiscussionGetByModelPlanIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func PlanDocumentGetByIDNoS3Check

func PlanDocumentGetByIDNoS3Check(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	id uuid.UUID,
) (*models.PlanDocument, error)

PlanDocumentGetByIDNoS3Check gets a plan document object by id

func PlanFavoriteGetCollectionByUserID

func PlanFavoriteGetCollectionByUserID(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	userAccountID uuid.UUID,
) ([]*models.PlanFavorite, error)

PlanFavoriteGetCollectionByUserID returns plan favorites by userID

func PlanTimelineGetByModelPlanIDLoader

func PlanTimelineGetByModelPlanIDLoader(np sqlutils.NamedPreparer, _ *zap.Logger, modelPlanIDs []uuid.UUID) ([]*models.PlanTimeline, error)

PlanTimelineGetByModelPlanIDLoader returns the planTimeline for a slice of model plan ids

func PossibleOperationalSolutionGetByKeys

func PossibleOperationalSolutionGetByKeys(np sqlutils.NamedPreparer, logger *zap.Logger, solKeys []models.OperationalSolutionKey) ([]*models.PossibleOperationalSolution, error)

PossibleOperationalSolutionGetByKeys returns a collection of possible operational solutions by a provided list of keys

func TagCollectionCreate

func TagCollectionCreate(np sqlutils.NamedPreparer, _ *zap.Logger, tags []*models.Tag, createdBy uuid.UUID) ([]*models.Tag, error)

TagCollectionCreate creates an array of tags in the database based on the tag context provided in the string the method is expected to be part of a larger transaction and does not handle committing or rolling back the transactions

func TranslatedAuditCollectionGetByModelPlanID

func TranslatedAuditCollectionGetByModelPlanID(np sqlutils.NamedPreparer, modelPlanID uuid.UUID, tablesToInclude []models.TableName, hasRestrictedAccess bool, limit *int, offset *int) ([]*models.TranslatedAudit, error)

TranslatedAuditCollectionGetByModelPlanID returns all translatedAudits for a given model plan id tablesToInclude: the tables to include in the query. This is a list of models.TableName. If nil or empty, include all hasRestrictedAccess: whether or not to show restricted records limit: this controls how many records will be returned at once. A null entry will return all records offset: how many records to skip before returning results. If null, no records will be skipped.

func TranslatedAuditCreate

func TranslatedAuditCreate(np sqlutils.NamedPreparer, translatedAudit *models.TranslatedAudit) (*models.TranslatedAudit, error)

TranslatedAuditCreate creates a TranslatedAudit in the database, using the values passed in the translatedAudit parameter

func TranslatedAuditFieldCollectionGetByTranslatedAuditIDLoader

func TranslatedAuditFieldCollectionGetByTranslatedAuditIDLoader(np sqlutils.NamedPreparer, paramTableJSON string) ([]*models.TranslatedAuditField, error)

TranslatedAuditFieldCollectionGetByTranslatedAuditIDLoader returns all TranslatedAuditFields for a translated audit id

func TranslatedAuditFieldCreate

func TranslatedAuditFieldCreate(np sqlutils.NamedPreparer, translatedAuditField *models.TranslatedAuditField) (*models.TranslatedAuditField, error)

TranslatedAuditFieldCreate creates a TranslatedAuditField in the database, using the values passed in the translatedAuditField parameter

func TranslatedAuditFieldCreateCollection

func TranslatedAuditFieldCreateCollection(np sqlutils.NamedPreparer, translatedAuditFields []*models.TranslatedAuditField) ([]*models.TranslatedAuditField, error)

TranslatedAuditFieldCreateCollection creates a TranslatedAuditField in the database, using the values passed in the translatedAuditFields parameter

func TranslatedAuditMostRecentGetByModelPlanIDAndTableNamesLoader

func TranslatedAuditMostRecentGetByModelPlanIDAndTableNamesLoader(np sqlutils.NamedPreparer, _ *zap.Logger, keys []MostRecentByModelPlanIDAndTableFilters) ([]*models.TranslatedAuditWithFilteredView, error)

TranslatedAuditMostRecentGetByModelPlanIDAndTableNamesLoader returns the most recent TranslatedAudit for a given model plan id and table names it serializes the params into a json array and passes it to the sql query it will return only the most recent for each combination

func TranslatedAuditQueueGetByID

func TranslatedAuditQueueGetByID(np sqlutils.NamedPreparer, id uuid.UUID) (*models.TranslatedAuditQueue, error)

TranslatedAuditQueueGetByID returns a translatedAuditQueue for a given id

func TranslatedAuditQueueGetEntriesToQueue

func TranslatedAuditQueueGetEntriesToQueue(np sqlutils.NamedPreparer) ([]*models.TranslatedAuditQueue, error)

TranslatedAuditQueueGetEntriesToQueue returns a translatedAuditQueue entries that are ready to be queued (the record was created by the audit trigger)

func TranslatedAuditQueueGetQueued

func TranslatedAuditQueueGetQueued(np sqlutils.NamedPreparer) ([]*models.TranslatedAuditQueue, error)

TranslatedAuditQueueGetQueued returns a translatedAuditQueue entries that are already queued

func TranslatedAuditQueueUpdate

func TranslatedAuditQueueUpdate(
	np sqlutils.NamedPreparer,
	logger *zap.Logger,
	translatedAuditQueue *models.TranslatedAuditQueue) (*models.TranslatedAuditQueue, error)

TranslatedAuditQueueUpdate updates a TranslatedAuditQueue record in the database

func UserAccountGetByID

func UserAccountGetByID(np sqlutils.NamedPreparer, id uuid.UUID) (*authentication.UserAccount, error)

UserAccountGetByID gets a User account from the database by its internal id.

func UserAccountGetByUsername

func UserAccountGetByUsername(np sqlutils.NamedPreparer, username string) (*authentication.UserAccount, error)

UserAccountGetByUsername gets a user account by a give username

func UserAccountGetLeadModelPlanCount

func UserAccountGetLeadModelPlanCount(np sqlutils.NamedPreparer, userID uuid.UUID) (int, error)

UserAccountGetLeadModelPlanCount returns the count of model plans where the user is a lead.

func UserAccountGetNotificationPreferencesForDataExchangeApproachMarkedComplete

func UserAccountGetNotificationPreferencesForDataExchangeApproachMarkedComplete(
	np sqlutils.NamedPreparer,
	modelPlanID uuid.UUID,
) ([]*models.UserAccountAndNotificationPreferences, error)

UserAccountGetNotificationPreferencesForDataExchangeApproachMarkedComplete returns a collection of user accounts that should be notified of when a data exchange approach is marked complete

func UserAccountInsertByUsername

func UserAccountInsertByUsername(np sqlutils.NamedPreparer, userAccount *authentication.UserAccount) (*authentication.UserAccount, error)

UserAccountInsertByUsername creates a new user account for a given username

func UserAccountUpdateByUserName

func UserAccountUpdateByUserName(np sqlutils.NamedPreparer, userAccount *authentication.UserAccount) (
	*authentication.UserAccount,
	error,
)

UserAccountUpdateByUserName updates an existing user account for a given username

func UserNotificationPreferencesCreate

func UserNotificationPreferencesCreate(np sqlutils.NamedPreparer, userNotificationPreferences *models.UserNotificationPreferences) (*models.UserNotificationPreferences, error)

UserNotificationPreferencesCreate creates a new UserNotificationPreferences in the database

func UserNotificationPreferencesGetByUserID

func UserNotificationPreferencesGetByUserID(np sqlutils.NamedPreparer, userID uuid.UUID) (*models.UserNotificationPreferences, error)

UserNotificationPreferencesGetByUserID returns a UserNotificationPreferences object for a given user_id in the database Note this should only be used for cases when a data loader is not possible to use directly.

func UserNotificationPreferencesGetByUserIDLoader

func UserNotificationPreferencesGetByUserIDLoader(np sqlutils.NamedPreparer, paramTableJSON string) ([]*models.UserNotificationPreferences, error)

UserNotificationPreferencesGetByUserIDLoader returns a collection of UserNotificationPreferences object for a given collection of user_ids, serialized in json

func UserNotificationPreferencesUpdate

func UserNotificationPreferencesUpdate(np sqlutils.NamedPreparer, userNotificationPreferences *models.UserNotificationPreferences) (*models.UserNotificationPreferences, error)

UserNotificationPreferencesUpdate updates a new UserNotificationPreferences in the database

func UserViewCustomizationCreate

func UserViewCustomizationCreate(
	np sqlutils.NamedPreparer,
	userViewCustomization *models.UserViewCustomization,
) (*models.UserViewCustomization, error)

UserViewCustomizationCreate creates a new UserViewCustomization in the database

func UserViewCustomizationGetByUserID

func UserViewCustomizationGetByUserID(
	np sqlutils.NamedPreparer,
	userID uuid.UUID,
) (*models.UserViewCustomization, error)

UserViewCustomizationGetByUserID returns a UserViewCustomization object for a given user_id in the database

func UserViewCustomizationUpdate

func UserViewCustomizationUpdate(
	np sqlutils.NamedPreparer,
	userViewCustomization *models.UserViewCustomization,
) (*models.UserViewCustomization, error)

UserViewCustomizationUpdate updates a new UserViewCustomization in the database

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 MTOMilestoneByModelPlanAndCategoryKey

type MTOMilestoneByModelPlanAndCategoryKey struct {
	// ModelPlanID is the model plan the milestone is in reference to
	ModelPlanID uuid.UUID `json:"model_plan_id"`
	// MTOCategoryID is the category the milestone is associated with. Note, this can be null
	MTOCategoryID uuid.UUID `json:"mto_category_id"`
}

MTOMilestoneByModelPlanAndCategoryKey is a key to get MTO milestones by a model plan id and category combination

type MTOSolutionByModelPlanIDAndFilterViewKey

type MTOSolutionByModelPlanIDAndFilterViewKey struct {
	// ModelPlanID is the ID of the model plan
	ModelPlanID uuid.UUID `json:"model_plan_id"`
	// FilterView is the filter view to be applied
	FilterView models.ModelViewFilter `json:"filter_view"`
}

MTOSolutionByModelPlanIDAndFilterViewKey is a struct that holds the model plan ID and filter view

type MostRecentByModelPlanIDAndTableFilters

type MostRecentByModelPlanIDAndTableFilters struct {
	// ModelPlanID is the ID of the model plan
	ModelPlanID uuid.UUID `json:"model_plan_id"`

	// IsAdmin specifies if the user is an admin
	// this controls if sensitive data is shown, admins can see everything as well as collaborators.
	IsAdmin bool `json:"is_admin"`

	// TableFilters is the list of tableNames that are used to find a result.
	// It really uses  models.TableName as the type, but must be comparable to work with a dataloader
	// We make a compromise here to fit the dataloader interface
	TableNames string `json:"table_names"`

	// ExcludedFields is a list of fields to exclude from the result.
	// It is provided as a string to  fit the comparable interface
	ExcludedFields string `json:"excluded_fields"`
}

MostRecentByModelPlanIDAndTableFilters is a key to get the most recent record by model plan ID and table filters Note, if desired we could also introduce a limit param which would allow you to dynamically address how many entries get returned per key

type SolutionAndPossibleKey

type SolutionAndPossibleKey struct {
	// OperationalNeedID is the ID of the need that a solution is associated with
	OperationalNeedID uuid.UUID `json:"operational_need_id"`
	// IncludeNotNeeded specifies if the query should return solutions with a status of not needed, or if possible solutions (not discrete records) should be included
	IncludeNotNeeded bool `json:"include_not_needed"`
}

SolutionAndPossibleKey is a key to get a operational solution and possible operational solution

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store performs database operations for MINT

func NewStore

func NewStore(
	dbConfig DBConfig,
	ldClient *ld.LDClient,
) (*Store, error)

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) AnalyzedAuditCreate

func (s *Store) AnalyzedAuditCreate(
	logger *zap.Logger,
	AnalyzedAudit *models.AnalyzedAudit,
) (*models.AnalyzedAudit, error)

AnalyzedAuditCreate creates and returns an AnalyzedAudit object

func (*Store) AnalyzedAuditGetByDate

func (s *Store) AnalyzedAuditGetByDate(_ *zap.Logger, date time.Time) ([]*models.AnalyzedAudit, error)

AnalyzedAuditGetByDate gets and returns all AnalyzedAudits by date

func (*Store) AnalyzedAuditGetByModelPlanIDAndDate

func (s *Store) AnalyzedAuditGetByModelPlanIDAndDate(
	_ *zap.Logger,
	modelPlanID uuid.UUID,
	date time.Time,
) (*models.AnalyzedAudit, error)

AnalyzedAuditGetByModelPlanIDAndDate gets and returns all AnalyzedAudits by modelPlanID

func (*Store) AuditChangeCollectionByIDAndTable

func (s *Store) AuditChangeCollectionByIDAndTable(
	_ *zap.Logger,
	tableName models.TableName,
	primaryKey uuid.UUID,
) ([]*models.AuditChange, error)

AuditChangeCollectionByIDAndTable returns changes based on tablename and primary key from the database

func (*Store) AuditChangeCollectionByIDAndTableAndField

func (s *Store) AuditChangeCollectionByIDAndTableAndField(
	_ *zap.Logger,
	tableName string,
	primaryKey uuid.UUID,
	fieldName string,
	sortDir models.SortDirection,
) ([]*models.AuditChange, error)

AuditChangeCollectionByIDAndTableAndField returns changes based on tablename and primary key from the database. It will only return record sets where the given field was modified. It will return all changed fields anywyas

func (*Store) AuditChangeCollectionByPrimaryKeyOrForeignKeyAndDate

func (s *Store) AuditChangeCollectionByPrimaryKeyOrForeignKeyAndDate(
	_ *zap.Logger,
	primaryKey uuid.UUID,
	foreignKey uuid.UUID,
	dayToAnalyze time.Time,
	sortDir models.SortDirection,
) ([]*models.AuditChange, error)

AuditChangeCollectionByPrimaryKeyOrForeignKeyAndDate returns changes based on foreign key and date from the database.

func (*Store) Beginx

func (s *Store) Beginx() (*sqlx.Tx, error)

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) CheckIfCollaborator

func (s *Store) CheckIfCollaborator(_ *zap.Logger, principalID uuid.UUID, modelPlanID uuid.UUID) (bool, error)

CheckIfCollaborator returns true if the principal is a collaborator on a model plan.

func (*Store) CheckIfCollaboratorByDiscussionID

func (s *Store) CheckIfCollaboratorByDiscussionID(
	_ *zap.Logger,
	principalID uuid.UUID,
	discussionID uuid.UUID,
) (bool, error)

CheckIfCollaboratorByDiscussionID returns true if the principal is a collaborator on a model plan, by the relation on the plan discussion

func (*Store) CheckIfCollaboratorByOperationalNeedID

func (s *Store) CheckIfCollaboratorByOperationalNeedID(
	_ *zap.Logger,
	principalID uuid.UUID,
	operationalNeedID uuid.UUID,
) (bool, error)

CheckIfCollaboratorByOperationalNeedID returns true if the principal is a collaborator on a model plan associated with a OperationalNeed by OperationalNeedID.

func (*Store) CheckIfCollaboratorBySolutionID

func (s *Store) CheckIfCollaboratorBySolutionID(
	_ *zap.Logger,
	principalID uuid.UUID,
	solutionID uuid.UUID,
) (bool, error)

CheckIfCollaboratorBySolutionID returns true if the principal is a collaborator on a model plan associated with a Solution by SolutionID.

func (*Store) DiscussionReplyByID

func (s *Store) DiscussionReplyByID(_ *zap.Logger, id uuid.UUID) (*models.DiscussionReply, error)

DiscussionReplyByID retrieves the discussion reply for a given id

func (*Store) DiscussionReplyDelete

func (s *Store) DiscussionReplyDelete(logger *zap.Logger, id uuid.UUID, userID uuid.UUID) (*models.DiscussionReply, error)

DiscussionReplyDelete deletes the discussion reply for a given id

func (*Store) DiscussionReplyGetByDiscussionIDLOADER

func (s *Store) DiscussionReplyGetByDiscussionIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.DiscussionReply, error)

DiscussionReplyGetByDiscussionIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) DiscussionReplyUpdate

func (s *Store) DiscussionReplyUpdate(
	logger *zap.Logger,
	reply *models.DiscussionReply,
) (*models.DiscussionReply, error)

DiscussionReplyUpdate updates a discussion reply object

func (*Store) ExistingModelCollectionGet

func (s *Store) ExistingModelCollectionGet(_ *zap.Logger) ([]*models.ExistingModel, error)

ExistingModelCollectionGet returns a list of existing models

func (*Store) ExistingModelGetByIDLOADER

func (s *Store) ExistingModelGetByIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.ExistingModel, error)

ExistingModelGetByIDLOADER returns the existing model for a slice of model plan ids

func (*Store) ExistingModelLinkGetByID

func (s *Store) ExistingModelLinkGetByID(logger *zap.Logger, id uuid.UUID) (*models.ExistingModelLink, error)

ExistingModelLinkGetByID returns an an existing model link by ID

func (*Store) ExistingModelLinkGetByModelPlanIDAndFieldNameLOADER

func (s *Store) ExistingModelLinkGetByModelPlanIDAndFieldNameLOADER(
	logger *zap.Logger,
	paramTableJSON string,
) ([]*models.ExistingModelLink, error)

ExistingModelLinkGetByModelPlanIDAndFieldNameLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) ExistingModelLinksUpdate

func (s *Store) ExistingModelLinksUpdate(
	logger *zap.Logger,
	userID uuid.UUID,
	modelPlanID uuid.UUID,
	fieldName models.ExisitingModelLinkFieldType,
	existingModelIDs []int,
	currentModelPlanIDs []uuid.UUID,
) ([]*models.ExistingModelLink, error)

ExistingModelLinksUpdate creates a new links that don't yet exist, deletes ones that are no longer provided,

func (*Store) GetDiscussionReplyDetailsForEmail

func (s *Store) GetDiscussionReplyDetailsForEmail(discussionID uuid.UUID) ([]*email.DiscussionReplyEmailContentDB, error)

GetDiscussionReplyDetailsForEmail returns Discussion replies along with user account information for each reply. It is sorted by the database with the newest replies going to oldest replies.

func (*Store) GetExistingModelLinkNamesByModelPlanIDAndFieldNameLOADER

func (s *Store) GetExistingModelLinkNamesByModelPlanIDAndFieldNameLOADER(
	logger *zap.Logger,
	paramTableJSON string,
) ([]*models.ExistingModelLinks, error)

GetExistingModelLinkNamesByModelPlanIDAndFieldNameLOADER returns the plan GeneralCharacteristics for a slice of model plan ids and field Names

func (*Store) GetMostRecentDiscussionRoleSelection

func (s *Store) GetMostRecentDiscussionRoleSelection(
	logger *zap.Logger,
	userID uuid.UUID,
) (*models.DiscussionRoleSelection, error)

GetMostRecentDiscussionRoleSelection retrieves the latest role selection for a given user

func (*Store) GetOperationalSolutionSelectedDetails

func (s *Store) GetOperationalSolutionSelectedDetails(solutionID uuid.UUID) (*email.OperationalSolutionSelectedDB, error)

GetOperationalSolutionSelectedDetails queries the database to return information that is useful

func (*Store) ModelPlanCollection

func (s *Store) ModelPlanCollection(logger *zap.Logger, archived bool) ([]*models.ModelPlan, error)

ModelPlanCollection returns a list of all model plans (whether or not you're a collaborator)

func (*Store) ModelPlanCollectionCollaboratorOnly

func (s *Store) ModelPlanCollectionCollaboratorOnly(
	logger *zap.Logger,
	archived bool,
	userID uuid.UUID,
) ([]*models.ModelPlan, error)

ModelPlanCollectionCollaboratorOnly returns a list of all model plans for which the user_accountID supplied is a collaborator.

func (*Store) ModelPlanCollectionFavorited

func (s *Store) ModelPlanCollectionFavorited(
	logger *zap.Logger,
	archived bool,
	userID uuid.UUID,
) ([]*models.ModelPlan, error)

ModelPlanCollectionFavorited returns a list of all model plans which are favorited by the user Note: Externally, this is called "followed" but internally we call it "favorited"

func (*Store) ModelPlanCollectionWithCRTDLS

func (s *Store) ModelPlanCollectionWithCRTDLS(logger *zap.Logger, archived bool) ([]*models.ModelPlan, error)

ModelPlanCollectionWithCRTDLS returns a list of all model plans for which the there are CRTDls

func (*Store) ModelPlanCreate

func (s *Store) ModelPlanCreate(np sqlutils.NamedPreparer, logger *zap.Logger, plan *models.ModelPlan) (*models.ModelPlan, error)

ModelPlanCreate creates a model plan using a transaction

func (*Store) ModelPlanDeleteByID

func (s *Store) ModelPlanDeleteByID(logger *zap.Logger, id uuid.UUID) (sql.Result, error)

ModelPlanDeleteByID deletes a model plan for a given ID

func (*Store) ModelPlanGetByID

func (s *Store) ModelPlanGetByID(np sqlutils.NamedPreparer, logger *zap.Logger, id uuid.UUID) (*models.ModelPlan, error)

ModelPlanGetByID returns a model plan for a given ID

func (*Store) ModelPlanGetByModelPlanIDLOADER

func (s *Store) ModelPlanGetByModelPlanIDLOADER(_ *zap.Logger, paramTableJSON string) ([]*models.ModelPlan, error)

ModelPlanGetByModelPlanIDLOADER returns the model plan for a slice of ids

func (*Store) ModelPlanGetByName

func (s *Store) ModelPlanGetByName(logger *zap.Logger, modelName string) (*models.ModelPlan, error)

ModelPlanGetByName returns a model plan for a given ID

func (*Store) ModelPlanGetByOperationalSolutionKey

func (s *Store) ModelPlanGetByOperationalSolutionKey(
	logger *zap.Logger,
	opSolKey models.OperationalSolutionKey,
) ([]*models.ModelPlanAndPossibleOperationalSolution, error)

func (*Store) ModelPlanGetTaskListStatus

func (s *Store) ModelPlanGetTaskListStatus(logger *zap.Logger, modelPlanID uuid.UUID) (models.TaskStatus, error)

func (*Store) ModelPlanOpSolutionLastModifiedDtsGetByModelPlanIDLOADER

func (s *Store) ModelPlanOpSolutionLastModifiedDtsGetByModelPlanIDLOADER(logger *zap.Logger, paramTableJSON string) (
	map[string]time.Time,
	error,
)

ModelPlanOpSolutionLastModifiedDtsGetByModelPlanIDLOADER returns the most recent tracking dates for a series of model plans

func (*Store) ModelPlanUpdate

func (s *Store) ModelPlanUpdate(logger *zap.Logger, plan *models.ModelPlan) (*models.ModelPlan, error)

ModelPlanUpdate updates a model plan

func (*Store) NDAAgreementCreate

func (s *Store) NDAAgreementCreate(_ *zap.Logger, nda *models.NDAAgreement) (*models.NDAAgreement, error)

NDAAgreementCreate creates a new nda agreement based on an EUA

func (*Store) NDAAgreementGetByUserID

func (s *Store) NDAAgreementGetByUserID(_ *zap.Logger, userID uuid.UUID) (*models.NDAAgreement, error)

NDAAgreementGetByUserID returns an NDA based on a UserID

func (*Store) NDAAgreementUpdate

func (s *Store) NDAAgreementUpdate(_ *zap.Logger, nda *models.NDAAgreement) (*models.NDAAgreement, error)

NDAAgreementUpdate updates an nda agreement based on userID

func (*Store) OperationalNeedCollectionGetByModelPlanID

func (s *Store) OperationalNeedCollectionGetByModelPlanID(
	_ *zap.Logger,
	modelPlanID uuid.UUID,
) ([]*models.OperationalNeed, error)

OperationalNeedCollectionGetByModelPlanID returns possible and existing OperationalNeeds associated to a model plan

func (*Store) OperationalNeedCollectionGetByModelPlanIDLOADER

func (s *Store) OperationalNeedCollectionGetByModelPlanIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.OperationalNeed, error)

OperationalNeedCollectionGetByModelPlanIDLOADER returns OperationalNeeds utilizing a Data Loader

func (*Store) OperationalNeedGetByID

func (s *Store) OperationalNeedGetByID(_ *zap.Logger, id uuid.UUID) (*models.OperationalNeed, error)

OperationalNeedGetByID returns an Operational Need by its ID

func (*Store) OperationalNeedGetByModelPlanIDAndOtherType

func (s *Store) OperationalNeedGetByModelPlanIDAndOtherType(
	_ *zap.Logger,
	modelPlanID uuid.UUID,
	customNeedType string,
) (*models.OperationalNeed, error)

OperationalNeedGetByModelPlanIDAndOtherType existing OperationalNeed associated to a model plan by id and custom type

func (*Store) OperationalNeedGetByModelPlanIDAndType

func (s *Store) OperationalNeedGetByModelPlanIDAndType(
	_ *zap.Logger,
	modelPlanID uuid.UUID,
	needKey models.OperationalNeedKey,
) (*models.OperationalNeed, error)

OperationalNeedGetByModelPlanIDAndType existing OperationalNeed associated to a model plan by id and type

func (*Store) OperationalNeedInsertAllPossible

func (s *Store) OperationalNeedInsertAllPossible(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	modelPlanID uuid.UUID,
	createdBy uuid.UUID,
) ([]*models.OperationalNeed, error)

OperationalNeedInsertAllPossible will insert all possible operational need in the DB for a specific model pland

func (*Store) OperationalNeedInsertOrUpdate

func (s *Store) OperationalNeedInsertOrUpdate(
	logger *zap.Logger,
	need *models.OperationalNeed,
	needTypeKey models.OperationalNeedKey,
) (*models.OperationalNeed, error)

OperationalNeedInsertOrUpdate either inserts or updates an operational need in the DB

func (*Store) OperationalNeedInsertOrUpdateOther

func (s *Store) OperationalNeedInsertOrUpdateOther(
	logger *zap.Logger,
	need *models.OperationalNeed,
	customNeedType string,
) (*models.OperationalNeed, error)

OperationalNeedInsertOrUpdateOther either inserts or updates a custom operational need in the DB

func (*Store) OperationalNeedUpdateByID

func (s *Store) OperationalNeedUpdateByID(
	logger *zap.Logger,
	need *models.OperationalNeed,
) (*models.OperationalNeed, error)

OperationalNeedUpdateByID will update an operational need in the DB

func (*Store) OperationalSolutionAndPossibleCollectionGetByOperationalNeedIDLOADER

func (s *Store) OperationalSolutionAndPossibleCollectionGetByOperationalNeedIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.OperationalSolution, error)

OperationalSolutionAndPossibleCollectionGetByOperationalNeedIDLOADER returns Operational Solutions that match the paramTable JSON

func (*Store) OperationalSolutionGetByID

func (s *Store) OperationalSolutionGetByID(_ *zap.Logger, id uuid.UUID) (*models.OperationalSolution, error)

OperationalSolutionGetByID returns an operational solution by ID

func (*Store) OperationalSolutionInsert

func (s *Store) OperationalSolutionInsert(
	logger *zap.Logger,
	solution *models.OperationalSolution,
	solutionTypeKey *models.OperationalSolutionKey,
) (*models.OperationalSolution, error)

OperationalSolutionInsert inserts an operational solution if it already exists

func (*Store) OperationalSolutionSubtaskDelete

func (s *Store) OperationalSolutionSubtaskDelete(
	logger *zap.Logger,
	id uuid.UUID,
	userID uuid.UUID,
) (sql.Result, error)

OperationalSolutionSubtaskDelete deletes an operational solution subtask by id

func (*Store) OperationalSolutionSubtaskGetByID

func (s *Store) OperationalSolutionSubtaskGetByID(
	_ *zap.Logger,
	subtaskID uuid.UUID,
) (*models.OperationalSolutionSubtask, error)

OperationalSolutionSubtaskGetByID gets a models.OperationalSolutionSubtask by ID

func (*Store) OperationalSolutionSubtaskGetByModelPlanIDLOADER

func (s *Store) OperationalSolutionSubtaskGetByModelPlanIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.OperationalSolutionSubtask, error)

OperationalSolutionSubtaskGetByModelPlanIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) OperationalSolutionSubtasksCreate

func (s *Store) OperationalSolutionSubtasksCreate(
	_ *zap.Logger,
	subtasks []*models.OperationalSolutionSubtask,
) ([]*models.OperationalSolutionSubtask, error)

OperationalSolutionSubtasksCreate creates a models.OperationalSolutionSubtask

func (*Store) OperationalSolutionSubtasksUpdate

func (s *Store) OperationalSolutionSubtasksUpdate(
	_ *zap.Logger,
	subtasks []*models.OperationalSolutionSubtask,
) ([]*models.OperationalSolutionSubtask, error)

OperationalSolutionSubtasksUpdate updates a collection of operational solution subtasks by ID

func (*Store) OperationalSolutionUpdateByID

func (s *Store) OperationalSolutionUpdateByID(
	logger *zap.Logger,
	solution *models.OperationalSolution,
) (*models.OperationalSolution, error)

OperationalSolutionUpdateByID updates an operational solution by its ID

func (*Store) PlanBasicsCreate

func (s *Store) PlanBasicsCreate(np sqlutils.NamedPreparer, logger *zap.Logger, basics *models.PlanBasics) (*models.PlanBasics, error)

PlanBasicsCreate creates a new plan basics

func (*Store) PlanBasicsGetByID

func (s *Store) PlanBasicsGetByID(_ *zap.Logger, id uuid.UUID) (*models.PlanBasics, error)

PlanBasicsGetByID returns the plan basics for a given id

func (*Store) PlanBasicsGetByModelPlanID

func (s *Store) PlanBasicsGetByModelPlanID(modelPlanID uuid.UUID) (*models.PlanBasics, error)

PlanBasicsGetByModelPlanID returns the plan basics for a given model plan id

func (*Store) PlanBasicsUpdate

func (s *Store) PlanBasicsUpdate(logger *zap.Logger, plan *models.PlanBasics) (*models.PlanBasics, error)

PlanBasicsUpdate updates the plan basics for a given id

func (*Store) PlanBeneficiariesCreate

func (s *Store) PlanBeneficiariesCreate(
	np sqlutils.NamedPreparer,
	logger *zap.Logger,
	b *models.PlanBeneficiaries,
) (*models.PlanBeneficiaries, error)

PlanBeneficiariesCreate creates a new plan benficiaries object

func (*Store) PlanBeneficiariesGetByID

func (s *Store) PlanBeneficiariesGetByID(
	_ *zap.Logger,
	id uuid.UUID,
) (*models.PlanBeneficiaries, error)

PlanBeneficiariesGetByID returns the plan general characteristics for a given id

func (*Store) PlanBeneficiariesGetByModelPlanIDLOADER

func (s *Store) PlanBeneficiariesGetByModelPlanIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.PlanBeneficiaries, error)

PlanBeneficiariesGetByModelPlanIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) PlanBeneficiariesUpdate

func (s *Store) PlanBeneficiariesUpdate(
	logger *zap.Logger,
	b *models.PlanBeneficiaries,
) (*models.PlanBeneficiaries, error)

PlanBeneficiariesUpdate updates the plan general characteristics for a given id

func (*Store) PlanCRCreate

func (s *Store) PlanCRCreate(logger *zap.Logger, planCR *models.PlanCR) (*models.PlanCR, error)

PlanCRCreate creates returns a plan_cr_tdl object

func (*Store) PlanCRDelete

func (s *Store) PlanCRDelete(_ *zap.Logger, id uuid.UUID, userID uuid.UUID) (*models.PlanCR, error)

PlanCRDelete deletes a plan_cr_tdl

func (*Store) PlanCRGetByID

func (s *Store) PlanCRGetByID(_ *zap.Logger, id uuid.UUID) (*models.PlanCR, error)

PlanCRGetByID returns a plan_cr_tdl

func (*Store) PlanCRUpdate

func (s *Store) PlanCRUpdate(logger *zap.Logger, planCR *models.PlanCR) (*models.PlanCR, error)

PlanCRUpdate updates and returns a plan_cr_tdl object

func (*Store) PlanCRsGetByModelPlanID

func (s *Store) PlanCRsGetByModelPlanID(_ *zap.Logger, modelPlanID uuid.UUID) ([]*models.PlanCR, error)

PlanCRsGetByModelPlanID returns all plan_cr_tdls associated with a model plan

func (*Store) PlanCollaboratorCreate

func (s *Store) PlanCollaboratorCreate(
	np sqlutils.NamedPreparer,
	_ *zap.Logger,
	collaborator *models.PlanCollaborator,
) (*models.PlanCollaborator, error)

PlanCollaboratorCreate creates a new plan collaborator

func (*Store) PlanCollaboratorDelete

func (s *Store) PlanCollaboratorDelete(
	_ *zap.Logger,
	id uuid.UUID,
	userID uuid.UUID,
) (*models.PlanCollaborator, error)

PlanCollaboratorDelete deletes the plan collaborator for a given id

func (*Store) PlanCollaboratorGetByID

func (s *Store) PlanCollaboratorGetByID(id uuid.UUID) (*models.PlanCollaborator, error)

PlanCollaboratorGetByID returns a plan collaborator for a given database ID, or nil if none found Note: The dataloader method should be preferred over this method.

func (*Store) PlanCollaboratorGetByModelPlanID

func (s *Store) PlanCollaboratorGetByModelPlanID(
	_ *zap.Logger,
	modelPlanID uuid.UUID,
) ([]*models.PlanCollaborator, error)

PlanCollaboratorGetByModelPlanID returns a slice of plan collaborators corresponding with a model plan id

func (*Store) PlanCollaboratorGetByModelPlanIDLOADER

func (s *Store) PlanCollaboratorGetByModelPlanIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.PlanCollaborator, error)

PlanCollaboratorGetByModelPlanIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) PlanCollaboratorGetCountByUserID

func (s *Store) PlanCollaboratorGetCountByUserID(userID uuid.UUID) (int, error)

PlanCollaboratorGetCountByUserID returns the number of plan collaborators for a given user_id

func (*Store) PlanCollaboratorUpdate

func (s *Store) PlanCollaboratorUpdate(
	_ *zap.Logger,
	collaborator *models.PlanCollaborator,
) (*models.PlanCollaborator, error)

PlanCollaboratorUpdate updates the plan collaborator for a given id

func (*Store) PlanDiscussionByID

func (s *Store) PlanDiscussionByID(_ *zap.Logger, id uuid.UUID) (*models.PlanDiscussion, error)

PlanDiscussionByID retrieves the plan discussion for a given id

func (*Store) PlanDiscussionCreate

func (s *Store) PlanDiscussionCreate(
	logger *zap.Logger,
	discussion *models.PlanDiscussion,
	np sqlutils.NamedPreparer,
) (*models.PlanDiscussion, error)

PlanDiscussionCreate creates a plan discussion the method is expected to be part of a larger transaction and does not handle committing or rollingback the transactions if the *sqlx.Tx is nil, this function will create one. The returned tx is the same as the one in the parameters.

func (*Store) PlanDiscussionDelete

func (s *Store) PlanDiscussionDelete(
	_ *zap.Logger,
	id uuid.UUID,
	userID uuid.UUID,
) (*models.PlanDiscussion, error)

PlanDiscussionDelete deletes the plan discussion for a given id

func (*Store) PlanDiscussionUpdate

func (s *Store) PlanDiscussionUpdate(
	logger *zap.Logger,
	discussion *models.PlanDiscussion,
) (*models.PlanDiscussion, error)

PlanDiscussionUpdate updates a plan discussion object

func (*Store) PlanDocumentCreate

func (s *Store) PlanDocumentCreate(
	logger *zap.Logger,
	principal string,
	inputDocument *models.PlanDocument) (*models.PlanDocument, error)

PlanDocumentCreate creates a plan document

func (*Store) PlanDocumentDelete

func (s *Store) PlanDocumentDelete(logger *zap.Logger, id uuid.UUID, userID uuid.UUID) (sql.Result, error)

PlanDocumentDelete deletes a plan document object by id

func (*Store) PlanDocumentNumLinkedSolutions

func (s *Store) PlanDocumentNumLinkedSolutions(logger *zap.Logger, documentID uuid.UUID) (int, error)

PlanDocumentNumLinkedSolutions implements store logic to retrieve the number of linked solutions for a document by ID

func (*Store) PlanDocumentRead

func (s *Store) PlanDocumentRead(
	_ *zap.Logger,
	s3Client *s3.S3Client,
	id uuid.UUID,
) (*models.PlanDocument, error)

PlanDocumentRead reads a plan document object by id

func (*Store) PlanDocumentSolutionLinkGetByIDs

func (s *Store) PlanDocumentSolutionLinkGetByIDs(
	_ *zap.Logger,
	solutionID uuid.UUID,
	documentID uuid.UUID,
) (*models.PlanDocumentSolutionLink, error)

PlanDocumentSolutionLinkGetByIDs returns a single plan document solution link by ID

func (*Store) PlanDocumentSolutionLinksCreate

func (s *Store) PlanDocumentSolutionLinksCreate(
	_ *zap.Logger,
	solutionID uuid.UUID,
	documentIDs []uuid.UUID,
	principal authentication.Principal,
) ([]*models.PlanDocumentSolutionLink, error)

PlanDocumentSolutionLinksCreate creates a collection of plan document solution links

func (*Store) PlanDocumentSolutionLinksGetBySolutionID

func (s *Store) PlanDocumentSolutionLinksGetBySolutionID(
	logger *zap.Logger,
	solutionID uuid.UUID,
) ([]*models.PlanDocumentSolutionLink, error)

PlanDocumentSolutionLinksGetBySolutionID gets a list of document solution links associated with the given plan ID

func (*Store) PlanDocumentSolutionLinksRemove

func (s *Store) PlanDocumentSolutionLinksRemove(
	logger *zap.Logger,
	solutionID uuid.UUID,
	documentIDs []uuid.UUID,
	userID uuid.UUID,
) (bool, error)

PlanDocumentSolutionLinksRemove deletes a plan document object by id

func (*Store) PlanDocumentUpdate

func (s *Store) PlanDocumentUpdate(logger *zap.Logger, plan *models.PlanDocument) (*models.PlanDocument, error)

PlanDocumentUpdate updates a plan document object by id with provided values

func (*Store) PlanDocumentsReadByModelPlanID

func (s *Store) PlanDocumentsReadByModelPlanID(
	logger *zap.Logger,
	modelPlanID uuid.UUID,
	s3Client *s3.S3Client) ([]*models.PlanDocument, error)

PlanDocumentsReadByModelPlanID reads a plan document object by model plan id

func (*Store) PlanDocumentsReadByModelPlanIDNotRestricted

func (s *Store) PlanDocumentsReadByModelPlanIDNotRestricted(
	logger *zap.Logger,
	modelPlanID uuid.UUID,
	s3Client *s3.S3Client) ([]*models.PlanDocument, error)

PlanDocumentsReadByModelPlanIDNotRestricted reads a plan document object by model plan id and restricted = false

func (*Store) PlanDocumentsReadBySolutionID

func (s *Store) PlanDocumentsReadBySolutionID(
	logger *zap.Logger,
	solutionID uuid.UUID,
	s3Client *s3.S3Client) ([]*models.PlanDocument, error)

PlanDocumentsReadBySolutionID reads a plan document object by solution id

func (*Store) PlanDocumentsReadBySolutionIDNotRestricted

func (s *Store) PlanDocumentsReadBySolutionIDNotRestricted(
	logger *zap.Logger,
	solutionID uuid.UUID,
	s3Client *s3.S3Client) ([]*models.PlanDocument, error)

PlanDocumentsReadBySolutionIDNotRestricted reads a plan document object by model plan id and restricted = false

func (*Store) PlanFavoriteCollectionGetUniqueUserIDs

func (s *Store) PlanFavoriteCollectionGetUniqueUserIDs() ([]uuid.UUID, error)

PlanFavoriteCollectionGetUniqueUserIDs returns userIDs of users that have favorited any model

func (*Store) PlanFavoriteCreate

func (s *Store) PlanFavoriteCreate(np sqlutils.NamedPreparer, logger *zap.Logger, favorite models.PlanFavorite) (*models.PlanFavorite, error)

PlanFavoriteCreate creates and returns a plan favorite object

func (*Store) PlanFavoriteDelete

func (s *Store) PlanFavoriteDelete(
	_ *zap.Logger,
	userAccountID uuid.UUID,
	planID uuid.UUID,
	deletedByUserID uuid.UUID,
) (*models.PlanFavorite, error)

PlanFavoriteDelete deletes a plan favorite

func (*Store) PlanFavoriteGetByModelIDAndUserAccountID

func (s *Store) PlanFavoriteGetByModelIDAndUserAccountID(
	_ *zap.Logger,
	userAccountID uuid.UUID,
	modelPlanID uuid.UUID,
) (*models.PlanFavorite, error)

PlanFavoriteGetByModelIDAndUserAccountID returns a plan favorite

func (*Store) PlanGeneralCharacteristicsCreate

func (s *Store) PlanGeneralCharacteristicsCreate(
	np sqlutils.NamedPreparer,
	logger *zap.Logger,
	gc *models.PlanGeneralCharacteristics,
) (*models.PlanGeneralCharacteristics, error)

PlanGeneralCharacteristicsCreate creates a new plan basics

func (*Store) PlanGeneralCharacteristicsGetByID

func (s *Store) PlanGeneralCharacteristicsGetByID(
	_ *zap.Logger,
	id uuid.UUID,
) (*models.PlanGeneralCharacteristics, error)

PlanGeneralCharacteristicsGetByID returns the plan general characteristics for a given id

func (*Store) PlanGeneralCharacteristicsGetByModelPlanIDLOADER

func (s *Store) PlanGeneralCharacteristicsGetByModelPlanIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.PlanGeneralCharacteristics, error)

PlanGeneralCharacteristicsGetByModelPlanIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) PlanGeneralCharacteristicsUpdate

func (s *Store) PlanGeneralCharacteristicsUpdate(
	logger *zap.Logger,
	gc *models.PlanGeneralCharacteristics,
) (*models.PlanGeneralCharacteristics, error)

PlanGeneralCharacteristicsUpdate updates the plan general characteristics for a given id

func (*Store) PlanOpsEvalAndLearningCreate

func (s *Store) PlanOpsEvalAndLearningCreate(
	np sqlutils.NamedPreparer,
	logger *zap.Logger,
	oel *models.PlanOpsEvalAndLearning,
) (*models.PlanOpsEvalAndLearning, error)

PlanOpsEvalAndLearningCreate creates a new plan providers_and_participants object

func (*Store) PlanOpsEvalAndLearningGetByID

func (s *Store) PlanOpsEvalAndLearningGetByID(
	_ *zap.Logger,
	id uuid.UUID,
) (*models.PlanOpsEvalAndLearning, error)

PlanOpsEvalAndLearningGetByID returns the plan providers_and_participants for a given id

func (*Store) PlanOpsEvalAndLearningGetByModelPlanIDLOADER

func (s *Store) PlanOpsEvalAndLearningGetByModelPlanIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.PlanOpsEvalAndLearning, error)

PlanOpsEvalAndLearningGetByModelPlanIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) PlanOpsEvalAndLearningUpdate

func (s *Store) PlanOpsEvalAndLearningUpdate(
	logger *zap.Logger,
	oel *models.PlanOpsEvalAndLearning,
) (*models.PlanOpsEvalAndLearning, error)

PlanOpsEvalAndLearningUpdate updates the plan providers_and_participants for a given id

func (*Store) PlanParticipantsAndProvidersCreate

func (s *Store) PlanParticipantsAndProvidersCreate(
	np sqlutils.NamedPreparer,
	logger *zap.Logger,
	gc *models.PlanParticipantsAndProviders,
) (*models.PlanParticipantsAndProviders, error)

PlanParticipantsAndProvidersCreate creates a new plan providers_and_participants object

func (*Store) PlanParticipantsAndProvidersGetByID

func (s *Store) PlanParticipantsAndProvidersGetByID(
	_ *zap.Logger,
	id uuid.UUID,
) (*models.PlanParticipantsAndProviders, error)

PlanParticipantsAndProvidersGetByID returns the plan providers_and_participants for a given id

func (*Store) PlanParticipantsAndProvidersGetByModelPlanIDLOADER

func (s *Store) PlanParticipantsAndProvidersGetByModelPlanIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.PlanParticipantsAndProviders, error)

PlanParticipantsAndProvidersGetByModelPlanIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) PlanParticipantsAndProvidersUpdate

func (s *Store) PlanParticipantsAndProvidersUpdate(
	logger *zap.Logger,
	gc *models.PlanParticipantsAndProviders,
) (*models.PlanParticipantsAndProviders, error)

PlanParticipantsAndProvidersUpdate updates the plan providers_and_participants for a given id

func (*Store) PlanPaymentsCreate

func (s *Store) PlanPaymentsCreate(
	np sqlutils.NamedPreparer,
	logger *zap.Logger,
	payments *models.PlanPayments) (*models.PlanPayments, error)

PlanPaymentsCreate creates a new plan payments row in the database and returns a copy to the caller

func (*Store) PlanPaymentsGetByModelPlanIDLOADER

func (s *Store) PlanPaymentsGetByModelPlanIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.PlanPayments, error)

PlanPaymentsGetByModelPlanIDLOADER returns the plan GeneralCharacteristics for a slice of model plan ids

func (*Store) PlanPaymentsRead

func (s *Store) PlanPaymentsRead(
	_ *zap.Logger,
	id uuid.UUID) (*models.PlanPayments, error)

PlanPaymentsRead finds a plan payments model by id

func (*Store) PlanPaymentsUpdate

func (s *Store) PlanPaymentsUpdate(
	logger *zap.Logger,
	payments *models.PlanPayments) (*models.PlanPayments, error)

PlanPaymentsUpdate updates a plan payment model in the database

func (*Store) PlanTDLCreate

func (s *Store) PlanTDLCreate(logger *zap.Logger, planTDL *models.PlanTDL) (*models.PlanTDL, error)

PlanTDLCreate creates returns a plan_cr_tdl object

func (*Store) PlanTDLDelete

func (s *Store) PlanTDLDelete(_ *zap.Logger, id uuid.UUID, userID uuid.UUID) (*models.PlanTDL, error)

PlanTDLDelete deletes a plan_cr_tdl

func (*Store) PlanTDLGetByID

func (s *Store) PlanTDLGetByID(_ *zap.Logger, id uuid.UUID) (*models.PlanTDL, error)

PlanTDLGetByID returns a plan_cr_tdl

func (*Store) PlanTDLUpdate

func (s *Store) PlanTDLUpdate(logger *zap.Logger, planTDL *models.PlanTDL) (*models.PlanTDL, error)

PlanTDLUpdate updates and returns a plan_cr_tdl object

func (*Store) PlanTDLsGetByModelPlanID

func (s *Store) PlanTDLsGetByModelPlanID(_ *zap.Logger, modelPlanID uuid.UUID) ([]*models.PlanTDL, error)

PlanTDLsGetByModelPlanID returns all plan_cr_tdls associated with a model plan

func (*Store) PlanTimelineCreate

func (s *Store) PlanTimelineCreate(np sqlutils.NamedPreparer, logger *zap.Logger, planTimeline *models.PlanTimeline) (*models.PlanTimeline, error)

PlanTimelineCreate creates a new planTimeline

func (*Store) PlanTimelineGetByID

func (s *Store) PlanTimelineGetByID(np sqlutils.NamedPreparer, _ *zap.Logger, id uuid.UUID) (*models.PlanTimeline, error)

PlanTimelineGetByID returns the planTimeline for a given id

func (*Store) PlanTimelineGetByModelPlanID

func (s *Store) PlanTimelineGetByModelPlanID(modelPlanID uuid.UUID) (*models.PlanTimeline, error)

PlanTimelineGetByModelPlanID returns the planTimeline for a given model plan id

func (*Store) PlanTimelineUpdate

func (s *Store) PlanTimelineUpdate(np sqlutils.NamedPreparer, logger *zap.Logger, planTimeline *models.PlanTimeline) (*models.PlanTimeline, error)

PlanTimelineUpdate updates the planTimeline for a given id

func (*Store) PossibleOperationalNeedCollectionGetByModelPlanID

func (s *Store) PossibleOperationalNeedCollectionGetByModelPlanID(
	_ *zap.Logger,
	modelPlanID uuid.UUID,
) ([]*models.PossibleOperationalNeed, error)

PossibleOperationalNeedCollectionGetByModelPlanID returns possible operational needs that don't have an existing record for a model plan

func (*Store) PossibleOperationalSolutionCollectionGetAll

func (s *Store) PossibleOperationalSolutionCollectionGetAll(_ *zap.Logger) (
	[]*models.PossibleOperationalSolution,
	error,
)

PossibleOperationalSolutionCollectionGetAll returns all possible operational solutions

func (*Store) PossibleOperationalSolutionCollectionGetByNeedType

func (s *Store) PossibleOperationalSolutionCollectionGetByNeedType(
	_ *zap.Logger,
	needKey models.OperationalNeedKey,
) ([]*models.PossibleOperationalSolution, error)

PossibleOperationalSolutionCollectionGetByNeedType returns possible operational solutions for a given operational need

func (*Store) PossibleOperationalSolutionCollectionGetByOperationalNeedID

func (s *Store) PossibleOperationalSolutionCollectionGetByOperationalNeedID(
	_ *zap.Logger,
	operationalNeedID uuid.UUID,
) ([]*models.PossibleOperationalSolution, error)

PossibleOperationalSolutionCollectionGetByOperationalNeedID returns possible operational solutions for a given operational need

func (*Store) PossibleOperationalSolutionContactsGetByPossibleSolutionIDLOADER

func (s *Store) PossibleOperationalSolutionContactsGetByPossibleSolutionIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*models.PossibleOperationalSolutionContact, error)

PossibleOperationalSolutionContactsGetByPossibleSolutionIDLOADER returns Solution contacts that match the paramTable JSON

func (*Store) PossibleOperationalSolutionGetByID

func (s *Store) PossibleOperationalSolutionGetByID(logger *zap.Logger, id int) (*models.PossibleOperationalSolution, error)

PossibleOperationalSolutionGetByID returns a possible solution associated to a specific id

func (*Store) PossibleOperationalSolutionGetByKey

func (s *Store) PossibleOperationalSolutionGetByKey(logger *zap.Logger, solKey models.OperationalSolutionKey) (*models.PossibleOperationalSolution, error)

PossibleOperationalSolutionGetByKey returns a possible solution associated to a specific id

func (*Store) PossibleOperationalSolutionPrimaryContactGetByPossibleSolutionID

func (s *Store) PossibleOperationalSolutionPrimaryContactGetByPossibleSolutionID(
	np sqlutils.NamedPreparer,
	logger *zap.Logger,
	possibleSolutionID int,
) (*models.PossibleOperationalSolutionContact, error)

PossibleOperationalSolutionPrimaryContactGetByPossibleSolutionID returns the primary contact associated with a possible operational solution

func (*Store) PrepareNamed

func (s *Store) PrepareNamed(query string) (*sqlx.NamedStmt, error)

PrepareNamed implements the INamedPreparer 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) ReadyForClearanceGetByModelPlanID

func (s *Store) ReadyForClearanceGetByModelPlanID(
	_ *zap.Logger,
	modelPlanID uuid.UUID,
) (*models.PrepareForClearanceResponse, error)

ReadyForClearanceGetByModelPlanID reads information about a model plan's clearance

func (*Store) TagCollectionGetByContentIDAndField

func (s *Store) TagCollectionGetByContentIDAndField(_ *zap.Logger, taggedTable string, taggedField string, taggedContentID uuid.UUID) ([]*models.Tag, error)

TagCollectionGetByContentIDAndField returns relevant tags for specific table and field

func (*Store) TagCreate

func (s *Store) TagCreate(
	logger *zap.Logger,
	tag *models.Tag,
) (*models.Tag, error)

TagCreate writes a new tage to the database

func (*Store) TruncateAllTablesDANGEROUS

func (s *Store) TruncateAllTablesDANGEROUS(logger *zap.Logger) error

TruncateAllTablesDANGEROUS is a function to reset all tables in the DB. It should only be called within test code.

func (*Store) UserAccountGetByIDLOADER

func (s *Store) UserAccountGetByIDLOADER(
	_ *zap.Logger,
	paramTableJSON string,
) ([]*authentication.UserAccount, error)

UserAccountGetByIDLOADER gets multiple User account from the database by its internal id.

func (*Store) UserAccountNotificationPreferencesNewModelPlan

func (s *Store) UserAccountNotificationPreferencesNewModelPlan(np sqlutils.NamedPreparer) (
	[]*models.UserAccountAndNotificationPreferences,
	error,
)

UserAccountNotificationPreferencesNewModelPlan gets the notification preferences for a new model plan for a slice of users who have at least one enabled preference

func (*Store) UserAccountsGetNotificationRecipientsForDatesChanged

func (s *Store) UserAccountsGetNotificationRecipientsForDatesChanged(
	modelPlanID uuid.UUID,
) (
	[]*models.UserAccountAndNotificationPreferences,
	error,
)

UserAccountsGetNotificationRecipientsForDatesChanged returns a collection of user accounts that should be notified of a change in model plan dates

func (*Store) UserAccountsGetNotificationRecipientsForDiscussionAdded

func (s *Store) UserAccountsGetNotificationRecipientsForDiscussionAdded(
	np sqlutils.NamedPreparer,
	modelPlanID uuid.UUID,
) (
	[]*models.UserAccountAndNotificationPreferences,
	error,
)

UserAccountsGetNotificationRecipientsForDiscussionAdded returns a collection of user accounts that should be notified of when a new discussion is added to a model plan

Directories

Path Synopsis
Package loaders is a responsible for batched data calls
Package loaders is a responsible for batched data calls

Jump to

Keyboard shortcuts

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