repository

package
v0.0.0-...-dd467ca Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressRepository

type AddressRepository interface {
	Create(ctx context.Context, req model.DeliveryAddress) error
	Read(context.Context) ([]model.DeliveryAddress, error)
	Update(ctx context.Context, req model.DeliveryAddress) (*model.DeliveryAddress, error)
	Delete(ctx context.Context, id string) error
	ReadByID(ctx context.Context, id string) (response model.DeliveryAddress, err error)
}

func NewAddressRepository

func NewAddressRepository(db *mongo.Database) AddressRepository

type CartRepository

type CartRepository interface {
	Read(ctx context.Context, userid primitive.ObjectID) ([]model.CartItem, error)
	Update(ctx context.Context, userid primitive.ObjectID, cart model.CartItem) error
	Delete(ctx context.Context, userid primitive.ObjectID) error
	DeleteByID(ctx context.Context, userid primitive.ObjectID, itemid primitive.ObjectID) error
}

func NewCartRepository

func NewCartRepository(db *mongo.Database) CartRepository

type CategoryRepository

type CategoryRepository interface {
	Read(context.Context, model.Paging) ([]model.Category, error)
	Create(ctx context.Context, category model.Category) error
	Update(ctx context.Context, category model.Category) (*model.Category, error)
	Delete(ctx context.Context, id string) error
	ReadByID(ctx context.Context, id string) (*model.Category, error)
}

func NewCategoryRepository

func NewCategoryRepository(db *mongo.Database) CategoryRepository

type InvoiceRepository

type InvoiceRepository interface {
	Create(ctx context.Context, order model.Invoice) error
	Read(ctx context.Context, orderid string) (model.Invoice, error)
}

func NewInvoiceRepository

func NewInvoiceRepository(db *mongo.Database) InvoiceRepository

type OrderRepository

type OrderRepository interface {
	Create(ctx context.Context, order model.Order) error
	StoreOrderItem(ctx context.Context, request []model.OrderItem) ([]model.OrderItem, error)
	Read(ctx context.Context, userid primitive.ObjectID) (response []model.Order, err error)
}

func NewOrderRepository

func NewOrderRepository(db *mongo.Database) OrderRepository

type ProductRepository

type ProductRepository interface {
	Read(context.Context, model.ReadProductRequest) (products []model.Product, total int64, err error)
	Create(ctx context.Context, product model.Product) error
	Update(ctx context.Context, product model.Product) (*model.Product, error)
	ReadByID(ctx context.Context, id string) (*model.Product, error)
	Delete(ctx context.Context, id string) error
	ReadCategoryByID(ctx context.Context, id string) (model.Category, error)
	ReadTagsByName(ctx context.Context, tagName []string) (tags []model.Tag, err error)
}

func NewProductRepository

func NewProductRepository(db *mongo.Database) ProductRepository

type TagRepository

type TagRepository interface {
	Read(context.Context, model.Paging) ([]model.Tag, error)
	Create(ctx context.Context, tag model.Tag) error
	Update(ctx context.Context, tag model.Tag) (*model.Tag, error)
	ReadByID(ctx context.Context, id string) (*model.Tag, error)
	Delete(ctx context.Context, id string) error
}

func NewTagRepository

func NewTagRepository(db *mongo.Database) TagRepository

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, user model.User) error
	Read(context.Context) ([]model.User, error)
	CountEmail(ctx context.Context, email string) (int64, error)
	ReadByName(ctx context.Context, name string) (user *model.User, err error)
	ReadByEmail(ctx context.Context, email string) (user *model.User, err error)
}

func NewUserRepository

func NewUserRepository(db *mongo.Database) UserRepository

Jump to

Keyboard shortcuts

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