repository

package
v0.0.0-...-8054c29 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DbMock

func DbMock(t *testing.T) (*sql.DB, *gorm.DB, sqlmock.Sqlmock)

Types

type CategoryRepository

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

func NewCategoryRepository

func NewCategoryRepository(db *gorm.DB, logger *slog.Logger) *CategoryRepository

func (*CategoryRepository) GetById

func (c *CategoryRepository) GetById(id int) (*entity.Category, error)

type ClientRepository

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

func NewClientRepository

func NewClientRepository(db *gorm.DB, logger *slog.Logger) *ClientRepository

func (*ClientRepository) Create

func (c *ClientRepository) Create(client entity.Client) (entity.Client, error)

func (*ClientRepository) GetAlreadyExists

func (c *ClientRepository) GetAlreadyExists(cpf int, email string) (*entity.Client, error)

func (*ClientRepository) GetClientByCpf

func (c *ClientRepository) GetClientByCpf(cpf int) (*entity.Client, error)

func (*ClientRepository) GetClientById

func (c *ClientRepository) GetClientById(id *int) (*entity.Client, error)

type OrderRepository

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

func NewOrderRepository

func NewOrderRepository(db *gorm.DB, logger *slog.Logger) *OrderRepository

func (*OrderRepository) Create

func (o *OrderRepository) Create(order entity.Order) (entity.Order, error)

func (*OrderRepository) GetAll

func (o *OrderRepository) GetAll() ([]entity.Order, error)

func (*OrderRepository) GetById

func (o *OrderRepository) GetById(id int) (*entity.Order, error)

func (*OrderRepository) UpdateStatusById

func (o *OrderRepository) UpdateStatusById(id int, status enum.StatusOrder) error

type ProductRepository

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

func NewProductRepository

func NewProductRepository(db *gorm.DB, logger *slog.Logger) *ProductRepository

func (*ProductRepository) Create

func (p *ProductRepository) Create(product entity.Product) (entity.Product, error)

func (*ProductRepository) Delete

func (p *ProductRepository) Delete(id int) error

func (*ProductRepository) GetById

func (p *ProductRepository) GetById(id int) (*entity.Product, error)

func (*ProductRepository) GetProductByCategory

func (p *ProductRepository) GetProductByCategory(categoryId int) ([]entity.Product, error)

func (*ProductRepository) Update

func (p *ProductRepository) Update(product entity.Product) (*entity.Product, error)

Jump to

Keyboard shortcuts

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