productlineep

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProductLinePresenter

func ProductLinePresenter(pl *pb.ProductLineInfo, ownerAccount *apiresource.Account) apiresource.ProductLine

Types

type BulkUpsertProductLinesEndpoint

type BulkUpsertProductLinesEndpoint struct{}

Creates or updates multiple product lines for the account, matched by name (case-insensitive), then writes asynchronously — 202 with a job to poll.

func (*BulkUpsertProductLinesEndpoint) Materialize

type BulkUpsertProductLinesRequest

type BulkUpsertProductLinesRequest struct {
	// Product lines to create or update, matched by name within the account.
	ProductLines []UpsertProductLineInput `json:"product_lines" validate:"required,min=1,max=1000,dive"`
}

BulkUpsertProductLinesRequest is the request to bulk upsert product lines.

func (*BulkUpsertProductLinesRequest) SchemaExample

func (*BulkUpsertProductLinesRequest) SchemaExample() any

type CreateProductLineEndpoint

type CreateProductLineEndpoint struct{}

Creates a product line owned by your account.

The new line starts with no products; assign products to it by setting their product line. Customers and account groups can only be granted access to lines your account owns, so this is the starting point for scoping a customer's catalog.

func (*CreateProductLineEndpoint) Materialize

type CreateProductLineRequest

type CreateProductLineRequest struct {
	// Display name of the product line.
	//
	// Must be unique among the product lines visible to your account, including the shared system lines; a duplicate name returns a conflict error.
	Name string `json:"name" validate:"required,max=255"`
	// ID of the unit group to associate with this product line.
	//
	// The unit group determines the set of units available to products in this product line. It must be a unit group your account owns or one of the shared system unit groups.
	UnitGroupID string `json:"unit_group_id" validate:"required"`
	// Default commission policy for products in this product line.
	//
	// - `commission_exempt`: no commission applies to these products.
	// - `commission_applied`: commission applies to these products, unless overridden elsewhere.
	CommissionPolicy constants.CommissionPolicy `json:"commission_policy" validate:"required"`
	// The lot products in this line are made in — a doff, a pallet.
	//
	// Sizes the campaigns a production schedule plans, and defaults the quantity when a batch is added to a production run. The unit is part of the value, since 60 pairs and 60 eaches are different lots, and it must belong to the unit group given by `unit_group_id`. The value must be greater than zero. Leave this out for a line with no lot convention, and planning falls back to the lot of the line an item feeds into, and then to the account-wide default lot size.
	DefaultLot field.Optional[apirequest.QuantityInput] `json:"default_lot,omitzero"`
	// How products in this line are produced when they do not say for themselves.
	//
	// - `make_to_stock`: built to the forecast, holding a safety stock against its variability.
	// - `make_to_order`: built only against orders already on the book, holding no buffer.
	FulfillmentPolicy field.Optional[constants.FulfillmentPolicy] `json:"fulfillment_policy,omitzero"`
	// Default freight policy for products in this product line.
	//
	// - `free_freight`: these products do not incur a freight charge.
	// - `billed_freight`: freight is billed for these products, unless overridden elsewhere.
	FreightPolicy constants.FreightPolicy `json:"freight_policy" validate:"required"`
}

Request to create a product line.

func (*CreateProductLineRequest) SchemaExample

func (*CreateProductLineRequest) SchemaExample() any

type DeleteProductLineEndpoint

type DeleteProductLineEndpoint struct{}

Permanently deletes a product line your account owns.

The reserved `shipping`, `service`, `credit`, and `tax` lines cannot be deleted, and neither can the shared system lines, which belong to no single account. Deleting a line that was already deleted returns an already-deleted error rather than succeeding silently.

func (*DeleteProductLineEndpoint) Materialize

type DeleteProductLineRequest

type DeleteProductLineRequest struct {
	// Product line ID.
	ProductLineID string `path:"id" validate:"required"`
}

Request to delete a product line.

type ExportProductLinesEndpoint

type ExportProductLinesEndpoint struct{}

Starts an export of every matching product line and returns the job that tracks it; system

func (*ExportProductLinesEndpoint) Materialize

type ExportProductLinesRequest

type ExportProductLinesRequest struct {
	// Free-text search term matched against product line names.
	Query *string `json:"q"`
}

Filters which product lines land in the exported file.

func (*ExportProductLinesRequest) SchemaExample

func (*ExportProductLinesRequest) SchemaExample() any

type ListProductLinesEndpoint

type ListProductLinesEndpoint struct{}

Returns a paginated list of product lines, newest first.

