db

package
v0.0.0-...-f89287e Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 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 CategoryRepository

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

func NewCategoryRepository

func NewCategoryRepository(logger *otelzap.SugaredLogger, db *mongo.Database) *CategoryRepository

func (*CategoryRepository) Delete

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

func (*CategoryRepository) Get

func (*CategoryRepository) GetAll

func (r *CategoryRepository) GetAll(ctx context.Context) ([]domain.Category, error)

func (*CategoryRepository) Insert

func (r *CategoryRepository) Insert(ctx context.Context, catg domain.Category) (string, error)

func (*CategoryRepository) Update

func (r *CategoryRepository) Update(ctx context.Context, id string, catg domain.Category) error

type IngredientRepository

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

func NewIngredientRepository

func NewIngredientRepository(logger *otelzap.SugaredLogger, db *mongo.Database) *IngredientRepository

func (*IngredientRepository) Delete

func (r *IngredientRepository) Delete(ctx context.Context, id string) error

func (*IngredientRepository) Get

func (*IngredientRepository) GetAll

func (*IngredientRepository) GetPaginated

func (r *IngredientRepository) GetPaginated(
	ctx context.Context, limit int, offset int, sortField string, sortDirection enum.SortDirection,
) ([]domain.Ingredient, error)

func (*IngredientRepository) Insert

func (r *IngredientRepository) Insert(ctx context.Context, ingred domain.Ingredient) (string, error)

func (*IngredientRepository) Update

func (r *IngredientRepository) Update(ctx context.Context, id string, ingred domain.Ingredient) error

type KitRepository

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

func NewKitRepository

func NewKitRepository(logger *otelzap.SugaredLogger, db *mongo.Database) *KitRepository

func (*KitRepository) Delete

func (r *KitRepository) Delete(ctx context.Context, id string) error

func (*KitRepository) Get

func (r *KitRepository) Get(ctx context.Context, id string) (domain.Kit, error)

func (*KitRepository) GetAll

func (r *KitRepository) GetAll(ctx context.Context) ([]domain.Kit, error)

func (*KitRepository) GetPaginated

func (r *KitRepository) GetPaginated(
	ctx context.Context, limit int, offset int, sortField string, sortDirection enum.SortDirection,
) ([]domain.Kit, error)

func (*KitRepository) Insert

func (r *KitRepository) Insert(ctx context.Context, kit domain.Kit) (string, error)

func (*KitRepository) Update

func (r *KitRepository) Update(ctx context.Context, id string, kit domain.Kit) error

Updates the non-price fields of the kit

func (*KitRepository) UpdatePrice

func (r *KitRepository) UpdatePrice(ctx context.Context, id string, prices []domain.Price) error

Updates the prices of the kit

Jump to

Keyboard shortcuts

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