Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatalogSvc ¶
type CatalogSvc interface {
ListCatalogProductLines(ctx context.Context, req *ListCatalogProductLinesRequest) (*apiresource.List[apiresource.CatalogProductLine], *apierror.APIError)
ListCatalogProducts(ctx context.Context, req *ListCatalogProductsRequest) (*apiresource.List[apiresource.CatalogCategory], *apierror.APIError)
}
func NewCatalogSvc ¶
func NewCatalogSvc(config *CatalogSvcConfig) CatalogSvc
type CatalogSvcConfig ¶
type CatalogSvcConfig struct {
// CoreClient (required) is the core-service gRPC client.
CoreClient pb.CoreServiceClient
}
type ListCatalogProductLinesEndpoint ¶
type ListCatalogProductLinesEndpoint struct{}
Returns the product lines available in the catalog, ordered by name.
A product line only appears once it holds at least one product whose `portal_visibility` is `visible`. When the caller is a customer user, the list is narrowed further to the product lines that customer has been granted access to, either directly, through an account group, or through the account group used as their price group. The `q` search term is matched against the product line name.
func (*ListCatalogProductLinesEndpoint) Materialize ¶
func (e *ListCatalogProductLinesEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListCatalogProductLinesRequest, *apiresource.List[apiresource.CatalogProductLine]]
type ListCatalogProductLinesRequest ¶
type ListCatalogProductLinesRequest struct {
apiresource.PaginationRequest
}
Request to list catalog product lines.
type ListCatalogProductsEndpoint ¶
type ListCatalogProductsEndpoint struct{}
Returns the products in a product line, grouped by item category.
Each category lists the properties its products vary along and the products themselves, with categories ordered by name and products ordered by SKU. Only products whose `portal_visibility` is `visible` are included, and a customer user additionally only sees product lines they have been granted access to.
Pagination and the `q` search term apply to the categories — `q` is matched against the category name, and a page returns whole categories with all of their products.
func (*ListCatalogProductsEndpoint) Materialize ¶
func (e *ListCatalogProductsEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListCatalogProductsRequest, *apiresource.List[apiresource.CatalogCategory]]
type ListCatalogProductsRequest ¶
type ListCatalogProductsRequest struct {
// Product line ID.
ProductLineID string `path:"id" validate:"required"`
apiresource.PaginationRequest
}
Request to list products in a catalog product line.