Documentation
¶
Index ¶
- Variables
- func CreateTable(client sqlclient.ISqlClientConn, ctx context.Context, table any) error
- type IProductCategories
- type IProducts
- type IStatistics
- type ISuppliers
- type ProductCategoies
- func (repo *ProductCategoies) Delete(ctx context.Context, categoryId string) error
- func (repo *ProductCategoies) Insert(ctx context.Context, data *models.ProductCategories) error
- func (repo *ProductCategoies) Select(ctx context.Context, filter *models.ProductCategoriesQuery) (int, []models.ProductCategoriesResponse, error)
- func (repo *ProductCategoies) Update(ctx context.Context, data *models.ProductCategories) error
- type Products
- func (repo *Products) Delete(ctx context.Context, id string) error
- func (repo *Products) Insert(ctx context.Context, data *models.Products) error
- func (repo *Products) Select(ctx context.Context, filter *models.ProductsQuery) (int, []models.ProductsResponse, error)
- func (repo *Products) SelectById(ctx context.Context, id string) (result models.ProductsResponse, err error)
- func (repo *Products) SelectScroll(ctx context.Context, filter *models.ProductsQuery) ([]models.ProductsResponse, error)
- func (repo *Products) Update(ctx context.Context, id string, data *models.Products) error
- type Statistics
- type Suppliers
- func (repo *Suppliers) Delete(ctx context.Context, supplierId string) error
- func (repo *Suppliers) Insert(ctx context.Context, data *models.Suppliers) error
- func (repo *Suppliers) Select(ctx context.Context, filter *models.SuppliersQuery) (int, []models.SuppliersResponse, error)
- func (repo *Suppliers) Update(ctx context.Context, data *models.Suppliers) error
Constants ¶
This section is empty.
Variables ¶
View Source
var PgSqlClient sqlclient.ISqlClientConn
Functions ¶
func CreateTable ¶
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 (repo *ProductCategoies) Select(ctx context.Context, filter *models.ProductCategoriesQuery) (int, []models.ProductCategoriesResponse, error)
func (*ProductCategoies) Update ¶
func (repo *ProductCategoies) Update(ctx context.Context, data *models.ProductCategories) error
type Products ¶
type Products struct{}
func (*Products) Select ¶
func (repo *Products) Select(ctx context.Context, filter *models.ProductsQuery) (int, []models.ProductsResponse, error)
func (*Products) SelectById ¶
func (*Products) SelectScroll ¶
func (repo *Products) SelectScroll(ctx context.Context, filter *models.ProductsQuery) ([]models.ProductsResponse, 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)
Click to show internal directories.
Click to hide internal directories.