Documentation
¶
Index ¶
- func DbMock(t *testing.T) (*sql.DB, *gorm.DB, sqlmock.Sqlmock)
- type CategoryRepository
- type ClientRepository
- func (c *ClientRepository) Create(client entity.Client) (entity.Client, error)
- func (c *ClientRepository) GetAlreadyExists(cpf int, email string) (*entity.Client, error)
- func (c *ClientRepository) GetClientByCpf(cpf int) (*entity.Client, error)
- func (c *ClientRepository) GetClientById(id *int) (*entity.Client, error)
- type OrderRepository
- type ProductRepository
- func (p *ProductRepository) Create(product entity.Product) (entity.Product, error)
- func (p *ProductRepository) Delete(id int) error
- func (p *ProductRepository) GetById(id int) (*entity.Product, error)
- func (p *ProductRepository) GetProductByCategory(categoryId int) ([]entity.Product, error)
- func (p *ProductRepository) Update(product entity.Product) (*entity.Product, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CategoryRepository ¶
type CategoryRepository struct {
// contains filtered or unexported fields
}
func NewCategoryRepository ¶
func NewCategoryRepository(db *gorm.DB, logger *slog.Logger) *CategoryRepository
type ClientRepository ¶
type ClientRepository struct {
// contains filtered or unexported fields
}
func NewClientRepository ¶
func NewClientRepository(db *gorm.DB, logger *slog.Logger) *ClientRepository
func (*ClientRepository) GetAlreadyExists ¶
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) 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) 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)
Click to show internal directories.
Click to hide internal directories.