services

package
v0.0.0-...-fd0e154 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCategoryService

func NewCategoryService(repo repositories.CategoryRepository) *categoryService

func NewProductService

func NewProductService(repo repositories.ProductRepository) *productService

func NewReportService

func NewReportService(repo repositories.ReportRepository) *reportService

Types

type CategoryService

type CategoryService interface {
	CreateCategory(category *models.Category) error
	GetAllCategories() ([]models.Category, error)
	GetCategoryByID(id uint) (models.Category, error)
	UpdateCategory(category *models.Category) error
	DeleteCategory(id uint) error
}

type ProductService

type ProductService interface {
	CreateProduct(product *models.Product) error
	GetAllProducts() ([]models.Product, error)
	GetAllProductsWithPagination(ctx *gin.Context) (models.ProductsPageable, error)
	GetProductByID(id uint) (models.Product, error)
	UpdateProduct(product *models.Product) (models.Product, error)
	DeleteProduct(id uint) error
}

type ReportService

type ReportService interface {
	GenerateProductReport(ctx *gin.Context, isOptimized bool) (map[string]interface{}, error)
}

Jump to

Keyboard shortcuts

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