mocks

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRepository

type AccountRepository struct {
	mock.Mock
}

AccountRepository is a testify/mock implementation of domain.AccountRepository.

func (*AccountRepository) Create

func (m *AccountRepository) Create(ctx context.Context, tenantID string, input domain.CreateAccountInput) (*domain.Account, error)

func (*AccountRepository) Delete

func (m *AccountRepository) Delete(ctx context.Context, tenantID, id string) error

func (*AccountRepository) GetByID

func (m *AccountRepository) GetByID(ctx context.Context, tenantID, id string) (*domain.Account, error)

func (*AccountRepository) ListByTenant

func (m *AccountRepository) ListByTenant(ctx context.Context, tenantID string) ([]domain.Account, error)

func (*AccountRepository) ListByUser

func (m *AccountRepository) ListByUser(ctx context.Context, tenantID, userID string) ([]domain.Account, error)

func (*AccountRepository) Update

func (m *AccountRepository) Update(ctx context.Context, tenantID, id string, input domain.UpdateAccountInput) (*domain.Account, error)

func (*AccountRepository) UpdateBalance

func (m *AccountRepository) UpdateBalance(ctx context.Context, tenantID, id string, newBalanceCents int64) error

type AccountService

type AccountService struct {
	mock.Mock
}

AccountService is a testify/mock implementation of domain.AccountService.

func (*AccountService) Create

func (m *AccountService) Create(ctx context.Context, tenantID string, input domain.CreateAccountInput) (*domain.Account, error)

func (*AccountService) Delete

func (m *AccountService) Delete(ctx context.Context, tenantID, id string) error

func (*AccountService) GetByID

func (m *AccountService) GetByID(ctx context.Context, tenantID, id string) (*domain.Account, error)

func (*AccountService) ListByTenant

func (m *AccountService) ListByTenant(ctx context.Context, tenantID string) ([]domain.Account, error)

func (*AccountService) ListByUser

func (m *AccountService) ListByUser(ctx context.Context, tenantID, userID string) ([]domain.Account, error)

func (*AccountService) Update

func (m *AccountService) Update(ctx context.Context, tenantID, id string, input domain.UpdateAccountInput) (*domain.Account, error)

type AdminAuditRepository

type AdminAuditRepository struct {
	mock.Mock
}

AdminAuditRepository is a mock implementation of domain.AdminAuditRepository.

func (*AdminAuditRepository) ListAll

type AdminService

type AdminService struct {
	mock.Mock
}

AdminService is a testify/mock implementation of domain.AdminService.

func (*AdminService) ForceDeleteUser

func (m *AdminService) ForceDeleteUser(ctx context.Context, id string) error

func (*AdminService) GetTenantByID

func (m *AdminService) GetTenantByID(ctx context.Context, id string) (*domain.Tenant, error)

func (*AdminService) GetUserByID

func (m *AdminService) GetUserByID(ctx context.Context, id string) (*domain.User, error)

func (*AdminService) HardDeleteTenant

func (m *AdminService) HardDeleteTenant(ctx context.Context, id, confirmationToken string) error

func (*AdminService) ListAllTenants

func (m *AdminService) ListAllTenants(ctx context.Context, withDeleted bool) ([]domain.Tenant, error)

func (*AdminService) ListAllUsers

func (m *AdminService) ListAllUsers(ctx context.Context) ([]domain.User, error)

func (*AdminService) ListAuditLogs

func (m *AdminService) ListAuditLogs(ctx context.Context, params domain.ListAuditLogsParams) ([]domain.AuditLog, error)

func (*AdminService) RestoreTenant

func (m *AdminService) RestoreTenant(ctx context.Context, id string) error

func (*AdminService) SuspendTenant

func (m *AdminService) SuspendTenant(ctx context.Context, id string) error

func (*AdminService) UpdateTenantPlan

func (m *AdminService) UpdateTenantPlan(ctx context.Context, id string, plan domain.TenantPlan) (*domain.Tenant, error)

type AdminTenantRepository

type AdminTenantRepository struct {
	mock.Mock
}

AdminTenantRepository is a mock implementation of domain.AdminTenantRepository.

func (*AdminTenantRepository) GetByID

func (m *AdminTenantRepository) GetByID(ctx context.Context, id string) (*domain.Tenant, error)

