persistence

package
v0.0.0-...-a69a74b Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartRepository

type CartRepository struct {
	// contains filtered or unexported fields
}

func NewCartRepository

func NewCartRepository(d *database.Database, dbName string) *CartRepository

func (*CartRepository) Create

func (r *CartRepository) Create(cart *entity.Cart) (*entity.Cart, error)

func (*CartRepository) Delete

func (r *CartRepository) Delete(id int) error

func (*CartRepository) GetByID

func (r *CartRepository) GetByID(id int) (*entity.Cart, error)

func (*CartRepository) Update

func (r *CartRepository) Update(cart *entity.Cart) (*entity.Cart, error)

type CategoryRepository

type CategoryRepository struct {
	// contains filtered or unexported fields
}

func NewCategoryRepository

func NewCategoryRepository(d *database.Database, dbName string) *CategoryRepository

func (*CategoryRepository) Create

func (r *CategoryRepository) Create(category *entity.Category) (*entity.Category, error)

func (*CategoryRepository) GetByID

func (r *CategoryRepository) GetByID(id int) (*entity.Category, error)

func (*CategoryRepository) List

func (r *CategoryRepository) List() ([]*entity.Category, error)

type ItemRepository

type ItemRepository struct {
	// contains filtered or unexported fields
}

func NewItemRepository

func NewItemRepository(d *database.Database, dbName string) *ItemRepository

func (*ItemRepository) Create

func (r *ItemRepository) Create(item *entity.Item) (*entity.Item, error)

func (*ItemRepository) Delete

func (r *ItemRepository) Delete(itemID int) error

func (*ItemRepository) GetById

func (r *ItemRepository) GetById(itemID int) (*entity.Item, error)

func (*ItemRepository) ListByCartId

func (r *ItemRepository) ListByCartId(cartId int) ([]*entity.Item, error)

func (*ItemRepository) Update

func (r *ItemRepository) Update(item *entity.Item) (*entity.Item, error)

type PromotionRepository

type PromotionRepository struct {
	// contains filtered or unexported fields
}

func NewPromotionRepository

func NewPromotionRepository(d *database.Database, dbName string) *PromotionRepository

func (*PromotionRepository) Create

func (r *PromotionRepository) Create(promotion *entity.Promotion) (*entity.Promotion, error)

func (*PromotionRepository) GetById

func (r *PromotionRepository) GetById(promotionID int) (*entity.Promotion, error)

func (*PromotionRepository) List

func (r *PromotionRepository) List() ([]*entity.Promotion, error)

type Repositories

type Repositories struct {
	Item      repository.ItemRepositoryI
	Category  repository.CategoryRepositoryI
	Promotion repository.PromotionRepositoryI
	VasItem   repository.VasItemRepositoryI
	Cart      repository.CartRepositoryI
	// contains filtered or unexported fields
}

func NewRepositories

func NewRepositories(cfg config.MongoDBConfig) (*Repositories, error)

func (*Repositories) Close

func (r *Repositories) Close()

type VasItemRepository

type VasItemRepository struct {
	// contains filtered or unexported fields
}

func NewVasItemRepository

func NewVasItemRepository(d *database.Database, dbName string) *VasItemRepository

func (*VasItemRepository) Create

func (r *VasItemRepository) Create(vasItem *entity.VasItem) (*entity.VasItem, error)

func (*VasItemRepository) DeleteById

func (r *VasItemRepository) DeleteById(vasItemId int) error

func (*VasItemRepository) GetById

func (r *VasItemRepository) GetById(vasItemId int) (*entity.VasItem, error)

func (*VasItemRepository) ListByItemId

func (r *VasItemRepository) ListByItemId(itemId int) ([]*entity.VasItem, error)

Jump to

Keyboard shortcuts

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