Covers both the product lines your account owns and the shared system lines. The `q` search term is matched against the product line name.

type ListProductLinesRequest

type ListProductLinesRequest struct {
	apiresource.PaginationRequest
}

Request to list product lines.

type ProductLineSvcConfig

type ProductLineSvcConfig struct {
	// CoreClient (required) is the core-service gRPC client.
	CoreClient pb.CoreServiceClient
}

type RetrieveProductLineEndpoint

type RetrieveProductLineEndpoint struct{}

Returns a single product line by ID.

Both the product lines your account owns and the shared system lines can be retrieved.

func (*RetrieveProductLineEndpoint) Materialize

type RetrieveProductLineRequest

type RetrieveProductLineRequest struct {
	// Product line ID.
	ProductLineID string `path:"id" validate:"required"`
}

Request to get a product line.

type UpdateProductLineEndpoint

type UpdateProductLineEndpoint struct{}

Partially updates a product line your account owns.

Only the provided fields are changed. The reserved `shipping`, `service`, `credit`, and `tax` lines cannot be updated, and neither can the shared system lines, which belong to no single account.

func (*UpdateProductLineEndpoint) Materialize

type UpdateProductLineRequest

type UpdateProductLineRequest struct {
	// Product line ID.
	ProductLineID string `path:"id" validate:"required"`
	// Display name of the product line.
	//
	// Must be unique among the product lines visible to your account, including the shared system lines; a duplicate name returns a conflict error.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Default commission policy for products in this product line.
	//
	// - `commission_exempt`: no commission applies to these products.
	// - `commission_applied`: commission applies to these products, unless overridden elsewhere.
	CommissionPolicy field.Optional[constants.CommissionPolicy] `json:"commission_policy,omitzero"`
	// Default freight policy for products in this product line.
	//
	// - `free_freight`: these products do not incur a freight charge.
	// - `billed_freight`: freight is billed for these products, unless overridden elsewhere.
	FreightPolicy field.Optional[constants.FreightPolicy] `json:"freight_policy,omitzero"`
	// The lot products in this line are made in — a doff, a pallet.
	//
	// Sizes the campaigns a production schedule plans, and defaults the quantity when a batch is added to a production run. The unit is part of the value, since 60 pairs and 60 eaches are different lots, and it must belong to the line's unit group — the new one when `unit_group_id` changes in the same request. Send `null` to remove the line's lot convention, after which planning falls back to the lot of the line an item feeds into, and then to the account-wide default lot size.
	DefaultLot field.Clearable[apirequest.QuantityInput] `json:"default_lot,omitzero"`
	// How products in this line are produced when they do not say for themselves.
	//
	// - `make_to_stock`: built to the forecast, holding a safety stock against its variability.
	// - `make_to_order`: built only against orders already on the book, holding no buffer.
	//
	// Clearing it returns the line's products to the account default.
	FulfillmentPolicy field.Clearable[constants.FulfillmentPolicy] `json:"fulfillment_policy,omitzero"`
	// ID of the unit group to associate with this product line.
	//
	// The unit group determines the set of units available to products in this product line. It must be a unit group your account owns or one of the shared system unit groups. A lot already stored on the line is not rechecked when the group changes, so send `default_lot` alongside to keep the two consistent.
	UnitGroupID field.Optional[string] `json:"unit_group_id,omitzero" validate:"omitempty"`
}

Request to partially update a product line.

func (*UpdateProductLineRequest) SchemaExample

func (*UpdateProductLineRequest) SchemaExample() any

type UpsertProductLineInput

type UpsertProductLineInput struct {
	// Display name of the product line, matched case-insensitively against existing lines.
	// A row matching a system product line fails — system lines cannot be modified.
	Name string `json:"name" validate:"required,max=255"`
	// Unit group to associate with this product line, referenced by `id` or `name`.
	UnitGroup apirequest.ObjectIdentifier `json:"unit_group" validate:"required"`
	// Default commission policy for products in this product line.
	//
	// - `commission_exempt`: no commission applies to these products.
	// - `commission_applied`: commission applies to these products, unless overridden elsewhere.
	CommissionPolicy constants.CommissionPolicy `json:"commission_policy" validate:"required"`
	// Default freight policy for products in this product line.
	//
	// - `free_freight`: these products do not incur a freight charge.
	// - `billed_freight`: freight is billed for these products, unless overridden elsewhere.
	FreightPolicy constants.FreightPolicy `json:"freight_policy" validate:"required"`
}

UpsertProductLineInput is the input for a single product line in a bulk upsert operation.

Jump to

Keyboard shortcuts

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