func (*AdminTenantRepository) HardDelete

func (m *AdminTenantRepository) HardDelete(ctx context.Context, id string) error

func (*AdminTenantRepository) ListAll

func (m *AdminTenantRepository) ListAll(ctx context.Context, withDeleted bool) ([]domain.Tenant, error)

func (*AdminTenantRepository) Restore

func (m *AdminTenantRepository) Restore(ctx context.Context, id string) error

func (*AdminTenantRepository) Suspend

func (m *AdminTenantRepository) Suspend(ctx context.Context, id string) error

func (*AdminTenantRepository) UpdatePlan

func (m *AdminTenantRepository) UpdatePlan(ctx context.Context, id string, plan domain.TenantPlan) (*domain.Tenant, error)

type AdminUserRepository

type AdminUserRepository struct {
	mock.Mock
}

AdminUserRepository is a mock implementation of domain.AdminUserRepository.

func (*AdminUserRepository) ForceDelete

func (m *AdminUserRepository) ForceDelete(ctx context.Context, id string) error

func (*AdminUserRepository) GetByID

func (m *AdminUserRepository) GetByID(ctx context.Context, id string) (*domain.User, error)

func (*AdminUserRepository) ListAll

func (m *AdminUserRepository) ListAll(ctx context.Context) ([]domain.User, error)

type AuditRepository

type AuditRepository struct {
	mock.Mock
}

AuditRepository is a testify/mock implementation of domain.AuditRepository.

func (*AuditRepository) Create

func (*AuditRepository) ListByEntity

func (m *AuditRepository) ListByEntity(ctx context.Context, tenantID, entityType, entityID string) ([]domain.AuditLog, error)

func (*AuditRepository) ListByTenant

func (m *AuditRepository) ListByTenant(ctx context.Context, tenantID string, params domain.ListAuditLogsParams) ([]domain.AuditLog, error)

type AuthRepository

type AuthRepository struct {
	mock.Mock
}

AuthRepository is a testify/mock implementation of domain.AuthRepository.

func (*AuthRepository) CreateOTPRequest

func (m *AuthRepository) CreateOTPRequest(ctx context.Context, input domain.CreateOTPRequestInput) (*domain.OTPRequest, error)

func (*AuthRepository) DeleteExpiredOTPRequests

func (m *AuthRepository) DeleteExpiredOTPRequests(ctx context.Context) error

func (*AuthRepository) GetActiveOTPRequest

func (m *AuthRepository) GetActiveOTPRequest(ctx context.Context, email string) (*domain.OTPRequest, error)

func (*AuthRepository) MarkOTPUsed

func (m *AuthRepository) MarkOTPUsed(ctx context.Context, id string) error

type AuthService

type AuthService struct {
	mock.Mock
}

AuthService is a mock implementation of domain.AuthService.

func (*AuthService) RefreshToken

func (m *AuthService) RefreshToken(ctx context.Context, refreshToken string) (*domain.TokenPair, error)

func (*AuthService) RequestOTP

func (m *AuthService) RequestOTP(ctx context.Context, email string) error

func (*AuthService) VerifyOTP

func (m *AuthService) VerifyOTP(ctx context.Context, email, code string) (*domain.TokenPair, error)

type CategoryRepository

type CategoryRepository struct {
	mock.Mock
}

CategoryRepository is a testify/mock implementation of domain.CategoryRepository.

func (*CategoryRepository) Create

func (*CategoryRepository) Delete

func (m *CategoryRepository) Delete(ctx context.Context, tenantID, id string) error

func (*CategoryRepository) GetByID

func (m *CategoryRepository) GetByID(ctx context.Context, tenantID, id string) (*domain.Category, error)

func (*CategoryRepository) ListByTenant

func (m *CategoryRepository) ListByTenant(ctx context.Context, tenantID string) ([]domain.Category, error)

func (*CategoryRepository) ListChildren

func (m *CategoryRepository) ListChildren(ctx context.Context, tenantID, parentID string) ([]domain.Category, error)

func (*CategoryRepository) Update

func (m *CategoryRepository) Update(ctx context.Context, tenantID, id string, input domain.UpdateCategoryInput) (*domain.Category, error)

type CategoryService

type CategoryService struct {
	mock.Mock
}

CategoryService is a testify/mock implementation of domain.CategoryService.

