bpiek/api/api.go
Pavel Sinitsin 99c8dbd911
Add methods to retrieve products and inventory data
Implemented `GetProductByArticle` to fetch product details by article. Added `GetRemainsAndPlanresidues` to obtain inventory balances for categories. These enhancements improve the API's capability to manage product and inventory information.
2024-09-07 22:02:10 +03:00

27 lines
601 B
Go

package api
import (
"gitea.24example.ru/spavelit/bpiek/client"
"gitea.24example.ru/spavelit/bpiek/model"
)
type Api struct {
Client *client.Client
}
type Method interface {
GetParentCategories() ([]model.Category, error)
GetCategories() ([]model.Category, error)
GetTreeCategories() ([]model.TreeCategories, error)
GetProducts() ([]model.Product, error)
GetProductByArticle(article string) (model.Product, error)
GetRemainsAndPlanresidues() ([]model.ShortProduct, error)
}
func NewApi(credentials client.Credentials) Method {
return &Api{
Client: client.NewClient(credentials),
}
}