userRepository

package
v0.0.0-...-a9fa8a7 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserRepositoryService

type UserRepositoryService interface {
	IsUserExists(pctx context.Context, email, username string) bool
	InsertUser(pctx context.Context, user *user.User) (primitive.ObjectID, error)
	FindOneUserProfile(pctx context.Context, userId string) (*user.UserProfileBson, error)
	ResetPassword(pctx context.Context, userId, oldPassword, newPassword string) error

	AddToWallet(pctx context.Context, req *user.UserTransaction) error
	GetUserWalletAccount(pctx context.Context, userId string) (*user.UserWalletAccount, error)
	UpdateUserTransaction(pctx context.Context, orderId, paymentId string) error

	// Bidding wallet amount deduction and refund
	DeductWalletAmount(pctx context.Context, userId string, amount float64) (*user.UserWalletAccount, error)
	AddWalletAmount(pctx context.Context, userId string, amount float64) (*user.UserWalletAccount, error)

	FindOneEmail(pctx context.Context, email string) (*user.User, error)
	FindOneUserProfileToRefresh(pctx context.Context, userId string) (*user.User, error)
	BlockOrUnblockUser(pctx context.Context, userId string, isActive bool) error

	// ----- Wish List -----
	AddToWishList(pctx context.Context, userId, nftId string) (any, error)
	GetWishList(pctx context.Context, userId string) (any, error)
	RemoveFromWishList(pctx context.Context, userId, nftId string) error

	// ----- Address -----
	AddAddress(pctx context.Context, userId string, req *user.CreateUserAddressReq) (*user.AddressModel, error)
	GetAddress(pctx context.Context, userId string) (*[]user.AddressModel, error)
	UpdateAddress(pctx context.Context, userId string, address_id string, req *user.CreateUserAddressReq) (*user.AddressModel, error)
	DeleteAddress(pctx context.Context, userId, addressId string) error

	// ----- Reports -----
	UserPaymentReport(pctx context.Context, userId string) (any, error)
	SingleOrderPaymentReport(pctx context.Context, userId string) (any, error)

	// admin
	SalesReport(pctx context.Context) (any, error)
}

func NewUserRepository

func NewUserRepository(db *mongo.Client) UserRepositoryService

Jump to

Keyboard shortcuts

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