func (*CategoryService) Create

func (m *CategoryService) Create(ctx context.Context, tenantID string, input domain.CreateCategoryInput) (*domain.Category, error)

func (*CategoryService) Delete

func (m *CategoryService) Delete(ctx context.Context, tenantID, id string) error

func (*CategoryService) GetByID

func (m *CategoryService) GetByID(ctx context.Context, tenantID, id string) (*domain.Category, error)

func (*CategoryService) ListByTenant

func (m *CategoryService) ListByTenant(ctx context.Context, tenantID string) ([]domain.Category, error)

func (*CategoryService) ListChildren

func (m *CategoryService) ListChildren(ctx context.Context, tenantID, parentID string) ([]domain.Category, error)

func (*CategoryService) Update

func (m *CategoryService) Update(ctx context.Context, tenantID, id string, input domain.UpdateCategoryInput) (*domain.Category, error)

type IdempotencyStore

type IdempotencyStore struct {
	mock.Mock
}

IdempotencyStore is a testify/mock implementation of IdempotencyStore placed in the same package as the production interface to avoid import cycles when middleware tests reference the mock.

func (*IdempotencyStore) Get

func (*IdempotencyStore) SetLocked

func (m *IdempotencyStore) SetLocked(ctx context.Context, key string, ttl time.Duration) (bool, error)

func (*IdempotencyStore) SetResponse

func (m *IdempotencyStore) SetResponse(ctx context.Context, key string, resp domain.CachedResponse, ttl time.Duration) error

type Mailer

type Mailer struct {
	mock.Mock
}

Mailer is a testify/mock implementation of domain.Mailer.

func (*Mailer) SendOTP

func (m *Mailer) SendOTP(ctx context.Context, email, code string) error

type Querier

type Querier struct {
	mock.Mock
}

func (*Querier) AdminForceDeleteUser

func (m *Querier) AdminForceDeleteUser(ctx context.Context, id string) error

func (*Querier) AdminGetTenantByID

func (m *Querier) AdminGetTenantByID(ctx context.Context, id string) (sqlc.Tenant, error)

func (*Querier) AdminGetUserByID

func (m *Querier) AdminGetUserByID(ctx context.Context, id string) (sqlc.User, error)

func (*Querier) AdminHardDeleteTenant

func (m *Querier) AdminHardDeleteTenant(ctx context.Context, id string) error

func (*Querier) AdminListAllAuditLogs

func (m *Querier) AdminListAllAuditLogs(ctx context.Context, arg sqlc.AdminListAllAuditLogsParams) ([]sqlc.AuditLog, error)

func (*Querier) AdminListAllTenants

func (m *Querier) AdminListAllTenants(ctx context.Context, withDeleted bool) ([]sqlc.Tenant, error)

func (*Querier) AdminListAllUsers

func (m *Querier) AdminListAllUsers(ctx context.Context) ([]sqlc.User, error)

func (*Querier) AdminRestoreTenant

func (m *Querier) AdminRestoreTenant(ctx context.Context, id string) error

func (*Querier) AdminSuspendTenant

func (m *Querier) AdminSuspendTenant(ctx context.Context, id string) error

func (*Querier) AdminUpdateTenantPlan

func (m *Querier) AdminUpdateTenantPlan(ctx context.Context, arg sqlc.AdminUpdateTenantPlanParams) (sqlc.Tenant, error)

func (*Querier) CreateAccount

func (m *Querier) CreateAccount(ctx context.Context, arg sqlc.CreateAccountParams) (sqlc.Account, error)

func (*Querier) CreateAuditLog

func (m *Querier) CreateAuditLog(ctx context.Context, arg sqlc.CreateAuditLogParams) (sqlc.AuditLog, error)

func (*Querier) CreateCategory

func (m *Querier) CreateCategory(ctx context.Context, arg sqlc.CreateCategoryParams) (sqlc.Category, error)

func (*Querier) CreateOTPRequest

func (m *Querier) CreateOTPRequest(ctx context.Context, arg sqlc.CreateOTPRequestParams) (sqlc.OtpRequest, error)

func (*Querier) CreateTenant

func (m *Querier) CreateTenant(ctx context.Context, arg sqlc.CreateTenantParams) (sqlc.Tenant, error)

func (*Querier) CreateTransaction

