Pavel Sinitsin
99c8dbd911
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.
27 lines
601 B
Go
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),
|
|
}
|
|
}
|