repositories

package
v0.0.0-...-f5c995d Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CreateTable

func CreateTable(client sqlclient.ISqlClientConn, ctx context.Context, table any) error

Types

type IProductCategories

type IProductCategories interface {
	Insert(ctx context.Context, data *models.ProductCategories) error
	Update(ctx context.Context, data *models.ProductCategories) error
	Delete(ctx context.Context, categoryId string) error
	Select(ctx context.Context, filter *models.ProductCategoriesQuery) (int, []models.ProductCategoriesResponse, error)
}
var ProductCategoryRepo IProductCategories

func NewProductCategories

func NewProductCategories() IProductCategories

type IProducts

type IProducts interface {
	Insert(ctx context.Context, product *models.Products) error
	Update(ctx context.Context, id string, product *models.Products) error
	Delete(ctx context.Context, id string) error
	Select(ctx context.Context, filter *models.ProductsQuery) (int, []models.ProductsResponse, error)
	SelectById(ctx context.Context, id string) (result models.ProductsResponse, err error)
	SelectScroll(ctx context.Context, query *models.ProductsQuery) (result []models.ProductsResponse, err error)
}
var ProductRepo IProducts

func NewProducts

func NewProducts() IProducts

type IStatistics

type IStatistics interface {
	GetProductsPerCategory(ctx context.Context) ([]models.ProductsPerCategoryStat, error)
	GetProductsPerSupplier(ctx context.Context) ([]models.ProductsPerSupplierStat, error)
}
var StatisticsRepo IStatistics

func NewStatisticsRepo

func NewStatisticsRepo() IStatistics

type ISuppliers

type ISuppliers interface {
	Insert(ctx context.Context, data *models.Suppliers) error
	Update(ctx context.Context, data *models.Suppliers) error
	Delete(ctx context.Context, supplierId string) error
	Select(ctx context.Context, filter *models.SuppliersQuery) (int, []models.SuppliersResponse, error)
}
var SupplierRepo ISuppliers

func NewSuppliers

func NewSuppliers() ISuppliers

type ProductCategoies

type ProductCategoies struct{}

func (*ProductCategoies) Delete

func (repo *ProductCategoies) Delete(ctx context.Context, categoryId string) error

func (*ProductCategoies) Insert

func (repo *ProductCategoies) Insert(ctx context.Context, data *models.ProductCategories) error

func (*ProductCategoies) Select

func (*ProductCategoies) Update

func (repo *ProductCategoies) Update(ctx context.Context, data *models.ProductCategories) error

type Products

type Products struct{}

func (*Products) Delete

func (repo *Products) Delete(ctx context.Context, id string) error

func (*Products) Insert

func (repo *Products) Insert(ctx context.Context, data *models.Products) error

func (*Products) Select

func (repo *Products) Select(ctx context.Context, filter *models.ProductsQuery) (int, []models.ProductsResponse, error)

func (*Products) SelectById

func (repo *Products) SelectById(ctx context.Context, id string) (result models.ProductsResponse, err error)

func (*Products) SelectScroll

func (repo *Products) SelectScroll(ctx context.Context, filter *models.ProductsQuery) ([]models.ProductsResponse, error)

func (*Products) Update

func (repo *Products) Update(ctx context.Context, id string, data *models.Products) error

type Statistics

type Statistics struct{}

func (*Statistics) GetProductsPerCategory

func (repo *Statistics) GetProductsPerCategory(ctx context.Context) ([]models.ProductsPerCategoryStat, error)

func (*Statistics) GetProductsPerSupplier

func (repo *Statistics) GetProductsPerSupplier(ctx context.Context) ([]models.ProductsPerSupplierStat, error)

type Suppliers

type Suppliers struct{}

func (*Suppliers) Delete

func (repo *Suppliers) Delete(ctx context.Context, supplierId string) error

func (*Suppliers) Insert

func (repo *Suppliers) Insert(ctx context.Context, data *models.Suppliers) error

func (*Suppliers) Select

func (repo *Suppliers) Select(ctx context.Context, filter *models.SuppliersQuery) (int, []models.SuppliersResponse, error)

func (*Suppliers) Update

func (repo *Suppliers) Update(ctx context.Context, data *models.Suppliers) error

Jump to

Keyboard shortcuts

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