func (m *Querier) CreateTransaction(ctx context.Context, arg sqlc.CreateTransactionParams) (sqlc.Transaction, error)

func (*Querier) CreateUser

func (m *Querier) CreateUser(ctx context.Context, arg sqlc.CreateUserParams) (sqlc.User, error)

func (*Querier) DeleteExpiredOTPs

func (m *Querier) DeleteExpiredOTPs(ctx context.Context) error

func (*Querier) GetAccountByID

func (m *Querier) GetAccountByID(ctx context.Context, arg sqlc.GetAccountByIDParams) (sqlc.Account, error)

func (*Querier) GetActiveOTPByEmail

func (m *Querier) GetActiveOTPByEmail(ctx context.Context, email string) (sqlc.OtpRequest, error)

func (*Querier) GetCategoryByID

func (m *Querier) GetCategoryByID(ctx context.Context, arg sqlc.GetCategoryByIDParams) (sqlc.Category, error)

func (*Querier) GetTenantByID

func (m *Querier) GetTenantByID(ctx context.Context, id string) (sqlc.Tenant, error)

func (*Querier) GetTransactionByID

func (m *Querier) GetTransactionByID(ctx context.Context, arg sqlc.GetTransactionByIDParams) (sqlc.Transaction, error)

func (*Querier) GetUserByEmail

func (m *Querier) GetUserByEmail(ctx context.Context, email string) (sqlc.User, error)

func (*Querier) GetUserByID

func (m *Querier) GetUserByID(ctx context.Context, arg sqlc.GetUserByIDParams) (sqlc.User, error)

func (*Querier) ListAccountsByTenant

func (m *Querier) ListAccountsByTenant(ctx context.Context, tenantID string) ([]sqlc.Account, error)

func (*Querier) ListAccountsByUser

func (m *Querier) ListAccountsByUser(ctx context.Context, arg sqlc.ListAccountsByUserParams) ([]sqlc.Account, error)

func (*Querier) ListAuditLogsByEntity

func (m *Querier) ListAuditLogsByEntity(ctx context.Context, arg sqlc.ListAuditLogsByEntityParams) ([]sqlc.AuditLog, error)

func (*Querier) ListAuditLogsByTenant

func (m *Querier) ListAuditLogsByTenant(ctx context.Context, arg sqlc.ListAuditLogsByTenantParams) ([]sqlc.AuditLog, error)

func (*Querier) ListCategoriesByTenant

func (m *Querier) ListCategoriesByTenant(ctx context.Context, tenantID string) ([]sqlc.Category, error)

func (*Querier) ListChildCategories

func (m *Querier) ListChildCategories(ctx context.Context, arg sqlc.ListChildCategoriesParams) ([]sqlc.Category, error)

func (*Querier) ListTenants

func (m *Querier) ListTenants(ctx context.Context) ([]sqlc.Tenant, error)

func (*Querier) ListTransactionsByTenant

func (m *Querier) ListTransactionsByTenant(ctx context.Context, arg sqlc.ListTransactionsByTenantParams) ([]sqlc.Transaction, error)

func (*Querier) ListUsersByTenant

func (m *Querier) ListUsersByTenant(ctx context.Context, tenantID string) ([]sqlc.User, error)

func (*Querier) MarkOTPUsed

func (m *Querier) MarkOTPUsed(ctx context.Context, id string) error

func (*Querier) SoftDeleteAccount

func (m *Querier) SoftDeleteAccount(ctx context.Context, arg sqlc.SoftDeleteAccountParams) error

func (*Querier) SoftDeleteCategory

func (m *Querier) SoftDeleteCategory(ctx context.Context, arg sqlc.SoftDeleteCategoryParams) error

func (*Querier) SoftDeleteTenant

func (m *Querier) SoftDeleteTenant(ctx context.Context, id string) error

func (*Querier) SoftDeleteTransaction

func (m *Querier) SoftDeleteTransaction(ctx context.Context, arg sqlc.SoftDeleteTransactionParams) error

func (*Querier) SoftDeleteUser

func (m *Querier) SoftDeleteUser(ctx context.Context, arg sqlc.SoftDeleteUserParams) error

func (*Querier) UpdateAccount

func (m *Querier) UpdateAccount(ctx context.Context, arg sqlc.UpdateAccountParams) (sqlc.Account, error)

