Documentation
¶
Index ¶
- Constants
- Variables
- func PurchaseHistoryFixtureRowID(i int) string
- type EmailSenderAPI
- type MockAuthStore
- func (m *MockAuthStore) AdminExists(ctx context.Context) (bool, error)
- func (m *MockAuthStore) ClaimMFALoginTokenAttempt(ctx context.Context, tokenHash string, maxAttempts int) (*auth.MFALoginToken, error)
- func (m *MockAuthStore) ClaimTOTPCounter(ctx context.Context, userID string, counter int64) (bool, error)
- func (m *MockAuthStore) CleanupExpiredSessions(ctx context.Context) error
- func (m *MockAuthStore) ClearPendingMFASecret(ctx context.Context, userID string) error
- func (m *MockAuthStore) CompletePasswordReset(ctx context.Context, user *auth.User, readResetToken, readPasswordHash string) error
- func (m *MockAuthStore) ConsumeMFALoginToken(ctx context.Context, tokenHash string) (bool, error)
- func (m *MockAuthStore) ConsumeMFARecoveryCode(ctx context.Context, userID string, readCodes, remaining []string) error
- func (m *MockAuthStore) ConsumePasswordResetToken(ctx context.Context, userID, readResetToken string) error
- func (m *MockAuthStore) CountGroupMembers(ctx context.Context, groupID string) (int, error)
- func (m *MockAuthStore) CreateAPIKey(ctx context.Context, key *auth.UserAPIKey) error
- func (m *MockAuthStore) CreateAdminIfNone(ctx context.Context, user *auth.User) (bool, error)
- func (m *MockAuthStore) CreateGroup(ctx context.Context, group *auth.Group) error
- func (m *MockAuthStore) CreateMFALoginToken(ctx context.Context, tokenHash, userID string, passwordVersion int64, ...) (time.Time, error)
- func (m *MockAuthStore) CreateSession(ctx context.Context, session *auth.Session) error
- func (m *MockAuthStore) CreateUser(ctx context.Context, user *auth.User) error
- func (m *MockAuthStore) DeleteAPIKey(ctx context.Context, keyID string) error
- func (m *MockAuthStore) DeleteGroup(ctx context.Context, groupID string) error
- func (m *MockAuthStore) DeleteSession(ctx context.Context, token string) error
- func (m *MockAuthStore) DeleteUser(ctx context.Context, userID string) error
- func (m *MockAuthStore) DeleteUserSessions(ctx context.Context, userID string) error
- func (m *MockAuthStore) DisableMFA(ctx context.Context, userID, readSecret string, readCodes []string) error
- func (m *MockAuthStore) EnableMFA(ctx context.Context, userID, pendingSecret string, totpCounter int64, ...) error
- func (m *MockAuthStore) GetAPIKeyByHash(ctx context.Context, keyHash string) (*auth.UserAPIKey, error)
- func (m *MockAuthStore) GetAPIKeyByID(ctx context.Context, keyID string) (*auth.UserAPIKey, error)
- func (m *MockAuthStore) GetGroup(ctx context.Context, groupID string) (*auth.Group, error)
- func (m *MockAuthStore) GetSession(ctx context.Context, token string) (*auth.Session, error)
- func (m *MockAuthStore) GetUserByEmail(ctx context.Context, email string) (*auth.User, error)
- func (m *MockAuthStore) GetUserByID(ctx context.Context, userID string) (*auth.User, error)
- func (m *MockAuthStore) GetUserByResetToken(ctx context.Context, token string) (*auth.User, error)
- func (m *MockAuthStore) ListAPIKeysByUser(ctx context.Context, userID string) ([]*auth.UserAPIKey, error)
- func (m *MockAuthStore) ListGroups(ctx context.Context) ([]auth.Group, error)
- func (m *MockAuthStore) ListUsers(ctx context.Context) ([]auth.User, error)
- func (m *MockAuthStore) Ping(ctx context.Context) error
- func (m *MockAuthStore) RecordAPIKeyUsage(ctx context.Context, keyID string, delta int64) error
- func (m *MockAuthStore) RecordFailedLogin(ctx context.Context, userID string) error
- func (m *MockAuthStore) RecordSuccessfulLogin(ctx context.Context, userID string) error
- func (m *MockAuthStore) ReplaceMFARecoveryCodes(ctx context.Context, userID, readSecret string, readCodes, newHashes []string) error
- func (m *MockAuthStore) SetPasswordResetToken(ctx context.Context, user *auth.User, readExpiry *time.Time) error
- func (m *MockAuthStore) SetPendingMFASecret(ctx context.Context, userID, secret string, expiresAt time.Time) error
- func (m *MockAuthStore) Test(t mock.TestingT)
- func (m *MockAuthStore) UpdateAPIKey(ctx context.Context, key *auth.UserAPIKey) error
- func (m *MockAuthStore) UpdateGroup(ctx context.Context, group *auth.Group) error
- func (m *MockAuthStore) UpdateUserAdminFields(ctx context.Context, user *auth.User, readEmail string, readGroupIDs []string, ...) error
- func (m *MockAuthStore) UpdateUserCredentials(ctx context.Context, user *auth.User, readEmail, readPasswordHash string) error
- type MockConfigStore
- func (m *MockConfigStore) ApproveAccountRegistration(ctx context.Context, reg *config.AccountRegistration, ...) error
- func (m *MockConfigStore) AssertCalled(t mock.TestingT, method string, arguments ...interface{}) bool
- func (m *MockConfigStore) AssertNotCalled(t mock.TestingT, method string, arguments ...interface{}) bool
- func (m *MockConfigStore) AssertNumberOfCalls(t mock.TestingT, method string, expectedCalls int) bool
- func (m *MockConfigStore) CancelAllPendingExchanges(ctx context.Context) (int64, error)
- func (m *MockConfigStore) CancelExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string) (bool, string, error)
- func (m *MockConfigStore) CancelExecutionAtomicTokenPinned(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string, ...) (bool, string, error)
- func (m *MockConfigStore) CancelLadderRun(ctx context.Context, id string, fromStatuses []ladder.RunStatus, ...) (*config.LadderRunDB, error)
- func (m *MockConfigStore) CancelPendingExchangesByOrigin(ctx context.Context, origin common.ExchangeOrigin) (int64, error)
- func (m *MockConfigStore) CancelScheduledExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string) (bool, string, error)
- func (m *MockConfigStore) ClaimCollectionInvocation(ctx context.Context, markerToken string) (token string, ok bool, err error)
- func (m *MockConfigStore) ClaimMarketplaceListingSlot(ctx context.Context, purchaseID, clientToken string, priceSchedule []byte) (*config.MarketplaceListingClaim, error)
- func (m *MockConfigStore) ClaimRIExchangeIdempotencyKey(ctx context.Context, key string, window time.Duration) (bool, error)
- func (m *MockConfigStore) CleanupOldExecutions(ctx context.Context, retentionDays int) (int64, error)
- func (m *MockConfigStore) ClearCollectionStarted(ctx context.Context, token string) error
- func (m *MockConfigStore) ClearRegistrationCredentialPayload(ctx context.Context, registrationID string) error
- func (m *MockConfigStore) ClearRevocationInFlight(ctx context.Context, purchaseID string) error
- func (m *MockConfigStore) CompletePlanStep(ctx context.Context, planID string, stepNumber int) error
- func (m *MockConfigStore) CompleteRIExchange(ctx context.Context, id, exchangeID string) error
- func (m *MockConfigStore) CompleteRIExchangeWithPayment(ctx context.Context, id, exchangeID, acceptedPaymentDue string) error
- func (m *MockConfigStore) CompleteTargetMetStepTx(ctx context.Context, tx pgx.Tx, planID string, stepNumber int, ...) error
- func (m *MockConfigStore) CountExecutionsByPlanAndStatus(ctx context.Context, statuses []string, since time.Time) (map[string]config.ExecutionStatusCounts, error)
- func (m *MockConfigStore) CountLadderRunTrancheStatuses(ctx context.Context, runID string) (map[ladder.TrancheStatus]int, error)
- func (m *MockConfigStore) CountLiveExecutionsForAccount(ctx context.Context, accountID string) (int, error)
- func (m *MockConfigStore) CountPendingExecutionsForAccount(ctx context.Context, accountID string) (int, error)
- func (m *MockConfigStore) CreateAccountRegistration(ctx context.Context, reg *config.AccountRegistration) error
- func (m *MockConfigStore) CreateCloudAccount(ctx context.Context, account *config.CloudAccount) error
- func (m *MockConfigStore) CreatePurchasePlan(ctx context.Context, plan *config.PurchasePlan) error
- func (m *MockConfigStore) CreatePurchasePlanWithAccounts(ctx context.Context, plan *config.PurchasePlan, accountIDs []string, ...) error
- func (m *MockConfigStore) CreateSuppression(ctx context.Context, sup *config.PurchaseSuppression) error
- func (m *MockConfigStore) CreateSuppressionTx(ctx context.Context, tx pgx.Tx, sup *config.PurchaseSuppression) error
- func (m *MockConfigStore) DeleteAccountCredentials(ctx context.Context, accountID string) error
- func (m *MockConfigStore) DeleteAccountRegistration(ctx context.Context, id string) error
- func (m *MockConfigStore) DeleteAccountServiceOverride(ctx context.Context, accountID, provider, service string) error
- func (m *MockConfigStore) DeleteAccountServiceOverrideAuditedTx(ctx context.Context, tx pgx.Tx, accountID, provider, service string, ...) error
- func (m *MockConfigStore) DeleteCloudAccount(ctx context.Context, id string) error
- func (m *MockConfigStore) DeletePurchasePlan(ctx context.Context, planID string) error
- func (m *MockConfigStore) DeleteSuppressionsByExecution(ctx context.Context, executionID string) error
- func (m *MockConfigStore) DeleteSuppressionsByExecutionTx(ctx context.Context, tx pgx.Tx, executionID string) error
- func (m *MockConfigStore) ExpireExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID string, ...) (bool, error)
- func (m *MockConfigStore) FailRIExchange(ctx context.Context, id, errorMsg string) error
- func (m *MockConfigStore) FamilyRetryClaimedTx(ctx context.Context, tx pgx.Tx, family, planID, selfID string, selfIsRoot bool) (bool, error)
- func (m *MockConfigStore) FinalizeRIExchangeDirectExecution(ctx context.Context, id string, outcome config.RIExchangeDirectOutcome) error
- func (m *MockConfigStore) FindOpenRedshiftLineageConflictsTx(ctx context.Context, tx pgx.Tx, selfID, family string, ...) ([]config.RedshiftLineageConflict, error)
- func (m *MockConfigStore) FlipPurchaseRevocationInFlight(ctx context.Context, purchaseID string) error
- func (m *MockConfigStore) GetAccountCredential(ctx context.Context, accountID, credentialType string) (string, error)
- func (m *MockConfigStore) GetAccountRegistration(ctx context.Context, id string) (*config.AccountRegistration, error)
- func (m *MockConfigStore) GetAccountRegistrationByToken(ctx context.Context, token string) (*config.AccountRegistration, error)
- func (m *MockConfigStore) GetAccountServiceOverride(ctx context.Context, accountID, provider, service string) (*config.AccountServiceOverride, error)
- func (m *MockConfigStore) GetActivePurchaseHistory(ctx context.Context, asOf time.Time, accountIDs []string, ...) ([]config.PurchaseHistoryRecord, error)
- func (m *MockConfigStore) GetAllPurchaseHistory(ctx context.Context, limit int) ([]config.PurchaseHistoryRecord, error)
- func (m *MockConfigStore) GetCloudAccount(ctx context.Context, id string) (*config.CloudAccount, error)
- func (m *MockConfigStore) GetCloudAccountByExternalID(ctx context.Context, provider, externalID string) (*config.CloudAccount, error)
- func (m *MockConfigStore) GetDoomedNextRoots(ctx context.Context, now time.Time) (map[string]config.DoomedRoot, error)
- func (m *MockConfigStore) GetExecutionByID(ctx context.Context, executionID string) (*config.PurchaseExecution, error)
- func (m *MockConfigStore) GetExecutionByPlanAndDate(ctx context.Context, planID string, scheduledDate time.Time) (*config.PurchaseExecution, error)
- func (m *MockConfigStore) GetExecutionFanOutShape(ctx context.Context, lineageKey string) (string, error)
- func (m *MockConfigStore) GetExecutionsByStatuses(ctx context.Context, statuses []string, limit int) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) GetExecutionsByStatusesFiltered(ctx context.Context, q config.ExecutionsByStatusesQuery) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) GetGlobalConfig(ctx context.Context) (*config.GlobalConfig, error)
- func (m *MockConfigStore) GetLadderConfig(ctx context.Context, cloudAccountID, provider string) (*config.LadderConfigDB, error)
- func (m *MockConfigStore) GetLadderConfigs(ctx context.Context) ([]config.LadderConfigDB, error)
- func (m *MockConfigStore) GetLadderExecutionGate(ctx context.Context, idempotencyKey string) (*config.LadderExecutionGate, error)
- func (m *MockConfigStore) GetLadderRun(ctx context.Context, id string) (*config.LadderRunDB, error)
- func (m *MockConfigStore) GetLadderSweepCeiling(ctx context.Context, configID string) (*int64, error)
- func (m *MockConfigStore) GetMarketplaceListingAttempt(ctx context.Context, purchaseID string) (*config.MarketplaceListingAttempt, error)
- func (m *MockConfigStore) GetMarketplaceListingProceedsTotals(ctx context.Context, purchaseIDs, accountIDs []string, ...) ([]config.MarketplaceListingProceedsTotal, error)
- func (m *MockConfigStore) GetPendingExecutions(ctx context.Context) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) GetPlanAccounts(ctx context.Context, planID string) ([]config.CloudAccount, error)
- func (m *MockConfigStore) GetPlanRampBaselineTx(ctx context.Context, tx pgx.Tx, planID string) (config.PlanRampBaseline, error)
- func (m *MockConfigStore) GetPlannedExecutions(ctx context.Context, statuses []string, limit int) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) GetPurchaseHistory(ctx context.Context, accountID string, limit int) ([]config.PurchaseHistoryRecord, error)
- func (m *MockConfigStore) GetPurchaseHistoryByPurchaseID(ctx context.Context, purchaseID string) (*config.PurchaseHistoryRecord, error)
- func (m *MockConfigStore) GetPurchaseHistoryFiltered(ctx context.Context, filter config.PurchaseHistoryFilter) ([]config.PurchaseHistoryRecord, error)
- func (m *MockConfigStore) GetPurchaseHistoryInFlight(ctx context.Context) ([]*config.PurchaseHistoryRecord, error)
- func (m *MockConfigStore) GetPurchasePlan(ctx context.Context, planID string) (*config.PurchasePlan, error)
- func (m *MockConfigStore) GetRIExchangeDailySpend(ctx context.Context, date time.Time) (string, error)
- func (m *MockConfigStore) GetRIExchangeHistory(ctx context.Context, since time.Time, limit int) ([]config.RIExchangeRecord, error)
- func (m *MockConfigStore) GetRIExchangeHistoryForAccounts(ctx context.Context, since time.Time, limit int, accountIDs []string) ([]config.RIExchangeRecord, error)
- func (m *MockConfigStore) GetRIExchangeRecord(ctx context.Context, id string) (*config.RIExchangeRecord, error)
- func (m *MockConfigStore) GetRIExchangeRecordByToken(ctx context.Context, token string) (*config.RIExchangeRecord, error)
- func (m *MockConfigStore) GetRIUtilizationCache(ctx context.Context, key config.RIUtilizationCacheKey) (*config.RIUtilizationCacheEntry, error)
- func (m *MockConfigStore) GetRecommendationsFreshness(ctx context.Context) (*config.RecommendationsFreshness, error)
- func (m *MockConfigStore) GetRedshiftRetryClock(ctx context.Context, executionID string) (config.RedshiftRetryClock, error)
- func (m *MockConfigStore) GetScheduledExecutionsDue(ctx context.Context) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) GetServiceConfig(ctx context.Context, provider, service string) (*config.ServiceConfig, error)
- func (m *MockConfigStore) GetStaleApprovedExecutions(ctx context.Context, olderThan time.Duration) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) GetStaleProcessingExchanges(ctx context.Context, olderThan time.Duration) ([]config.RIExchangeRecord, error)
- func (m *MockConfigStore) GetStuckRampSteps(ctx context.Context) (map[string]config.RampStepBlock, error)
- func (m *MockConfigStore) GetUserEmailByID(ctx context.Context, userID string) (string, error)
- func (m *MockConfigStore) HasAccountCredentials(ctx context.Context, accountID string) (bool, error)
- func (m *MockConfigStore) HistorySummaryAggregate(ctx context.Context, filter config.HistorySummaryFilter) (*config.HistorySummaryGroups, error)
- func (m *MockConfigStore) IsNotificationMuted(ctx context.Context, recipientEmail, scope string) (bool, error)
- func (m *MockConfigStore) LatestLadderRunID(ctx context.Context, configID string) (string, error)
- func (m *MockConfigStore) LatestLadderRunStartedAt(ctx context.Context, configID string) (*time.Time, error)
- func (m *MockConfigStore) LinkRetryExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID, retryExecutionID string) (bool, error)
- func (m *MockConfigStore) LinkUnsentRetryExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID, retryExecutionID string) (bool, error)
- func (m *MockConfigStore) ListAccountRegistrations(ctx context.Context, filter config.AccountRegistrationFilter) ([]config.AccountRegistration, error)
- func (m *MockConfigStore) ListAccountServiceOverrides(ctx context.Context, accountID string) ([]config.AccountServiceOverride, error)
- func (m *MockConfigStore) ListActiveSuppressions(ctx context.Context) ([]config.PurchaseSuppression, error)
- func (m *MockConfigStore) ListCloudAccounts(ctx context.Context, filter config.CloudAccountFilter) ([]config.CloudAccount, error)
- func (m *MockConfigStore) ListExecutionsForPlanStepTx(ctx context.Context, tx pgx.Tx, planID string, stepNumber int) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) ListHistoryExecutionsPage(ctx context.Context, q config.HistoryExecutionsPageQuery) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) ListMarketplaceListingsToPoll(ctx context.Context) ([]config.PurchaseHistoryRecord, error)
- func (m *MockConfigStore) ListPendingExecutionIDsForAccount(ctx context.Context, accountID string) ([]string, error)
- func (m *MockConfigStore) ListPlanCommittedTx(ctx context.Context, tx pgx.Tx, planID string) (map[string]config.PlanRampQuantity, error)
- func (m *MockConfigStore) ListPurchaseHistoryPage(ctx context.Context, filter config.PurchaseHistoryFilter, ...) ([]config.PurchaseHistoryPageRow, error)
- func (m *MockConfigStore) ListPurchasePlans(ctx context.Context, filter config.PurchasePlanFilter) ([]config.PurchasePlan, error)
- func (m *MockConfigStore) ListRecentSubmitsTx(ctx context.Context, tx pgx.Tx, creatorID string, since time.Time) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) ListServiceConfigs(ctx context.Context) ([]config.ServiceConfig, error)
- func (m *MockConfigStore) ListStoredRecommendationTriples(ctx context.Context, scope config.RecommendationListScope) ([]config.RecommendationTriple, error)
- func (m *MockConfigStore) ListStoredRecommendations(ctx context.Context, filter config.RecommendationFilter) ([]config.RecommendationRecord, error)
- func (m *MockConfigStore) ListStoredRecommendationsChunk(ctx context.Context, filter config.RecommendationFilter, ...) (config.RecommendationChunk, error)
- func (m *MockConfigStore) ListStuckExecutions(ctx context.Context, statuses []string, olderThan time.Duration) ([]config.PurchaseExecution, error)
- func (m *MockConfigStore) LockLadderTrancheForRetryTx(ctx context.Context, tx pgx.Tx, idempotencyKey string) (ladder.TrancheStatus, bool, error)
- func (m *MockConfigStore) LockPlanProvidersTx(ctx context.Context, tx pgx.Tx, providers []string) error
- func (m *MockConfigStore) LockPurchasePlanTx(ctx context.Context, tx pgx.Tx, planID string) (*config.PurchasePlan, error)
- func (m *MockConfigStore) LockRedshiftTuplesTx(ctx context.Context, tx pgx.Tx, tuples []config.RedshiftTuple) error
- func (m *MockConfigStore) LockRetryFamilyTx(ctx context.Context, tx pgx.Tx, family string) error
- func (m *MockConfigStore) MarkCollectionStarted(ctx context.Context) (token string, ok bool, err error)
- func (m *MockConfigStore) MarkPurchaseRevoked(ctx context.Context, purchaseID string, revokedAt time.Time, ...) error
- func (m *MockConfigStore) MarkRevocationReturnPosted(ctx context.Context, purchaseID string) error
- func (m *MockConfigStore) NoteRIExchangeOutcomeUnknown(ctx context.Context, id, note string) error
- func (m *MockConfigStore) OccupiedRampStepsInRangeTx(ctx context.Context, tx pgx.Tx, planID string, from, to int) ([]int, error)
- func (m *MockConfigStore) PageStoredRecommendations(ctx context.Context, q config.RecommendationPageQuery) (config.RecommendationPage, error)
- func (m *MockConfigStore) PinExecutionFanOutShape(ctx context.Context, lineageKey, shape string) (string, error)
- func (m *MockConfigStore) PlanAndSaveLadderRun(ctx context.Context, configID string, asOf time.Time, ...) (*config.LadderRunDB, error)
- func (m *MockConfigStore) PredecessorProvenUnsent(ctx context.Context, executionID string) (bool, error)
- func (m *MockConfigStore) PruneStaleRecommendations(ctx context.Context, retentionDays int) (int64, error)
- func (m *MockConfigStore) RecordMarketplaceListingActive(ctx context.Context, purchaseID, listingID string, listedAt time.Time) (bool, error)
- func (m *MockConfigStore) RecoverReapedExecution(ctx context.Context, exec *config.PurchaseExecution) error
- func (m *MockConfigStore) RecoverReapedExecutionTx(ctx context.Context, tx pgx.Tx, exec *config.PurchaseExecution) error
- func (m *MockConfigStore) ReleaseMarketplaceListingClaim(ctx context.Context, purchaseID, clientToken, priorState string, ...) error
- func (m *MockConfigStore) ReleaseStaleRevocationsInFlight(ctx context.Context, after time.Duration) ([]string, error)
- func (m *MockConfigStore) RescheduleAwaitingExecution(ctx context.Context, executionID string, scheduledDate time.Time) (bool, error)
- func (m *MockConfigStore) ReserveApprovedRIExchange(ctx context.Context, id, dailyCapUSD, perExchangeCapUSD string) (string, error)
- func (m *MockConfigStore) ReserveRIExchange(ctx context.Context, record *config.RIExchangeRecord, ...) (string, error)
- func (m *MockConfigStore) ResolveMarketplaceListingAttempt(ctx context.Context, purchaseID string, seen config.MarketplaceListingAttempt, ...) (bool, error)
- func (m *MockConfigStore) RotatePendingApprovalToken(ctx context.Context, executionID, tokenHash string, expiresAt time.Time) (bool, error)
- func (m *MockConfigStore) SaveAccountCredential(ctx context.Context, accountID, credentialType, encryptedBlob string) error
- func (m *MockConfigStore) SaveAccountServiceOverride(ctx context.Context, override *config.AccountServiceOverride) error
- func (m *MockConfigStore) SaveAccountServiceOverrideAuditedTx(ctx context.Context, tx pgx.Tx, override *config.AccountServiceOverride, ...) error
- func (m *MockConfigStore) SaveConfigAuditEventTx(ctx context.Context, tx pgx.Tx, event *config.AuditEvent) error
- func (m *MockConfigStore) SaveExecutionIfStatus(ctx context.Context, exec *config.PurchaseExecution, expected []string) error
- func (m *MockConfigStore) SaveExecutionIfStatusTx(ctx context.Context, tx pgx.Tx, exec *config.PurchaseExecution, ...) error
- func (m *MockConfigStore) SaveGlobalConfig(ctx context.Context, cfg *config.GlobalConfig) error
- func (m *MockConfigStore) SaveLadderRun(ctx context.Context, run *config.LadderRunDB) (*config.LadderRunDB, error)
- func (m *MockConfigStore) SaveLadderTranches(ctx context.Context, tranches []config.LadderTrancheDB) error
- func (m *MockConfigStore) SavePurchaseExecution(ctx context.Context, exec *config.PurchaseExecution) error
- func (m *MockConfigStore) SavePurchaseExecutionTx(ctx context.Context, tx pgx.Tx, execution *config.PurchaseExecution) error
- func (m *MockConfigStore) SavePurchaseHistory(ctx context.Context, record *config.PurchaseHistoryRecord) error
- func (m *MockConfigStore) SaveRIExchangeDirectExecution(ctx context.Context, record *config.RIExchangeDirectExecution) error
- func (m *MockConfigStore) SaveRIExchangeRecord(ctx context.Context, record *config.RIExchangeRecord) error
- func (m *MockConfigStore) SaveServiceConfig(ctx context.Context, cfg *config.ServiceConfig) error
- func (m *MockConfigStore) ScheduleApprovedExecution(ctx context.Context, executionID string, fromStatuses []string, ...) (*config.PurchaseExecution, error)
- func (m *MockConfigStore) ScheduleApprovedExecutionTokenPinned(ctx context.Context, executionID string, fromStatuses []string, ...) (*config.PurchaseExecution, error)
- func (m *MockConfigStore) SetCancelledBy(ctx context.Context, executionID, cancelledBy string) error
- func (m *MockConfigStore) SetExecutionRecommendationsIfEmptyTx(ctx context.Context, tx pgx.Tx, executionID string, ...) (bool, error)
- func (m *MockConfigStore) SetLadderSweepCeiling(ctx context.Context, configID string, usdPerHr *float64) error
- func (m *MockConfigStore) SetLadderSweepCeilingTx(ctx context.Context, tx pgx.Tx, configID string, usdPerHr *float64) error
- func (m *MockConfigStore) SetPlanAccounts(ctx context.Context, planID string, accountIDs []string) error
- func (m *MockConfigStore) SetPlanAccountsGated(ctx context.Context, planID string, accountIDs []string, ...) error
- func (m *MockConfigStore) SetPlanRampBaselineTx(ctx context.Context, tx pgx.Tx, planID string, ...) (bool, error)
- func (m *MockConfigStore) SetRecommendationsCollectionError(ctx context.Context, errMsg string) error
- func (m *MockConfigStore) SettleMarketplaceListing(ctx context.Context, settlement config.MarketplaceListingSettlement) (bool, error)
- func (m *MockConfigStore) StampFirstDispatchTx(ctx context.Context, tx pgx.Tx, executionID string, horizon time.Duration) (config.StampResult, error)
- func (m *MockConfigStore) StampOfferingClass(ctx context.Context, purchaseID, offeringClass string) error
- func (m *MockConfigStore) StampPlanNotificationSent(ctx context.Context, planID string, at time.Time) error
- func (m *MockConfigStore) StampRIExchangeApprovedBy(ctx context.Context, id, approverEmail string) error
- func (m *MockConfigStore) Test(t mock.TestingT)
- func (m *MockConfigStore) TransitionExecutionStatus(ctx context.Context, executionID string, fromStatuses []string, ...) (*config.PurchaseExecution, error)
- func (m *MockConfigStore) TransitionExecutionStatusPinned(ctx context.Context, executionID string, fromStatuses []string, ...) (*config.PurchaseExecution, error)
- func (m *MockConfigStore) TransitionExecutionStatusPinnedTx(ctx context.Context, tx pgx.Tx, executionID string, fromStatuses []string, ...) (*config.PurchaseExecution, error)
- func (m *MockConfigStore) TransitionExecutionStatusTokenPinned(ctx context.Context, executionID string, fromStatuses []string, ...) (*config.PurchaseExecution, error)
- func (m *MockConfigStore) TransitionLadderRunStatus(ctx context.Context, id string, fromStatuses []ladder.RunStatus, ...) (*config.LadderRunDB, error)
- func (m *MockConfigStore) TransitionRIExchangeStatus(ctx context.Context, id, fromStatus, toStatus string, actor *string) (*config.RIExchangeRecord, error)
- func (m *MockConfigStore) TransitionRegistrationStatus(ctx context.Context, reg *config.AccountRegistration, fromStatus string, ...) error
- func (m *MockConfigStore) UpdateAccountRegistration(ctx context.Context, reg *config.AccountRegistration) error
- func (m *MockConfigStore) UpdateAccountServiceOverrideAtomic(ctx context.Context, accountID, provider, service string, ...) (*config.AccountServiceOverride, error)
- func (m *MockConfigStore) UpdateCloudAccount(ctx context.Context, account *config.CloudAccount) error
- func (m *MockConfigStore) UpdateGlobalConfigAtomic(ctx context.Context, apply func(*config.GlobalConfig) error) (*config.GlobalConfig, error)
- func (m *MockConfigStore) UpdatePurchaseHistoryListing(ctx context.Context, purchaseID, listingID, listingState string) error
- func (m *MockConfigStore) UpdatePurchasePlan(ctx context.Context, plan *config.PurchasePlan) error
- func (m *MockConfigStore) UpdatePurchasePlanGated(ctx context.Context, plan *config.PurchasePlan, gate config.PlanWriteGate) error
- func (m *MockConfigStore) UpdatePurchasePlanTx(ctx context.Context, tx pgx.Tx, plan *config.PurchasePlan) error
- func (m *MockConfigStore) UpdateServiceConfigAtomic(ctx context.Context, provider, service string, ...) (*config.ServiceConfig, error)
- func (m *MockConfigStore) UpsertLadderConfig(ctx context.Context, cfg *config.LadderConfigDB) (*config.LadderConfigDB, error)
- func (m *MockConfigStore) UpsertLadderConfigTx(ctx context.Context, tx pgx.Tx, cfg *config.LadderConfigDB) (*config.LadderConfigDB, error)
- func (m *MockConfigStore) UpsertNotificationMute(ctx context.Context, recipientEmail, scope, unmuteToken string) error
- func (m *MockConfigStore) UpsertRIUtilizationCache(ctx context.Context, key config.RIUtilizationCacheKey, payload []byte, ...) error
- func (m *MockConfigStore) UpsertRecommendations(ctx context.Context, collectedAt time.Time, recs []config.RecommendationRecord, ...) error
- func (m *MockConfigStore) UpsertRecommendationsWithPartial(ctx context.Context, collectedAt time.Time, recs []config.RecommendationRecord, ...) error
- func (m *MockConfigStore) WithTx(ctx context.Context, fn func(tx pgx.Tx) error) error
- type MockEmailSender
- func (m *MockEmailSender) SendNewRecommendationsNotification(ctx context.Context, data email.NotificationData) error
- func (m *MockEmailSender) SendNotification(ctx context.Context, subject, message string) error
- func (m *MockEmailSender) SendPasswordResetEmail(ctx context.Context, emailAddr, resetURL string) error
- func (m *MockEmailSender) SendPurchaseApprovalRequest(ctx context.Context, data email.NotificationData) error
- func (m *MockEmailSender) SendPurchaseConfirmation(ctx context.Context, data email.NotificationData) error
- func (m *MockEmailSender) SendPurchaseExecutedNotification(ctx context.Context, data email.NotificationData) error
- func (m *MockEmailSender) SendPurchaseFailedNotification(ctx context.Context, data email.NotificationData) error
- func (m *MockEmailSender) SendRegistrationDecisionNotification(ctx context.Context, toEmail string, data email.RegistrationDecisionData) error
- func (m *MockEmailSender) SendRegistrationReceivedNotification(ctx context.Context, data email.RegistrationNotificationData) error
- func (m *MockEmailSender) SendScheduledPurchaseNotification(ctx context.Context, data email.NotificationData) error
- func (m *MockEmailSender) SendToEmail(ctx context.Context, toEmail, subject, body string) error
- type MockSESClient
- type MockSNSClient
- type MockSecretsManagerClient
- func (m *MockSecretsManagerClient) CreateSecret(ctx context.Context, input *secretsmanager.CreateSecretInput, ...) (*secretsmanager.CreateSecretOutput, error)
- func (m *MockSecretsManagerClient) GetSecretValue(ctx context.Context, input *secretsmanager.GetSecretValueInput, ...) (*secretsmanager.GetSecretValueOutput, error)
- func (m *MockSecretsManagerClient) Test(t mock.TestingT)
- func (m *MockSecretsManagerClient) UpdateSecret(ctx context.Context, input *secretsmanager.UpdateSecretInput, ...) (*secretsmanager.UpdateSecretOutput, error)
- type PlanNameFixture
- type SESAPI
- type SNSAPI
- type SecretsManagerAPI
Constants ¶
const MockInvocationToken = "mock-invocation-token"
MockInvocationToken is the default token MockConfigStore.ClaimCollectionInvocation returns when no expectation is registered. It differs from MockOwnerToken so tests can tell the re-stamped invocation token from the marker token.
const MockOwnerToken = "mock-owner-token"
MockOwnerToken is the default token MockConfigStore.MarkCollectionStarted returns when no expectation is registered, so existing tests that call it implicitly keep getting a non-empty token to thread through.
Variables ¶
var ErrHistorySummaryAggregateNotStubbed = errors.New("mock: HistorySummaryAggregate not stubbed")
ErrHistorySummaryAggregateNotStubbed is HistorySummaryAggregate's default error. The History handler treats an aggregate error as "totals unavailable" and falls back to summarizing the rows it fetched, so tests written before the aggregate existed (issue #675) keep asserting the page summary without registering an expectation.
Functions ¶
func PurchaseHistoryFixtureRowID ¶
PurchaseHistoryFixtureRowID is the row ID ListPurchaseHistoryPage gives the i-th row of a []config.PurchaseHistoryRecord fixture: a valid UUID, so a cursor built from it decodes, and later fixture rows sort lower.
Types ¶
type EmailSenderAPI ¶
type EmailSenderAPI interface {
SendNotification(ctx context.Context, subject, message string) error
SendToEmail(ctx context.Context, toEmail, subject, body string) error
SendNewRecommendationsNotification(ctx context.Context, data email.NotificationData) error
SendScheduledPurchaseNotification(ctx context.Context, data email.NotificationData) error
SendPurchaseConfirmation(ctx context.Context, data email.NotificationData) error
SendPurchaseFailedNotification(ctx context.Context, data email.NotificationData) error
SendPasswordResetEmail(ctx context.Context, email, resetURL string) error
SendPurchaseApprovalRequest(ctx context.Context, data email.NotificationData) error
SendPurchaseExecutedNotification(ctx context.Context, data email.NotificationData) error
}
EmailSenderAPI defines the interface for email sender operations.
type MockAuthStore ¶
MockAuthStore is a mock implementation of auth.Store.
func (*MockAuthStore) AdminExists ¶
func (m *MockAuthStore) AdminExists(ctx context.Context) (bool, error)
AdminExists mocks the AdminExists operation.
func (*MockAuthStore) ClaimMFALoginTokenAttempt ¶
func (m *MockAuthStore) ClaimMFALoginTokenAttempt(ctx context.Context, tokenHash string, maxAttempts int) (*auth.MFALoginToken, error)
func (*MockAuthStore) ClaimTOTPCounter ¶
func (*MockAuthStore) CleanupExpiredSessions ¶
func (m *MockAuthStore) CleanupExpiredSessions(ctx context.Context) error
CleanupExpiredSessions mocks the CleanupExpiredSessions operation.
func (*MockAuthStore) ClearPendingMFASecret ¶
func (m *MockAuthStore) ClearPendingMFASecret(ctx context.Context, userID string) error
func (*MockAuthStore) CompletePasswordReset ¶
func (*MockAuthStore) ConsumeMFALoginToken ¶
func (*MockAuthStore) ConsumeMFARecoveryCode ¶
func (*MockAuthStore) ConsumePasswordResetToken ¶
func (m *MockAuthStore) ConsumePasswordResetToken(ctx context.Context, userID, readResetToken string) error
func (*MockAuthStore) CountGroupMembers ¶
CountGroupMembers mocks the CountGroupMembers operation.
func (*MockAuthStore) CreateAPIKey ¶
func (m *MockAuthStore) CreateAPIKey(ctx context.Context, key *auth.UserAPIKey) error
CreateAPIKey mocks the CreateAPIKey operation.
func (*MockAuthStore) CreateAdminIfNone ¶
CreateAdminIfNone mocks the CreateAdminIfNone operation.
func (*MockAuthStore) CreateGroup ¶
CreateGroup mocks the CreateGroup operation.
func (*MockAuthStore) CreateMFALoginToken ¶
func (*MockAuthStore) CreateSession ¶
CreateSession mocks the CreateSession operation.
func (*MockAuthStore) CreateUser ¶
CreateUser mocks the CreateUser operation.
func (*MockAuthStore) DeleteAPIKey ¶
func (m *MockAuthStore) DeleteAPIKey(ctx context.Context, keyID string) error
DeleteAPIKey mocks the DeleteAPIKey operation.
func (*MockAuthStore) DeleteGroup ¶
func (m *MockAuthStore) DeleteGroup(ctx context.Context, groupID string) error
DeleteGroup mocks the DeleteGroup operation.
func (*MockAuthStore) DeleteSession ¶
func (m *MockAuthStore) DeleteSession(ctx context.Context, token string) error
DeleteSession mocks the DeleteSession operation.
func (*MockAuthStore) DeleteUser ¶
func (m *MockAuthStore) DeleteUser(ctx context.Context, userID string) error
DeleteUser mocks the DeleteUser operation.
func (*MockAuthStore) DeleteUserSessions ¶
func (m *MockAuthStore) DeleteUserSessions(ctx context.Context, userID string) error
DeleteUserSessions mocks the DeleteUserSessions operation.
func (*MockAuthStore) DisableMFA ¶
func (*MockAuthStore) GetAPIKeyByHash ¶
func (m *MockAuthStore) GetAPIKeyByHash(ctx context.Context, keyHash string) (*auth.UserAPIKey, error)
GetAPIKeyByHash mocks the GetAPIKeyByHash operation.
func (*MockAuthStore) GetAPIKeyByID ¶
func (m *MockAuthStore) GetAPIKeyByID(ctx context.Context, keyID string) (*auth.UserAPIKey, error)
GetAPIKeyByID mocks the GetAPIKeyByID operation.
func (*MockAuthStore) GetSession ¶
GetSession mocks the GetSession operation.
func (*MockAuthStore) GetUserByEmail ¶
GetUserByEmail mocks the GetUserByEmail operation.
func (*MockAuthStore) GetUserByID ¶
GetUserByID mocks the GetUserByID operation.
func (*MockAuthStore) GetUserByResetToken ¶
GetUserByResetToken mocks the GetUserByResetToken operation.
func (*MockAuthStore) ListAPIKeysByUser ¶
func (m *MockAuthStore) ListAPIKeysByUser(ctx context.Context, userID string) ([]*auth.UserAPIKey, error)
ListAPIKeysByUser mocks the ListAPIKeysByUser operation.
func (*MockAuthStore) ListGroups ¶
ListGroups mocks the ListGroups operation.
func (*MockAuthStore) Ping ¶
func (m *MockAuthStore) Ping(ctx context.Context) error
Ping mocks the Ping operation.
func (*MockAuthStore) RecordAPIKeyUsage ¶
RecordAPIKeyUsage mocks the RecordAPIKeyUsage operation.
func (*MockAuthStore) RecordFailedLogin ¶
func (m *MockAuthStore) RecordFailedLogin(ctx context.Context, userID string) error
func (*MockAuthStore) RecordSuccessfulLogin ¶
func (m *MockAuthStore) RecordSuccessfulLogin(ctx context.Context, userID string) error
func (*MockAuthStore) ReplaceMFARecoveryCodes ¶
func (*MockAuthStore) SetPasswordResetToken ¶
func (*MockAuthStore) SetPendingMFASecret ¶
func (*MockAuthStore) Test ¶
func (m *MockAuthStore) Test(t mock.TestingT)
Test registers t with the mock. See MockConfigStore.Test.
func (*MockAuthStore) UpdateAPIKey ¶
func (m *MockAuthStore) UpdateAPIKey(ctx context.Context, key *auth.UserAPIKey) error
UpdateAPIKey mocks the UpdateAPIKey operation.
func (*MockAuthStore) UpdateGroup ¶
UpdateGroup mocks the UpdateGroup operation.
func (*MockAuthStore) UpdateUserAdminFields ¶
func (*MockAuthStore) UpdateUserCredentials ¶
type MockConfigStore ¶
type MockConfigStore struct {
CountLiveExecutionsForAccountFn func(ctx context.Context, accountID string) (int, error)
ListPendingExecutionIDsForAccountFn func(ctx context.Context, accountID string) ([]string, error)
ListCloudAccountsFn func(ctx context.Context, filter config.CloudAccountFilter) ([]config.CloudAccount, error)
CreateCloudAccountFn func(ctx context.Context, account *config.CloudAccount) error
SetPlanAccountsFn func(ctx context.Context, planID string, accountIDs []string) error
GetPlanAccountsFn func(ctx context.Context, planID string) ([]config.CloudAccount, error)
SaveAccountServiceOverrideFn func(ctx context.Context, override *config.AccountServiceOverride) error
CountPendingExecutionsForAccountFn func(ctx context.Context, accountID string) (int, error)
GetPurchasePlanFn func(ctx context.Context, planID string) (*config.PurchasePlan, error)
DeleteCloudAccountFn func(ctx context.Context, id string) error
SavePurchaseExecutionFn func(ctx context.Context, exec *config.PurchaseExecution) error
PinExecutionFanOutShapeFn func(ctx context.Context, lineageKey, shape string) (string, error)
GetExecutionFanOutShapeFn func(ctx context.Context, lineageKey string) (string, error)
GetUserEmailByIDFn func(ctx context.Context, userID string) (string, error)
// NameTakenFixture, when set, stands in for an existing plan of the same
// name: CreatePurchasePlanWithAccounts passes its Accounts to the visible
// predicate and refuses with a PlanNameTakenError when it reports true.
NameTakenFixture *PlanNameFixture
GetCloudAccountFn func(ctx context.Context, id string) (*config.CloudAccount, error)
GetCloudAccountByExternalIDFn func(ctx context.Context, provider, externalID string) (*config.CloudAccount, error)
mock.Mock
// contains filtered or unexported fields
}
MockConfigStore is a shared testify-based mock for config.StoreInterface.
Most methods dispatch through m.Called only when an expectation has been registered via .On(). Methods that pre-existing tests call implicitly (without expectations) default to sensible zero-values so those tests keep working without changes. The "default or dispatch" behavior is controlled by the isExpected helper at the bottom of this file.
Fn-override fields allow tests to inject behavior without registering testify expectations. The precedence order for every overridable method is:
- FnField (non-nil closure wins first)
- Registered .On() expectation (dispatches through m.Called)
- Hardcoded default (zero-value / sensible stub)
Because paths 1 and 3 never reach m.Called, every method records its own invocation in callLog before branching, and AssertCalled / AssertNotCalled / AssertNumberOfCalls read that log instead of mock.Mock.Calls. See assertions.go for why reading mock.Mock.Calls made those assertions unfailable.
func (*MockConfigStore) ApproveAccountRegistration ¶
func (m *MockConfigStore) ApproveAccountRegistration(ctx context.Context, reg *config.AccountRegistration, account *config.CloudAccount, actor *string) error
func (*MockConfigStore) AssertCalled ¶
func (m *MockConfigStore) AssertCalled(t mock.TestingT, method string, arguments ...interface{}) bool
AssertCalled asserts that method was invoked with arguments satisfying the given matchers. It shadows the promoted testify method so it reads the complete call log rather than mock.Mock.Calls; pass no arguments to assert the method was called at all.
mock.TestingT has no Helper method, so the assertion helpers type-assert for it inline. t.Helper() marks its own caller, so delegating that to a shared function would report every failure at that function's line instead of the assertion's call site.
func (*MockConfigStore) AssertNotCalled ¶
func (m *MockConfigStore) AssertNotCalled(t mock.TestingT, method string, arguments ...interface{}) bool
AssertNotCalled asserts that method was never invoked with arguments satisfying the given matchers. It shadows the promoted testify method so it reads the complete call log rather than mock.Mock.Calls; pass no arguments to assert the method was not called at all.
func (*MockConfigStore) AssertNumberOfCalls ¶
func (m *MockConfigStore) AssertNumberOfCalls(t mock.TestingT, method string, expectedCalls int) bool
AssertNumberOfCalls asserts how many times method was invoked, with any arguments. It shadows the promoted testify method so it reads the complete call log rather than mock.Mock.Calls.
func (*MockConfigStore) CancelAllPendingExchanges ¶
func (m *MockConfigStore) CancelAllPendingExchanges(ctx context.Context) (int64, error)
func (*MockConfigStore) CancelExecutionAtomic ¶
func (m *MockConfigStore) CancelExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string) (bool, string, error)
CancelExecutionAtomic mocks the CancelExecutionAtomic operation. Defaults to (true, "canceled", nil) when no expectation is registered so tests that only need the happy path don't require explicit mock setup. Tests exercising the CAS-race path (zero rows affected) register an expectation that returns (false, <racing_status>, nil).
func (*MockConfigStore) CancelExecutionAtomicTokenPinned ¶
func (m *MockConfigStore) CancelExecutionAtomicTokenPinned(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string, rawToken string) (bool, string, error)
CancelExecutionAtomicTokenPinned mocks the token-pinned cancel (issue #1190). Like TransitionExecutionStatusTokenPinned it has no default and does not delegate to CancelExecutionAtomic: a caller that must pin the approval token is expected to call this method, so a test has to register it explicitly.
func (*MockConfigStore) CancelLadderRun ¶
func (m *MockConfigStore) CancelLadderRun(ctx context.Context, id string, fromStatuses []ladder.RunStatus, cancelledBy string) (*config.LadderRunDB, error)
CancelLadderRun mocks the CancelLadderRun operation. Returns (nil, nil) when no expectation is registered (CAS race-lost path).
func (*MockConfigStore) CancelPendingExchangesByOrigin ¶
func (m *MockConfigStore) CancelPendingExchangesByOrigin(ctx context.Context, origin common.ExchangeOrigin) (int64, error)
func (*MockConfigStore) CancelScheduledExecutionAtomic ¶
func (m *MockConfigStore) CancelScheduledExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID string, cancelledBy *string) (bool, string, error)
CancelScheduledExecutionAtomic mocks the CancelScheduledExecutionAtomic operation (Gmail-style pre-fire delay revoke, issue #290 wave-2). Default is the happy path (true, "canceled", nil) so the scheduled-revoke tests inherit the same low-ceremony pattern as CancelExecutionAtomic above. Tests exercising the CAS-race path (scheduler tick already fired) register an expectation that returns (false, <racing_status>, nil), typically (false, "approved", nil) to simulate the scheduler winning the race.
func (*MockConfigStore) ClaimCollectionInvocation ¶
func (m *MockConfigStore) ClaimCollectionInvocation(ctx context.Context, markerToken string) (token string, ok bool, err error)
ClaimCollectionInvocation mocks the ClaimCollectionInvocation operation. Defaults to (MockInvocationToken, true, nil) when no expectation is registered, so a token-carrying collect run that wins the lock keeps owning the marker under a distinct invocation token.
func (*MockConfigStore) ClaimMarketplaceListingSlot ¶
func (m *MockConfigStore) ClaimMarketplaceListingSlot(ctx context.Context, purchaseID, clientToken string, priceSchedule []byte) (*config.MarketplaceListingClaim, error)
ClaimMarketplaceListingSlot mocks the atomic listing-slot claim (issue #292).
func (*MockConfigStore) ClaimRIExchangeIdempotencyKey ¶
func (m *MockConfigStore) ClaimRIExchangeIdempotencyKey(ctx context.Context, key string, window time.Duration) (bool, error)
ClaimRIExchangeIdempotencyKey mocks the atomic RI exchange submit claim (issue #1642). With no registered expectation it defaults to "this call won the claim" so the many pre-existing execute-path tests, whose subject is a gate upstream of the claim, keep exercising the commit call. Tests whose subject IS the claim register an explicit expectation and assert on it.
func (*MockConfigStore) CleanupOldExecutions ¶
func (m *MockConfigStore) CleanupOldExecutions(ctx context.Context, retentionDays int) (int64, error)
CleanupOldExecutions mocks the CleanupOldExecutions operation.
func (*MockConfigStore) ClearCollectionStarted ¶
func (m *MockConfigStore) ClearCollectionStarted(ctx context.Context, token string) error
ClearCollectionStarted mocks the ClearCollectionStarted operation. Defaults to nil when no expectation is registered.
func (*MockConfigStore) ClearRegistrationCredentialPayload ¶
func (m *MockConfigStore) ClearRegistrationCredentialPayload(ctx context.Context, registrationID string) error
func (*MockConfigStore) ClearRevocationInFlight ¶
func (m *MockConfigStore) ClearRevocationInFlight(ctx context.Context, purchaseID string) error
ClearRevocationInFlight mocks ClearRevocationInFlight (issue #290 second-wave CR Finding D). Uses the isExpected default-or-dispatch pattern: tests that only test error paths where Azure never actually returned do not need to register an expectation.
func (*MockConfigStore) CompletePlanStep ¶
func (m *MockConfigStore) CompletePlanStep(ctx context.Context, planID string, stepNumber int) error
CompletePlanStep mocks the idempotent ramp-step advance operation.
func (*MockConfigStore) CompleteRIExchange ¶
func (m *MockConfigStore) CompleteRIExchange(ctx context.Context, id, exchangeID string) error
func (*MockConfigStore) CompleteRIExchangeWithPayment ¶
func (m *MockConfigStore) CompleteRIExchangeWithPayment(ctx context.Context, id, exchangeID, acceptedPaymentDue string) error
func (*MockConfigStore) CompleteTargetMetStepTx ¶
func (*MockConfigStore) CountExecutionsByPlanAndStatus ¶
func (m *MockConfigStore) CountExecutionsByPlanAndStatus(ctx context.Context, statuses []string, since time.Time) (map[string]config.ExecutionStatusCounts, error)
CountExecutionsByPlanAndStatus mocks the CountExecutionsByPlanAndStatus operation.
func (*MockConfigStore) CountLadderRunTrancheStatuses ¶
func (m *MockConfigStore) CountLadderRunTrancheStatuses(ctx context.Context, runID string) (map[ladder.TrancheStatus]int, error)
CountLadderRunTrancheStatuses mocks the CountLadderRunTrancheStatuses operation. Defaults to an empty count when no expectation is registered.
func (*MockConfigStore) CountLiveExecutionsForAccount ¶
func (m *MockConfigStore) CountLiveExecutionsForAccount(ctx context.Context, accountID string) (int, error)
CountLiveExecutionsForAccount mocks the CountLiveExecutionsForAccount operation. Defaults to (0, nil) when no Fn is set and no expectation is registered.
func (*MockConfigStore) CountPendingExecutionsForAccount ¶
func (m *MockConfigStore) CountPendingExecutionsForAccount(ctx context.Context, accountID string) (int, error)
CountPendingExecutionsForAccount mocks the CountPendingExecutionsForAccount operation. Defaults to (0, nil) when no Fn is set and no expectation is registered.
func (*MockConfigStore) CreateAccountRegistration ¶
func (m *MockConfigStore) CreateAccountRegistration(ctx context.Context, reg *config.AccountRegistration) error
func (*MockConfigStore) CreateCloudAccount ¶
func (m *MockConfigStore) CreateCloudAccount(ctx context.Context, account *config.CloudAccount) error
func (*MockConfigStore) CreatePurchasePlan ¶
func (m *MockConfigStore) CreatePurchasePlan(ctx context.Context, plan *config.PurchasePlan) error
CreatePurchasePlan mocks the CreatePurchasePlan operation.
func (*MockConfigStore) CreatePurchasePlanWithAccounts ¶
func (m *MockConfigStore) CreatePurchasePlanWithAccounts(ctx context.Context, plan *config.PurchasePlan, accountIDs []string, visible func(accounts []config.CloudAccount) bool) error
CreatePurchasePlanWithAccounts mocks the operation. It calls visible with NameTakenFixture's accounts, so a handler test fails if the predicate is wrong. With the fixture unset or invisible it uses a registered expectation (arguments: ctx, plan, accountIDs, the predicate) and otherwise returns nil.
func (*MockConfigStore) CreateSuppression ¶
func (m *MockConfigStore) CreateSuppression(ctx context.Context, sup *config.PurchaseSuppression) error
func (*MockConfigStore) CreateSuppressionTx ¶
func (m *MockConfigStore) CreateSuppressionTx(ctx context.Context, tx pgx.Tx, sup *config.PurchaseSuppression) error
func (*MockConfigStore) DeleteAccountCredentials ¶
func (m *MockConfigStore) DeleteAccountCredentials(ctx context.Context, accountID string) error
func (*MockConfigStore) DeleteAccountRegistration ¶
func (m *MockConfigStore) DeleteAccountRegistration(ctx context.Context, id string) error
func (*MockConfigStore) DeleteAccountServiceOverride ¶
func (m *MockConfigStore) DeleteAccountServiceOverride(ctx context.Context, accountID, provider, service string) error
func (*MockConfigStore) DeleteAccountServiceOverrideAuditedTx ¶
func (m *MockConfigStore) DeleteAccountServiceOverrideAuditedTx(ctx context.Context, tx pgx.Tx, accountID, provider, service string, audit config.AuditContext) error
DeleteAccountServiceOverrideAuditedTx falls back to DeleteAccountServiceOverride when no expectation is registered.
func (*MockConfigStore) DeleteCloudAccount ¶
func (m *MockConfigStore) DeleteCloudAccount(ctx context.Context, id string) error
func (*MockConfigStore) DeletePurchasePlan ¶
func (m *MockConfigStore) DeletePurchasePlan(ctx context.Context, planID string) error
DeletePurchasePlan mocks the DeletePurchasePlan operation.
func (*MockConfigStore) DeleteSuppressionsByExecution ¶
func (m *MockConfigStore) DeleteSuppressionsByExecution(ctx context.Context, executionID string) error
func (*MockConfigStore) DeleteSuppressionsByExecutionTx ¶
func (*MockConfigStore) ExpireExecutionAtomic ¶
func (*MockConfigStore) FailRIExchange ¶
func (m *MockConfigStore) FailRIExchange(ctx context.Context, id, errorMsg string) error
func (*MockConfigStore) FamilyRetryClaimedTx ¶
func (m *MockConfigStore) FamilyRetryClaimedTx(ctx context.Context, tx pgx.Tx, family, planID, selfID string, selfIsRoot bool) (bool, error)
FamilyRetryClaimedTx mocks the fan-out family claim query (no default: testify panics if unexpected).
func (*MockConfigStore) FinalizeRIExchangeDirectExecution ¶
func (m *MockConfigStore) FinalizeRIExchangeDirectExecution(ctx context.Context, id string, outcome config.RIExchangeDirectOutcome) error
FinalizeRIExchangeDirectExecution mocks recording the direct-execute outcome (issue #82). Defaults to success like SaveRIExchangeDirectExecution.
func (*MockConfigStore) FindOpenRedshiftLineageConflictsTx ¶
func (m *MockConfigStore) FindOpenRedshiftLineageConflictsTx(ctx context.Context, tx pgx.Tx, selfID, family string, tuples []config.RedshiftTuple, accountID *string, horizon time.Duration, stamp time.Time, window, settle time.Duration) ([]config.RedshiftLineageConflict, error)
FindOpenRedshiftLineageConflictsTx mocks the Redshift lineage conflict query (no default: testify panics if unexpected).
func (*MockConfigStore) FlipPurchaseRevocationInFlight ¶
func (m *MockConfigStore) FlipPurchaseRevocationInFlight(ctx context.Context, purchaseID string) error
FlipPurchaseRevocationInFlight mocks FlipPurchaseRevocationInFlight (issue #290 Finding #6). Uses the isExpected default-or-dispatch pattern: tests that only verify MarkPurchaseRevoked do not need to set an expectation for this best-effort call.
func (*MockConfigStore) GetAccountCredential ¶
func (*MockConfigStore) GetAccountRegistration ¶
func (m *MockConfigStore) GetAccountRegistration(ctx context.Context, id string) (*config.AccountRegistration, error)
func (*MockConfigStore) GetAccountRegistrationByToken ¶
func (m *MockConfigStore) GetAccountRegistrationByToken(ctx context.Context, token string) (*config.AccountRegistration, error)
func (*MockConfigStore) GetAccountServiceOverride ¶
func (m *MockConfigStore) GetAccountServiceOverride(ctx context.Context, accountID, provider, service string) (*config.AccountServiceOverride, error)
func (*MockConfigStore) GetActivePurchaseHistory ¶
func (m *MockConfigStore) GetActivePurchaseHistory(ctx context.Context, asOf time.Time, accountIDs []string, externalIDsByProvider map[string][]string) ([]config.PurchaseHistoryRecord, error)
GetActivePurchaseHistory mocks the GetActivePurchaseHistory operation.
func (*MockConfigStore) GetAllPurchaseHistory ¶
func (m *MockConfigStore) GetAllPurchaseHistory(ctx context.Context, limit int) ([]config.PurchaseHistoryRecord, error)
GetAllPurchaseHistory mocks the GetAllPurchaseHistory operation.
func (*MockConfigStore) GetCloudAccount ¶
func (m *MockConfigStore) GetCloudAccount(ctx context.Context, id string) (*config.CloudAccount, error)
GetCloudAccount defaults to returning a minimal stub {ID: id} when no Fn is set and no expectation is registered, so tests that don't care about account fields keep working without explicit setup.
func (*MockConfigStore) GetCloudAccountByExternalID ¶
func (m *MockConfigStore) GetCloudAccountByExternalID(ctx context.Context, provider, externalID string) (*config.CloudAccount, error)
func (*MockConfigStore) GetDoomedNextRoots ¶
func (m *MockConfigStore) GetDoomedNextRoots(ctx context.Context, now time.Time) (map[string]config.DoomedRoot, error)
GetDoomedNextRoots mocks the doomed-root report backing plan health. Unregistered by default, like GetStuckRampSteps: no doomed root is the shape of a plan with nothing wrong with it.
func (*MockConfigStore) GetExecutionByID ¶
func (m *MockConfigStore) GetExecutionByID(ctx context.Context, executionID string) (*config.PurchaseExecution, error)
GetExecutionByID mocks the GetExecutionByID operation.
func (*MockConfigStore) GetExecutionByPlanAndDate ¶
func (m *MockConfigStore) GetExecutionByPlanAndDate(ctx context.Context, planID string, scheduledDate time.Time) (*config.PurchaseExecution, error)
GetExecutionByPlanAndDate mocks the GetExecutionByPlanAndDate operation.
func (*MockConfigStore) GetExecutionFanOutShape ¶
func (m *MockConfigStore) GetExecutionFanOutShape(ctx context.Context, lineageKey string) (string, error)
GetExecutionFanOutShape mocks the pinned-shape read (issue #97). GetExecutionFanOutShapeFn takes priority; with no expectation registered it reads what PinExecutionFanOutShape's default pinned on this mock.
func (*MockConfigStore) GetExecutionsByStatuses ¶
func (m *MockConfigStore) GetExecutionsByStatuses(ctx context.Context, statuses []string, limit int) ([]config.PurchaseExecution, error)
GetExecutionsByStatuses mocks the GetExecutionsByStatuses operation.
func (*MockConfigStore) GetExecutionsByStatusesFiltered ¶
func (m *MockConfigStore) GetExecutionsByStatusesFiltered(ctx context.Context, q config.ExecutionsByStatusesQuery) ([]config.PurchaseExecution, error)
GetExecutionsByStatusesFiltered mocks the GetExecutionsByStatusesFiltered operation. Without an expectation for it, it answers from the GetExecutionsByStatuses expectation: the unfiltered rows are a superset of the filtered ones, and the History handler re-applies every filter in Go, so tests written against GetExecutionsByStatuses keep working.
func (*MockConfigStore) GetGlobalConfig ¶
func (m *MockConfigStore) GetGlobalConfig(ctx context.Context) (*config.GlobalConfig, error)
GetGlobalConfig mocks the GetGlobalConfig operation. Returns an empty GlobalConfig when no expectation is registered so callers that only need default field values don't require explicit mock setup.
func (*MockConfigStore) GetLadderConfig ¶
func (m *MockConfigStore) GetLadderConfig(ctx context.Context, cloudAccountID, provider string) (*config.LadderConfigDB, error)
GetLadderConfig mocks the GetLadderConfig operation. Returns (nil, nil) when no expectation is registered.
func (*MockConfigStore) GetLadderConfigs ¶
func (m *MockConfigStore) GetLadderConfigs(ctx context.Context) ([]config.LadderConfigDB, error)
GetLadderConfigs mocks the GetLadderConfigs operation. Returns an empty slice when no expectation is registered so tests that do not exercise laddering keep working without mock setup.
func (*MockConfigStore) GetLadderExecutionGate ¶
func (m *MockConfigStore) GetLadderExecutionGate(ctx context.Context, idempotencyKey string) (*config.LadderExecutionGate, error)
GetLadderExecutionGate mocks the operation. Defaults to (nil, nil), "not a ladder execution", when no expectation is registered.
func (*MockConfigStore) GetLadderRun ¶
func (m *MockConfigStore) GetLadderRun(ctx context.Context, id string) (*config.LadderRunDB, error)
GetLadderRun mocks the GetLadderRun operation. Returns (nil, nil) when no expectation is registered.
func (*MockConfigStore) GetLadderSweepCeiling ¶
func (m *MockConfigStore) GetLadderSweepCeiling(ctx context.Context, configID string) (*int64, error)
GetLadderSweepCeiling mocks the GetLadderSweepCeiling operation. Returns (nil, nil) when no expectation is registered.
func (*MockConfigStore) GetMarketplaceListingAttempt ¶
func (m *MockConfigStore) GetMarketplaceListingAttempt(ctx context.Context, purchaseID string) (*config.MarketplaceListingAttempt, error)
GetMarketplaceListingAttempt mocks reading a row's listing attempt (issue #525).
func (*MockConfigStore) GetMarketplaceListingProceedsTotals ¶
func (m *MockConfigStore) GetMarketplaceListingProceedsTotals(ctx context.Context, purchaseIDs, accountIDs []string, externalIDsByProvider map[string][]string) ([]config.MarketplaceListingProceedsTotal, error)
GetMarketplaceListingProceedsTotals mocks the per-RI marketplace proceeds totals (issue #1494).
func (*MockConfigStore) GetPendingExecutions ¶
func (m *MockConfigStore) GetPendingExecutions(ctx context.Context) ([]config.PurchaseExecution, error)
GetPendingExecutions mocks the GetPendingExecutions operation.
func (*MockConfigStore) GetPlanAccounts ¶
func (m *MockConfigStore) GetPlanAccounts(ctx context.Context, planID string) ([]config.CloudAccount, error)
func (*MockConfigStore) GetPlanRampBaselineTx ¶
func (m *MockConfigStore) GetPlanRampBaselineTx(ctx context.Context, tx pgx.Tx, planID string) (config.PlanRampBaseline, error)
func (*MockConfigStore) GetPlannedExecutions ¶
func (m *MockConfigStore) GetPlannedExecutions(ctx context.Context, statuses []string, limit int) ([]config.PurchaseExecution, error)
GetPlannedExecutions mocks the GetPlannedExecutions operation.
func (*MockConfigStore) GetPurchaseHistory ¶
func (m *MockConfigStore) GetPurchaseHistory(ctx context.Context, accountID string, limit int) ([]config.PurchaseHistoryRecord, error)
GetPurchaseHistory mocks the GetPurchaseHistory operation.
func (*MockConfigStore) GetPurchaseHistoryByPurchaseID ¶
func (m *MockConfigStore) GetPurchaseHistoryByPurchaseID(ctx context.Context, purchaseID string) (*config.PurchaseHistoryRecord, error)
GetPurchaseHistoryByPurchaseID mocks the single-row lookup by purchase_id (issues #290, #292).
func (*MockConfigStore) GetPurchaseHistoryFiltered ¶
func (m *MockConfigStore) GetPurchaseHistoryFiltered(ctx context.Context, filter config.PurchaseHistoryFilter) ([]config.PurchaseHistoryRecord, error)
GetPurchaseHistoryFiltered mocks the GetPurchaseHistoryFiltered operation (issue #701).
func (*MockConfigStore) GetPurchaseHistoryInFlight ¶
func (m *MockConfigStore) GetPurchaseHistoryInFlight(ctx context.Context) ([]*config.PurchaseHistoryRecord, error)
GetPurchaseHistoryInFlight mocks GetPurchaseHistoryInFlight (issue #290 Finding #6).
func (*MockConfigStore) GetPurchasePlan ¶
func (m *MockConfigStore) GetPurchasePlan(ctx context.Context, planID string) (*config.PurchasePlan, error)
GetPurchasePlan mocks the GetPurchasePlan operation. When GetPurchasePlanFn is non-nil it takes priority. When no expectation is registered a minimal plan stub {ID: planID} is returned so tests that don't care about the plan fields keep working without explicit setup.
func (*MockConfigStore) GetRIExchangeDailySpend ¶
func (*MockConfigStore) GetRIExchangeHistory ¶
func (m *MockConfigStore) GetRIExchangeHistory(ctx context.Context, since time.Time, limit int) ([]config.RIExchangeRecord, error)
func (*MockConfigStore) GetRIExchangeHistoryForAccounts ¶
func (m *MockConfigStore) GetRIExchangeHistoryForAccounts(ctx context.Context, since time.Time, limit int, accountIDs []string) ([]config.RIExchangeRecord, error)
func (*MockConfigStore) GetRIExchangeRecord ¶
func (m *MockConfigStore) GetRIExchangeRecord(ctx context.Context, id string) (*config.RIExchangeRecord, error)
func (*MockConfigStore) GetRIExchangeRecordByToken ¶
func (m *MockConfigStore) GetRIExchangeRecordByToken(ctx context.Context, token string) (*config.RIExchangeRecord, error)
func (*MockConfigStore) GetRIUtilizationCache ¶
func (m *MockConfigStore) GetRIUtilizationCache(ctx context.Context, key config.RIUtilizationCacheKey) (*config.RIUtilizationCacheEntry, error)
func (*MockConfigStore) GetRecommendationsFreshness ¶
func (m *MockConfigStore) GetRecommendationsFreshness(ctx context.Context) (*config.RecommendationsFreshness, error)
func (*MockConfigStore) GetRedshiftRetryClock ¶
func (m *MockConfigStore) GetRedshiftRetryClock(ctx context.Context, executionID string) (config.RedshiftRetryClock, error)
GetRedshiftRetryClock mocks the Redshift retry clock read (no default: testify panics if unexpected).
func (*MockConfigStore) GetScheduledExecutionsDue ¶
func (m *MockConfigStore) GetScheduledExecutionsDue(ctx context.Context) ([]config.PurchaseExecution, error)
GetScheduledExecutionsDue mocks the GetScheduledExecutionsDue operation. Defaults to (nil, nil) when no expectation is registered so existing scheduler tests that don't exercise the pre-fire delay path keep working without changes.
func (*MockConfigStore) GetServiceConfig ¶
func (m *MockConfigStore) GetServiceConfig(ctx context.Context, provider, service string) (*config.ServiceConfig, error)
GetServiceConfig mocks the GetServiceConfig operation.
func (*MockConfigStore) GetStaleApprovedExecutions ¶
func (m *MockConfigStore) GetStaleApprovedExecutions(ctx context.Context, olderThan time.Duration) ([]config.PurchaseExecution, error)
GetStaleApprovedExecutions mocks the GetStaleApprovedExecutions operation.
func (*MockConfigStore) GetStaleProcessingExchanges ¶
func (m *MockConfigStore) GetStaleProcessingExchanges(ctx context.Context, olderThan time.Duration) ([]config.RIExchangeRecord, error)
func (*MockConfigStore) GetStuckRampSteps ¶
func (m *MockConfigStore) GetStuckRampSteps(ctx context.Context) (map[string]config.RampStepBlock, error)
GetStuckRampSteps mocks the stuck-ramp report backing plan health. Unregistered by default so the many tests that only care about the health score's execution counts stay green: no stuck steps is the shape of a plan with nothing wrong with it.
func (*MockConfigStore) GetUserEmailByID ¶
GetUserEmailByID mocks the GetUserEmailByID operation. Defaults to ("", nil) when no Fn is set and no expectation is registered, so tests that never exercise the 4-eyes identity-resolution path (mode off, the default) don't need to stub this method.
func (*MockConfigStore) HasAccountCredentials ¶
func (*MockConfigStore) HistorySummaryAggregate ¶
func (m *MockConfigStore) HistorySummaryAggregate(ctx context.Context, filter config.HistorySummaryFilter) (*config.HistorySummaryGroups, error)
HistorySummaryAggregate mocks the HistorySummaryAggregate operation. With no expectation registered it returns ErrHistorySummaryAggregateNotStubbed.
func (*MockConfigStore) IsNotificationMuted ¶
func (m *MockConfigStore) IsNotificationMuted(ctx context.Context, recipientEmail, scope string) (bool, error)
IsNotificationMuted mocks the IsNotificationMuted operation. Defaults to (false, nil) when no expectation is registered.
func (*MockConfigStore) LatestLadderRunID ¶
LatestLadderRunID mocks the LatestLadderRunID operation. Returns config.ErrNotFound when no expectation is registered (fail closed).
func (*MockConfigStore) LatestLadderRunStartedAt ¶
func (m *MockConfigStore) LatestLadderRunStartedAt(ctx context.Context, configID string) (*time.Time, error)
LatestLadderRunStartedAt mocks the LatestLadderRunStartedAt operation. Returns (nil, nil) when no expectation is registered.
func (*MockConfigStore) LinkRetryExecutionAtomic ¶
func (m *MockConfigStore) LinkRetryExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID, retryExecutionID string) (bool, error)
LinkRetryExecutionAtomic mocks the LinkRetryExecutionAtomic operation. Defaults to (true, nil) when no expectation is registered so tests that only need the happy path don't require explicit mock setup. Tests exercising the CAS-race path (a concurrent retry already claimed the row) register an expectation that returns (false, nil).
func (*MockConfigStore) LinkUnsentRetryExecutionAtomic ¶
func (m *MockConfigStore) LinkUnsentRetryExecutionAtomic(ctx context.Context, tx pgx.Tx, executionID, retryExecutionID string) (bool, error)
LinkUnsentRetryExecutionAtomic mocks the proven-unsent link CAS (no default: testify panics if unexpected).
func (*MockConfigStore) ListAccountRegistrations ¶
func (m *MockConfigStore) ListAccountRegistrations(ctx context.Context, filter config.AccountRegistrationFilter) ([]config.AccountRegistration, error)
func (*MockConfigStore) ListAccountServiceOverrides ¶
func (m *MockConfigStore) ListAccountServiceOverrides(ctx context.Context, accountID string) ([]config.AccountServiceOverride, error)
func (*MockConfigStore) ListActiveSuppressions ¶
func (m *MockConfigStore) ListActiveSuppressions(ctx context.Context) ([]config.PurchaseSuppression, error)
func (*MockConfigStore) ListCloudAccounts ¶
func (m *MockConfigStore) ListCloudAccounts(ctx context.Context, filter config.CloudAccountFilter) ([]config.CloudAccount, error)
func (*MockConfigStore) ListExecutionsForPlanStepTx ¶
func (m *MockConfigStore) ListExecutionsForPlanStepTx(ctx context.Context, tx pgx.Tx, planID string, stepNumber int) ([]config.PurchaseExecution, error)
OccupiedRampStepsInRangeTx mocks the already-covered ramp-step probe. Unregistered by default so the many create-purchases tests that predate the probe keep exercising the create path: no occupied steps in range is the shape of a plan whose next steps are still unscheduled, which is what those tests set up.
func (*MockConfigStore) ListHistoryExecutionsPage ¶
func (m *MockConfigStore) ListHistoryExecutionsPage(ctx context.Context, q config.HistoryExecutionsPageQuery) ([]config.PurchaseExecution, error)
ListHistoryExecutionsPage mocks the ListHistoryExecutionsPage operation. With no expectation registered it returns no rows. A registered expectation's rows go through the store contract (see pageExecutionsLikeStore), so a test can return one unordered fixture and page through it.
func (*MockConfigStore) ListMarketplaceListingsToPoll ¶
func (m *MockConfigStore) ListMarketplaceListingsToPoll(ctx context.Context) ([]config.PurchaseHistoryRecord, error)
ListMarketplaceListingsToPoll mocks the marketplace status poller's row scan (issue #27).
func (*MockConfigStore) ListPendingExecutionIDsForAccount ¶
func (m *MockConfigStore) ListPendingExecutionIDsForAccount(ctx context.Context, accountID string) ([]string, error)
ListPendingExecutionIDsForAccount mocks the ListPendingExecutionIDsForAccount operation. Defaults to (nil, nil) when no Fn is set and no expectation is registered.
func (*MockConfigStore) ListPlanCommittedTx ¶
func (m *MockConfigStore) ListPlanCommittedTx(ctx context.Context, tx pgx.Tx, planID string) (map[string]config.PlanRampQuantity, error)
func (*MockConfigStore) ListPurchaseHistoryPage ¶
func (m *MockConfigStore) ListPurchaseHistoryPage(ctx context.Context, filter config.PurchaseHistoryFilter, after *config.HistoryPageKey) ([]config.PurchaseHistoryPageRow, error)
ListPurchaseHistoryPage mocks the ListPurchaseHistoryPage operation. With no expectation registered it returns no rows. A registered expectation's rows are ordered, resumed after `after` and capped like the store does; the filter's predicates are not applied (match on the filter argument instead). The expectation may return []config.PurchaseHistoryPageRow, or plain []config.PurchaseHistoryRecord fixtures, which get row IDs from their position in the fixture (see PurchaseHistoryFixtureRowID).
func (*MockConfigStore) ListPurchasePlans ¶
func (m *MockConfigStore) ListPurchasePlans(ctx context.Context, filter config.PurchasePlanFilter) ([]config.PurchasePlan, error)
ListPurchasePlans mocks the ListPurchasePlans operation.
func (*MockConfigStore) ListRecentSubmitsTx ¶
func (m *MockConfigStore) ListRecentSubmitsTx(ctx context.Context, tx pgx.Tx, creatorID string, since time.Time) ([]config.PurchaseExecution, error)
ListRecentSubmitsTx mocks the ListRecentSubmitsTx operation. It falls back to GetPendingExecutions when no expectation is registered so tests that exercise the WithTx path keep receiving the pending list; the caller filters by creator and window. With neither registered it returns no rows: retry tests (which now pass through the submit dedupe, issue #760) need no stub unless they exercise a duplicate.
func (*MockConfigStore) ListServiceConfigs ¶
func (m *MockConfigStore) ListServiceConfigs(ctx context.Context) ([]config.ServiceConfig, error)
ListServiceConfigs mocks the ListServiceConfigs operation.
func (*MockConfigStore) ListStoredRecommendationTriples ¶
func (m *MockConfigStore) ListStoredRecommendationTriples(ctx context.Context, scope config.RecommendationListScope) ([]config.RecommendationTriple, error)
func (*MockConfigStore) ListStoredRecommendations ¶
func (m *MockConfigStore) ListStoredRecommendations(ctx context.Context, filter config.RecommendationFilter) ([]config.RecommendationRecord, error)
func (*MockConfigStore) ListStoredRecommendationsChunk ¶
func (m *MockConfigStore) ListStoredRecommendationsChunk(ctx context.Context, filter config.RecommendationFilter, after *config.RecommendationScanKey, limit int) (config.RecommendationChunk, error)
func (*MockConfigStore) ListStuckExecutions ¶
func (m *MockConfigStore) ListStuckExecutions(ctx context.Context, statuses []string, olderThan time.Duration) ([]config.PurchaseExecution, error)
ListStuckExecutions mocks the ListStuckExecutions operation.
func (*MockConfigStore) LockLadderTrancheForRetryTx ¶
func (m *MockConfigStore) LockLadderTrancheForRetryTx(ctx context.Context, tx pgx.Tx, idempotencyKey string) (ladder.TrancheStatus, bool, error)
LockLadderTrancheForRetryTx mocks the operation. Defaults to (not a ladder execution) when no expectation is registered.
func (*MockConfigStore) LockPlanProvidersTx ¶
func (m *MockConfigStore) LockPlanProvidersTx(ctx context.Context, tx pgx.Tx, providers []string) error
LockPlanProvidersTx mocks the per-provider advisory lock. A mock cannot hold a lock, so it succeeds unless an expectation says otherwise; the real contract is measured against Postgres in the purchase integration tests.
func (*MockConfigStore) LockPurchasePlanTx ¶
func (m *MockConfigStore) LockPurchasePlanTx(ctx context.Context, tx pgx.Tx, planID string) (*config.PurchasePlan, error)
LockPurchasePlanTx mocks the per-plan ramp lock. Falls back to GetPurchasePlan when no expectation is registered, so tests that only care about what the transaction writes keep working: the lock is a concurrency property, and a mock cannot hold one anyway. The real contract is measured against Postgres in the api integration tests.
func (*MockConfigStore) LockRedshiftTuplesTx ¶
func (m *MockConfigStore) LockRedshiftTuplesTx(ctx context.Context, tx pgx.Tx, tuples []config.RedshiftTuple) error
LockRedshiftTuplesTx mocks the Redshift tuple advisory locks (no default: testify panics if unexpected).
func (*MockConfigStore) LockRetryFamilyTx ¶
LockRetryFamilyTx mocks the fan-out family advisory lock (no default: testify panics if unexpected).
func (*MockConfigStore) MarkCollectionStarted ¶
func (m *MockConfigStore) MarkCollectionStarted(ctx context.Context) (token string, ok bool, err error)
MarkCollectionStarted mocks the MarkCollectionStarted operation. Defaults to (MockOwnerToken, true, nil) when no expectation is registered.
func (*MockConfigStore) MarkPurchaseRevoked ¶
func (m *MockConfigStore) MarkPurchaseRevoked(ctx context.Context, purchaseID string, revokedAt time.Time, revokedVia, supportCaseID string, calcRefundAmount *float64, calcRefundCurrency string) error
MarkPurchaseRevoked mocks the MarkPurchaseRevoked operation (issue #290).
func (*MockConfigStore) MarkRevocationReturnPosted ¶
func (m *MockConfigStore) MarkRevocationReturnPosted(ctx context.Context, purchaseID string) error
MarkRevocationReturnPosted mocks MarkRevocationReturnPosted (issue #1523). Uses the isExpected default-or-dispatch pattern: revoke tests that only verify MarkPurchaseRevoked do not need an expectation for this stamp.
func (*MockConfigStore) NoteRIExchangeOutcomeUnknown ¶
func (m *MockConfigStore) NoteRIExchangeOutcomeUnknown(ctx context.Context, id, note string) error
func (*MockConfigStore) OccupiedRampStepsInRangeTx ¶
func (*MockConfigStore) PageStoredRecommendations ¶
func (m *MockConfigStore) PageStoredRecommendations(ctx context.Context, q config.RecommendationPageQuery) (config.RecommendationPage, error)
PageStoredRecommendations defaults to an empty cache: an empty page with a zero summary.
func (*MockConfigStore) PinExecutionFanOutShape ¶
func (m *MockConfigStore) PinExecutionFanOutShape(ctx context.Context, lineageKey, shape string) (string, error)
PinExecutionFanOutShape mocks the fan-out shape pin (issue #97). PinExecutionFanOutShapeFn takes priority; with no expectation registered it behaves like the real store (first writer wins per lineage key), so one mock shared across successive attempts of a lineage sees what the first pinned.
func (*MockConfigStore) PlanAndSaveLadderRun ¶
func (m *MockConfigStore) PlanAndSaveLadderRun(ctx context.Context, configID string, asOf time.Time, build config.LadderPlanBuilder) (*config.LadderRunDB, error)
PlanAndSaveLadderRun mocks the PlanAndSaveLadderRun operation. With no expectation registered it runs build with zero in-flight and returns the run it produced (transaction succeeds), so tests that only care about other calls stay green.
func (*MockConfigStore) PredecessorProvenUnsent ¶
func (m *MockConfigStore) PredecessorProvenUnsent(ctx context.Context, executionID string) (bool, error)
PredecessorProvenUnsent mocks the predecessor proof lookup (no default: testify panics if unexpected).
func (*MockConfigStore) PruneStaleRecommendations ¶
func (*MockConfigStore) RecordMarketplaceListingActive ¶
func (m *MockConfigStore) RecordMarketplaceListingActive(ctx context.Context, purchaseID, listingID string, listedAt time.Time) (bool, error)
RecordMarketplaceListingActive mocks stamping listed_at on an active listing (issue #27).
func (*MockConfigStore) RecoverReapedExecution ¶
func (m *MockConfigStore) RecoverReapedExecution(ctx context.Context, exec *config.PurchaseExecution) error
RecoverReapedExecution mocks the reaped-row recovery. With no expectation it delegates to SavePurchaseExecution.
func (*MockConfigStore) RecoverReapedExecutionTx ¶
func (m *MockConfigStore) RecoverReapedExecutionTx(ctx context.Context, tx pgx.Tx, exec *config.PurchaseExecution) error
RecoverReapedExecutionTx mocks the tx variant; same delegation as above.
func (*MockConfigStore) ReleaseMarketplaceListingClaim ¶
func (m *MockConfigStore) ReleaseMarketplaceListingClaim(ctx context.Context, purchaseID, clientToken, priorState string, keepAttempt bool) error
ReleaseMarketplaceListingClaim mocks releasing a pending listing claim (issue #525).
func (*MockConfigStore) ReleaseStaleRevocationsInFlight ¶
func (m *MockConfigStore) ReleaseStaleRevocationsInFlight(ctx context.Context, after time.Duration) ([]string, error)
ReleaseStaleRevocationsInFlight mocks ReleaseStaleRevocationsInFlight (issue #1523). Default-or-dispatch: with no expectation it releases nothing.
func (*MockConfigStore) RescheduleAwaitingExecution ¶
func (m *MockConfigStore) RescheduleAwaitingExecution(ctx context.Context, executionID string, scheduledDate time.Time) (bool, error)
RescheduleAwaitingExecution mocks the conditional scheduled_date update.
func (*MockConfigStore) ReserveApprovedRIExchange ¶
func (*MockConfigStore) ReserveRIExchange ¶
func (m *MockConfigStore) ReserveRIExchange(ctx context.Context, record *config.RIExchangeRecord, dailyCapUSD, perExchangeCapUSD string) (string, error)
func (*MockConfigStore) ResolveMarketplaceListingAttempt ¶
func (m *MockConfigStore) ResolveMarketplaceListingAttempt(ctx context.Context, purchaseID string, seen config.MarketplaceListingAttempt, listingID, state string) (bool, error)
ResolveMarketplaceListingAttempt mocks the fenced recovery write of the cancel endpoint (issue #525).
func (*MockConfigStore) RotatePendingApprovalToken ¶
func (m *MockConfigStore) RotatePendingApprovalToken(ctx context.Context, executionID, tokenHash string, expiresAt time.Time) (bool, error)
RotatePendingApprovalToken mocks the RotatePendingApprovalToken operation. Defaults to (true, nil) when no expectation is registered.
func (*MockConfigStore) SaveAccountCredential ¶
func (m *MockConfigStore) SaveAccountCredential(ctx context.Context, accountID, credentialType, encryptedBlob string) error
func (*MockConfigStore) SaveAccountServiceOverride ¶
func (m *MockConfigStore) SaveAccountServiceOverride(ctx context.Context, override *config.AccountServiceOverride) error
func (*MockConfigStore) SaveAccountServiceOverrideAuditedTx ¶
func (m *MockConfigStore) SaveAccountServiceOverrideAuditedTx(ctx context.Context, tx pgx.Tx, override *config.AccountServiceOverride, audit config.AuditContext) error
SaveAccountServiceOverrideAuditedTx falls back to SaveAccountServiceOverride when no expectation is registered (see UpdatePurchasePlanTx), so tests that seed SaveAccountServiceOverrideFn keep observing the write.
func (*MockConfigStore) SaveConfigAuditEventTx ¶
func (m *MockConfigStore) SaveConfigAuditEventTx(ctx context.Context, tx pgx.Tx, event *config.AuditEvent) error
SaveConfigAuditEventTx records the event and returns nil when no expectation is registered.
func (*MockConfigStore) SaveExecutionIfStatus ¶
func (m *MockConfigStore) SaveExecutionIfStatus(ctx context.Context, exec *config.PurchaseExecution, expected []string) error
SaveExecutionIfStatus mocks the guarded save. With no expectation registered it delegates to SavePurchaseExecution so existing tests keep their behavior.
func (*MockConfigStore) SaveExecutionIfStatusTx ¶
func (m *MockConfigStore) SaveExecutionIfStatusTx(ctx context.Context, tx pgx.Tx, exec *config.PurchaseExecution, expected []string) error
SaveExecutionIfStatusTx mocks the tx variant; same delegation as above.
func (*MockConfigStore) SaveGlobalConfig ¶
func (m *MockConfigStore) SaveGlobalConfig(ctx context.Context, cfg *config.GlobalConfig) error
SaveGlobalConfig mocks the SaveGlobalConfig operation.
func (*MockConfigStore) SaveLadderRun ¶
func (m *MockConfigStore) SaveLadderRun(ctx context.Context, run *config.LadderRunDB) (*config.LadderRunDB, error)
SaveLadderRun mocks the SaveLadderRun operation. Returns (nil, nil) when no expectation is registered.
func (*MockConfigStore) SaveLadderTranches ¶
func (m *MockConfigStore) SaveLadderTranches(ctx context.Context, tranches []config.LadderTrancheDB) error
SaveLadderTranches mocks the SaveLadderTranches operation. Returns nil (no-op) when no expectation is registered.
func (*MockConfigStore) SavePurchaseExecution ¶
func (m *MockConfigStore) SavePurchaseExecution(ctx context.Context, exec *config.PurchaseExecution) error
SavePurchaseExecution mocks the SavePurchaseExecution operation. SavePurchaseExecutionFn takes priority when non-nil.
func (*MockConfigStore) SavePurchaseExecutionTx ¶
func (m *MockConfigStore) SavePurchaseExecutionTx(ctx context.Context, tx pgx.Tx, execution *config.PurchaseExecution) error
func (*MockConfigStore) SavePurchaseHistory ¶
func (m *MockConfigStore) SavePurchaseHistory(ctx context.Context, record *config.PurchaseHistoryRecord) error
SavePurchaseHistory mocks the SavePurchaseHistory operation.
func (*MockConfigStore) SaveRIExchangeDirectExecution ¶
func (m *MockConfigStore) SaveRIExchangeDirectExecution(ctx context.Context, record *config.RIExchangeDirectExecution) error
SaveRIExchangeDirectExecution mocks the direct-execute audit insert (issue #82). With no registered expectation it succeeds, so the many execute-path tests whose subject is a gate or the provider call keep reaching it; tests whose subject IS the audit trail register an expectation or record the row.
func (*MockConfigStore) SaveRIExchangeRecord ¶
func (m *MockConfigStore) SaveRIExchangeRecord(ctx context.Context, record *config.RIExchangeRecord) error
func (*MockConfigStore) SaveServiceConfig ¶
func (m *MockConfigStore) SaveServiceConfig(ctx context.Context, cfg *config.ServiceConfig) error
SaveServiceConfig mocks the SaveServiceConfig operation.
func (*MockConfigStore) ScheduleApprovedExecution ¶
func (m *MockConfigStore) ScheduleApprovedExecution(ctx context.Context, executionID string, fromStatuses []string, transitionedBy *string, scheduledAt time.Time, approvedBy *string) (*config.PurchaseExecution, error)
ScheduleApprovedExecution mocks the atomic delayed-approval schedule. It has no default: a test of the delayed-approve path must register it.
func (*MockConfigStore) ScheduleApprovedExecutionTokenPinned ¶
func (m *MockConfigStore) ScheduleApprovedExecutionTokenPinned(ctx context.Context, executionID string, fromStatuses []string, transitionedBy *string, rawToken string, scheduledAt time.Time, approvedBy *string) (*config.PurchaseExecution, error)
ScheduleApprovedExecutionTokenPinned mocks the token-pinned schedule. Like the other pinned mocks it does not delegate to the unpinned one.
func (*MockConfigStore) SetCancelledBy ¶
func (m *MockConfigStore) SetCancelledBy(ctx context.Context, executionID, cancelledBy string) error
SetCancelledBy mocks the SetCancelledBy targeted-update operation.
func (*MockConfigStore) SetExecutionRecommendationsIfEmptyTx ¶
func (*MockConfigStore) SetLadderSweepCeiling ¶
func (m *MockConfigStore) SetLadderSweepCeiling(ctx context.Context, configID string, usdPerHr *float64) error
SetLadderSweepCeiling mocks the SetLadderSweepCeiling operation.
func (*MockConfigStore) SetLadderSweepCeilingTx ¶
func (m *MockConfigStore) SetLadderSweepCeilingTx(ctx context.Context, tx pgx.Tx, configID string, usdPerHr *float64) error
SetLadderSweepCeilingTx falls back to SetLadderSweepCeiling when no expectation is registered.
func (*MockConfigStore) SetPlanAccounts ¶
func (*MockConfigStore) SetPlanAccountsGated ¶
func (m *MockConfigStore) SetPlanAccountsGated(ctx context.Context, planID string, accountIDs []string, gate config.PlanWriteGate) error
SetPlanAccountsGated runs gate, then delegates to SetPlanAccounts.
func (*MockConfigStore) SetPlanRampBaselineTx ¶
func (m *MockConfigStore) SetPlanRampBaselineTx(ctx context.Context, tx pgx.Tx, planID string, baseline config.PlanRampBaseline) (bool, error)
The ramp-ledger mocks default to an empty answer when unregistered so tests that predate them keep exercising their own path.
func (*MockConfigStore) SetRecommendationsCollectionError ¶
func (m *MockConfigStore) SetRecommendationsCollectionError(ctx context.Context, errMsg string) error
func (*MockConfigStore) SettleMarketplaceListing ¶
func (m *MockConfigStore) SettleMarketplaceListing(ctx context.Context, settlement config.MarketplaceListingSettlement) (bool, error)
SettleMarketplaceListing mocks recording a closed or canceled listing (issue #27).
func (*MockConfigStore) StampFirstDispatchTx ¶
func (m *MockConfigStore) StampFirstDispatchTx(ctx context.Context, tx pgx.Tx, executionID string, horizon time.Duration) (config.StampResult, error)
StampFirstDispatchTx mocks the first-dispatch stamp (no default: testify panics if unexpected).
func (*MockConfigStore) StampOfferingClass ¶
func (m *MockConfigStore) StampOfferingClass(ctx context.Context, purchaseID, offeringClass string) error
StampOfferingClass mocks persisting the offering_class fetched from AWS (issue #292).
func (*MockConfigStore) StampPlanNotificationSent ¶
func (*MockConfigStore) StampRIExchangeApprovedBy ¶
func (m *MockConfigStore) StampRIExchangeApprovedBy(ctx context.Context, id, approverEmail string) error
StampRIExchangeApprovedBy mocks the StampRIExchangeApprovedBy operation.
func (*MockConfigStore) Test ¶
func (m *MockConfigStore) Test(t mock.TestingT)
Test registers t with the mock: an unexpected call (testify's own check) and a mistyped .Return value (see testReporter) then fail t instead of panicking. It shadows the promoted mock.Mock.Test and calls it.
func (*MockConfigStore) TransitionExecutionStatus ¶
func (m *MockConfigStore) TransitionExecutionStatus(ctx context.Context, executionID string, fromStatuses []string, toStatus string, actor *string) (*config.PurchaseExecution, error)
TransitionExecutionStatus mocks the TransitionExecutionStatus operation.
func (*MockConfigStore) TransitionExecutionStatusPinned ¶
func (m *MockConfigStore) TransitionExecutionStatusPinned(ctx context.Context, executionID string, fromStatuses []string, toStatus string, actor *string, sawEmptyRecommendations bool) (*config.PurchaseExecution, error)
TransitionExecutionStatusPinned mocks the pinned claim. With no expectation registered it delegates to TransitionExecutionStatus, so tests that mock the plain transition keep working; a test exercising a lost pin registers an expectation returning config.ErrExecutionNotInExpectedStatus.
func (*MockConfigStore) TransitionExecutionStatusPinnedTx ¶
func (m *MockConfigStore) TransitionExecutionStatusPinnedTx(ctx context.Context, tx pgx.Tx, executionID string, fromStatuses []string, toStatus string, actor *string, sawEmptyRecommendations bool) (*config.PurchaseExecution, error)
TransitionExecutionStatusPinnedTx mocks the tx variant of the pinned claim. With no expectation registered it delegates to TransitionExecutionStatusPinned (and from there to TransitionExecutionStatus), so tests that mock the non-tx transition keep working.
func (*MockConfigStore) TransitionExecutionStatusTokenPinned ¶
func (m *MockConfigStore) TransitionExecutionStatusTokenPinned(ctx context.Context, executionID string, fromStatuses []string, toStatus string, actor *string, rawToken string) (*config.PurchaseExecution, error)
TransitionExecutionStatusTokenPinned mocks the token-pinned transition (issue #590). It does not delegate to TransitionExecutionStatus: a caller that must pin the approval token is expected to call this method, so a test has to register it explicitly.
func (*MockConfigStore) TransitionLadderRunStatus ¶
func (m *MockConfigStore) TransitionLadderRunStatus(ctx context.Context, id string, fromStatuses []ladder.RunStatus, toStatus ladder.RunStatus) (*config.LadderRunDB, error)
TransitionLadderRunStatus mocks the TransitionLadderRunStatus operation. Returns (nil, nil) when no expectation is registered (CAS race-lost path).
func (*MockConfigStore) TransitionRIExchangeStatus ¶
func (m *MockConfigStore) TransitionRIExchangeStatus(ctx context.Context, id, fromStatus, toStatus string, actor *string) (*config.RIExchangeRecord, error)
func (*MockConfigStore) TransitionRegistrationStatus ¶
func (m *MockConfigStore) TransitionRegistrationStatus(ctx context.Context, reg *config.AccountRegistration, fromStatus string, actor *string) error
func (*MockConfigStore) UpdateAccountRegistration ¶
func (m *MockConfigStore) UpdateAccountRegistration(ctx context.Context, reg *config.AccountRegistration) error
func (*MockConfigStore) UpdateAccountServiceOverrideAtomic ¶
func (m *MockConfigStore) UpdateAccountServiceOverrideAtomic(ctx context.Context, accountID, provider, service string, audit config.AuditContext, merge func(*config.AccountServiceOverride) (*config.AccountServiceOverride, error)) (*config.AccountServiceOverride, error)
UpdateAccountServiceOverrideAtomic mocks the locked read-merge-write of one override. With an expectation it dispatches through m.Called; otherwise it emulates the store via the mocked WithTx, GetAccountServiceOverride, merge and SaveAccountServiceOverrideAuditedTx, so tests that seed those keep working.
func (*MockConfigStore) UpdateCloudAccount ¶
func (m *MockConfigStore) UpdateCloudAccount(ctx context.Context, account *config.CloudAccount) error
func (*MockConfigStore) UpdateGlobalConfigAtomic ¶
func (m *MockConfigStore) UpdateGlobalConfigAtomic(ctx context.Context, apply func(*config.GlobalConfig) error) (*config.GlobalConfig, error)
UpdateGlobalConfigAtomic mocks the atomic read-modify-write. When an expectation is registered it dispatches through m.Called (tests can drive the apply closure via a Run callback). Otherwise it emulates the real locked read-modify-write by routing through the mocked GetGlobalConfig + apply + SaveGlobalConfig, so existing tests that seed those two continue to work.
func (*MockConfigStore) UpdatePurchaseHistoryListing ¶
func (m *MockConfigStore) UpdatePurchaseHistoryListing(ctx context.Context, purchaseID, listingID, listingState string) error
UpdatePurchaseHistoryListing mocks stamping listing_id and listing_state (issue #292).
func (*MockConfigStore) UpdatePurchasePlan ¶
func (m *MockConfigStore) UpdatePurchasePlan(ctx context.Context, plan *config.PurchasePlan) error
UpdatePurchasePlan mocks the UpdatePurchasePlan operation.
func (*MockConfigStore) UpdatePurchasePlanGated ¶
func (m *MockConfigStore) UpdatePurchasePlanGated(ctx context.Context, plan *config.PurchasePlan, gate config.PlanWriteGate) error
UpdatePurchasePlanGated runs gate, then delegates to UpdatePurchasePlan, the order the real store uses under the plan lock.
func (*MockConfigStore) UpdatePurchasePlanTx ¶
func (m *MockConfigStore) UpdatePurchasePlanTx(ctx context.Context, tx pgx.Tx, plan *config.PurchasePlan) error
UpdatePurchasePlanTx mocks the UpdatePurchasePlanTx operation. Falls back to UpdatePurchasePlan when no expectation is registered so tests that don't care about the Tx variant stay green -- same pattern as SavePurchaseExecutionTx below.
func (*MockConfigStore) UpdateServiceConfigAtomic ¶
func (m *MockConfigStore) UpdateServiceConfigAtomic(ctx context.Context, provider, service string, apply func(*config.ServiceConfig) (*config.ServiceConfig, error)) (*config.ServiceConfig, error)
UpdateServiceConfigAtomic mocks the locked read-merge-write of one service config row. When an expectation is registered it dispatches through m.Called (tests can drive the apply closure via a Run callback). Otherwise it emulates the real store by routing through the mocked GetServiceConfig + apply + SaveServiceConfig, so tests that seed those two keep working. Like the real store, a not-found read hands apply a nil row.
func (*MockConfigStore) UpsertLadderConfig ¶
func (m *MockConfigStore) UpsertLadderConfig(ctx context.Context, cfg *config.LadderConfigDB) (*config.LadderConfigDB, error)
UpsertLadderConfig mocks the UpsertLadderConfig operation.
func (*MockConfigStore) UpsertLadderConfigTx ¶
func (m *MockConfigStore) UpsertLadderConfigTx(ctx context.Context, tx pgx.Tx, cfg *config.LadderConfigDB) (*config.LadderConfigDB, error)
UpsertLadderConfigTx falls back to UpsertLadderConfig when no expectation is registered so tests that stub UpsertLadderConfig keep observing the write.
func (*MockConfigStore) UpsertNotificationMute ¶
func (m *MockConfigStore) UpsertNotificationMute(ctx context.Context, recipientEmail, scope, unmuteToken string) error
UpsertNotificationMute mocks the UpsertNotificationMute operation. Defaults to nil when no expectation is registered.
func (*MockConfigStore) UpsertRIUtilizationCache ¶
func (m *MockConfigStore) UpsertRIUtilizationCache(ctx context.Context, key config.RIUtilizationCacheKey, payload []byte, fetchedAt time.Time) error
func (*MockConfigStore) UpsertRecommendations ¶
func (m *MockConfigStore) UpsertRecommendations(ctx context.Context, collectedAt time.Time, recs []config.RecommendationRecord, successfulCollects []config.SuccessfulCollect) error
func (*MockConfigStore) UpsertRecommendationsWithPartial ¶
func (m *MockConfigStore) UpsertRecommendationsWithPartial(ctx context.Context, collectedAt time.Time, recs []config.RecommendationRecord, successfulCollects []config.SuccessfulCollect, partial *config.RecommendationsCollectionPartial) error
type MockEmailSender ¶
MockEmailSender is a mock implementation of email.Sender.
func (*MockEmailSender) SendNewRecommendationsNotification ¶
func (m *MockEmailSender) SendNewRecommendationsNotification(ctx context.Context, data email.NotificationData) error
SendNewRecommendationsNotification mocks the SendNewRecommendationsNotification operation.
func (*MockEmailSender) SendNotification ¶
func (m *MockEmailSender) SendNotification(ctx context.Context, subject, message string) error
SendNotification mocks the SendNotification operation.
func (*MockEmailSender) SendPasswordResetEmail ¶
func (m *MockEmailSender) SendPasswordResetEmail(ctx context.Context, emailAddr, resetURL string) error
SendPasswordResetEmail mocks the SendPasswordResetEmail operation.
func (*MockEmailSender) SendPurchaseApprovalRequest ¶
func (m *MockEmailSender) SendPurchaseApprovalRequest(ctx context.Context, data email.NotificationData) error
SendPurchaseApprovalRequest mocks the SendPurchaseApprovalRequest operation.
func (*MockEmailSender) SendPurchaseConfirmation ¶
func (m *MockEmailSender) SendPurchaseConfirmation(ctx context.Context, data email.NotificationData) error
SendPurchaseConfirmation mocks the SendPurchaseConfirmation operation.
func (*MockEmailSender) SendPurchaseExecutedNotification ¶
func (m *MockEmailSender) SendPurchaseExecutedNotification(ctx context.Context, data email.NotificationData) error
SendPurchaseExecutedNotification mocks the post-execution notification operation (issue #291).
func (*MockEmailSender) SendPurchaseFailedNotification ¶
func (m *MockEmailSender) SendPurchaseFailedNotification(ctx context.Context, data email.NotificationData) error
SendPurchaseFailedNotification mocks the SendPurchaseFailedNotification operation.
func (*MockEmailSender) SendRegistrationDecisionNotification ¶
func (m *MockEmailSender) SendRegistrationDecisionNotification(ctx context.Context, toEmail string, data email.RegistrationDecisionData) error
func (*MockEmailSender) SendRegistrationReceivedNotification ¶
func (m *MockEmailSender) SendRegistrationReceivedNotification(ctx context.Context, data email.RegistrationNotificationData) error
func (*MockEmailSender) SendScheduledPurchaseNotification ¶
func (m *MockEmailSender) SendScheduledPurchaseNotification(ctx context.Context, data email.NotificationData) error
SendScheduledPurchaseNotification mocks the SendScheduledPurchaseNotification operation.
func (*MockEmailSender) SendToEmail ¶
func (m *MockEmailSender) SendToEmail(ctx context.Context, toEmail, subject, body string) error
SendToEmail mocks the SendToEmail operation.
type MockSESClient ¶
MockSESClient is a mock implementation of SES client.
func (*MockSESClient) SendEmail ¶
func (m *MockSESClient) SendEmail(ctx context.Context, input *sesv2.SendEmailInput, opts ...func(*sesv2.Options)) (*sesv2.SendEmailOutput, error)
SendEmail mocks the SendEmail operation.
func (*MockSESClient) Test ¶
func (m *MockSESClient) Test(t mock.TestingT)
Test registers t with the mock. See MockConfigStore.Test.
type MockSNSClient ¶
MockSNSClient is a mock implementation of SNS client.
func (*MockSNSClient) Publish ¶
func (m *MockSNSClient) Publish(ctx context.Context, input *sns.PublishInput, opts ...func(*sns.Options)) (*sns.PublishOutput, error)
Publish mocks the Publish operation.
func (*MockSNSClient) Test ¶
func (m *MockSNSClient) Test(t mock.TestingT)
Test registers t with the mock. See MockConfigStore.Test.
type MockSecretsManagerClient ¶
MockSecretsManagerClient is a mock implementation of Secrets Manager client.
func (*MockSecretsManagerClient) CreateSecret ¶
func (m *MockSecretsManagerClient) CreateSecret(ctx context.Context, input *secretsmanager.CreateSecretInput, opts ...func(*secretsmanager.Options)) (*secretsmanager.CreateSecretOutput, error)
CreateSecret mocks the CreateSecret operation.
func (*MockSecretsManagerClient) GetSecretValue ¶
func (m *MockSecretsManagerClient) GetSecretValue(ctx context.Context, input *secretsmanager.GetSecretValueInput, opts ...func(*secretsmanager.Options)) (*secretsmanager.GetSecretValueOutput, error)
GetSecretValue mocks the GetSecretValue operation.
func (*MockSecretsManagerClient) Test ¶
func (m *MockSecretsManagerClient) Test(t mock.TestingT)
Test registers t with the mock. See MockConfigStore.Test.
func (*MockSecretsManagerClient) UpdateSecret ¶
func (m *MockSecretsManagerClient) UpdateSecret(ctx context.Context, input *secretsmanager.UpdateSecretInput, opts ...func(*secretsmanager.Options)) (*secretsmanager.UpdateSecretOutput, error)
UpdateSecret mocks the UpdateSecret operation.
type PlanNameFixture ¶
type PlanNameFixture struct {
ID string
Name string
Accounts []config.CloudAccount
}
PlanNameFixture describes an existing plan for NameTakenFixture.
type SESAPI ¶
type SESAPI interface {
SendEmail(ctx context.Context, input *sesv2.SendEmailInput, opts ...func(*sesv2.Options)) (*sesv2.SendEmailOutput, error)
}
SESAPI defines the interface for SES operations used by our code.
type SNSAPI ¶
type SNSAPI interface {
Publish(ctx context.Context, input *sns.PublishInput, opts ...func(*sns.Options)) (*sns.PublishOutput, error)
}
SNSAPI defines the interface for SNS operations used by our code.
type SecretsManagerAPI ¶
type SecretsManagerAPI interface {
GetSecretValue(ctx context.Context, input *secretsmanager.GetSecretValueInput, opts ...func(*secretsmanager.Options)) (*secretsmanager.GetSecretValueOutput, error)
CreateSecret(ctx context.Context, input *secretsmanager.CreateSecretInput, opts ...func(*secretsmanager.Options)) (*secretsmanager.CreateSecretOutput, error)
UpdateSecret(ctx context.Context, input *secretsmanager.UpdateSecretInput, opts ...func(*secretsmanager.Options)) (*secretsmanager.UpdateSecretOutput, error)
}
SecretsManagerAPI defines the interface for Secrets Manager operations used by our code.