nftRepository

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NftRepositoryService

type NftRepositoryService interface {
	// ------------------- NFT ------------------- //
	IsUniqueNft(pctx context.Context, title string) bool
	InsertOneNft(pctx context.Context, req *nft.Nft) (primitive.ObjectID, error)
	FindOneNft(pctx context.Context, nftId string) (*nft.Nft, error)
	FindManyNfts(pctx context.Context, filter primitive.D, opts []*options.FindOptions) ([]*nft.NftShowCase, error)
	CountNfts(pctx context.Context, filter primitive.D) (int64, error)
	UpdateOneNft(pctx context.Context, nftId string, req primitive.M) error
	BlockOrUnblockNft(pctx context.Context, nftId string, isActive bool) error
	DeleteNft(pctx context.Context, nftId string) error

	// ------------------- Category ------------------- //
	InsertOneCategory(pctx context.Context, req *nft.NftCategory) (primitive.ObjectID, error)
	FindOneCategory(pctx context.Context, categoryId string) (*nft.NftCategory, error)
	FindManyCategories(pctx context.Context, filter primitive.D, opts []*options.FindOptions) ([]*nft.NftCategory, error)
	UpdateOneCategory(pctx context.Context, categoryId string, req primitive.M) error
	BlockOrUnblockCategory(pctx context.Context, categoryId string, isActive bool) error
	DeleteCategory(pctx context.Context, categoryId string) error

	// ------------------- Bidding ------------------- //
	FindManyBids(pctx context.Context, userId string) ([]*nft.Bid, error)
	CreateBid(pctx context.Context, userId string, req *nft.CreateBidReq) (primitive.ObjectID, error)
	FindOneBid(pctx context.Context, bidId string) (*nft.Bid, error)
	EditBid(pctx context.Context, bidId string, req primitive.M) error
	DeleteBid(pctx context.Context, bidId string) error

	// ------------------- NFT Bidding User ------------------- //
	FindOneUserBid(pctx context.Context, userId, bidId string) (*nft.SingleBid, error)
	FindUserBids(pctx context.Context, userId string) (any, error)
	BidNft(pctx context.Context, userId, nftId, price string) (primitive.ObjectID, error)
	WithdrawBid(pctx context.Context, bidId string) error
}

func NewNftRepository

func NewNftRepository(db *mongo.Client) NftRepositoryService

Jump to

Keyboard shortcuts

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