func (*Querier) UpdateAccountBalance

func (m *Querier) UpdateAccountBalance(ctx context.Context, arg sqlc.UpdateAccountBalanceParams) error

func (*Querier) UpdateCategory

func (m *Querier) UpdateCategory(ctx context.Context, arg sqlc.UpdateCategoryParams) (sqlc.Category, error)

func (*Querier) UpdateTenant

func (m *Querier) UpdateTenant(ctx context.Context, arg sqlc.UpdateTenantParams) (sqlc.Tenant, error)

func (*Querier) UpdateTransaction

func (m *Querier) UpdateTransaction(ctx context.Context, arg sqlc.UpdateTransactionParams) (sqlc.Transaction, error)

func (*Querier) UpdateUser

func (m *Querier) UpdateUser(ctx context.Context, arg sqlc.UpdateUserParams) (sqlc.User, error)

func (*Querier) UpdateUserLastLogin

func (m *Querier) UpdateUserLastLogin(ctx context.Context, id string) error

type TenantRepository

type TenantRepository struct {
	mock.Mock
}

TenantRepository is a testify/mock implementation of domain.TenantRepository.

func (*TenantRepository) Create

func (*TenantRepository) Delete

func (m *TenantRepository) Delete(ctx context.Context, id string) error

func (*TenantRepository) GetByID

func (m *TenantRepository) GetByID(ctx context.Context, id string) (*domain.Tenant, error)

func (*TenantRepository) List

func (m *TenantRepository) List(ctx context.Context) ([]domain.Tenant, error)

func (*TenantRepository) Update

type TenantService

type TenantService struct {
	mock.Mock
}

TenantService is a testify/mock implementation of domain.TenantService.

func (*TenantService) Create

func (*TenantService) Delete

func (m *TenantService) Delete(ctx context.Context, id string) error

func (*TenantService) GetByID

func (m *TenantService) GetByID(ctx context.Context, id string) (*domain.Tenant, error)

func (*TenantService) InviteUser

func (m *TenantService) InviteUser(ctx context.Context, tenantID string, input domain.CreateUserInput) (*domain.User, error)

func (*TenantService) List

func (m *TenantService) List(ctx context.Context) ([]domain.Tenant, error)

func (*TenantService) Update

type TransactionRepository

type TransactionRepository struct {
	mock.Mock
}

TransactionRepository mock

func (*TransactionRepository) Create

func (*TransactionRepository) Delete

func (m *TransactionRepository) Delete(ctx context.Context, tenantID, id string) error

func (*TransactionRepository) GetByID

func (m *TransactionRepository) GetByID(ctx context.Context, tenantID, id string) (*domain.Transaction, error)

func (*TransactionRepository) List

func (*TransactionRepository) Update

type TransactionService

type TransactionService struct {
	mock.Mock
}

TransactionService is a testify/mock implementation of domain.TransactionService.

func (*TransactionService) Create

func (*TransactionService) Delete

func (m *TransactionService) Delete(ctx context.Context, tenantID, id string) error

func (*TransactionService) GetByID

func (m *TransactionService) GetByID(ctx context.Context, tenantID, id string) (*domain.Transaction, error)

func (*TransactionService) List

func (*TransactionService) Update

type UserRepository

type UserRepository struct {
	mock.Mock
}

UserRepository is a testify/mock implementation of domain.UserRepository.

func (*UserRepository) Create

func (*UserRepository) Delete

func (m *UserRepository) Delete(ctx context.Context, tenantID, id string) error

func (*UserRepository) GetByEmail

func (m *UserRepository) GetByEmail(ctx context.Context, email string) (*domain.User, error)

func (*UserRepository) GetByID

func (m *UserRepository) GetByID(ctx context.Context, tenantID, id string) (*domain.User, error)

func (*UserRepository) ListByTenant

func (m *UserRepository) ListByTenant(ctx context.Context, tenantID string) ([]domain.User, error)

func (*UserRepository) Update

func (m *UserRepository) Update(ctx context.Context, tenantID, id string, input domain.UpdateUserInput) (*domain.User, error)

func (*UserRepository) UpdateLastLogin

func (m *UserRepository) UpdateLastLogin(ctx context.Context, id string) error

Jump to

Keyboard shortcuts

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