Documentation
¶
Index ¶
- type GetPickShipmentsEndpoint
- type GetPickShipmentsRequest
- type ListPicksEndpoint
- type ListPicksRequest
- type PackPickEndpoint
- type PackPickRequest
- type PickAllLinesEndpoint
- type PickAllLinesRequest
- type PickPickLineEndpoint
- type PickPickLineRequest
- type PickSvc
- type PickSvcConfig
- type RetrievePickEndpoint
- type RetrievePickRequest
- type UpdatePickEndpoint
- type UpdatePickLineEndpoint
- type UpdatePickLineRequest
- type UpdatePickRequest
- type VoidPickEndpoint
- type VoidPickLineEndpoint
- type VoidPickLineRequest
- type VoidPickRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetPickShipmentsEndpoint ¶
type GetPickShipmentsEndpoint struct{}
Returns the shipment numbers associated with a pick, oldest first.
Shipments are matched through the pick's sales order, so the list covers every shipment created for that order — each partial pack of the pick adds another one. Only the numbers are returned; retrieve the shipment to get its full detail.
func (*GetPickShipmentsEndpoint) Materialize ¶
func (e *GetPickShipmentsEndpoint) Materialize() *apiendpoint.APIEndpoint[*GetPickShipmentsRequest, *apiresource.PickShipmentsResponse]
type GetPickShipmentsRequest ¶
type GetPickShipmentsRequest struct {
// Pick ID.
PickID string `path:"id" validate:"required"`
// Search query that filters shipment numbers by substring match.
Query *string `query:"q"`
// Maximum number of results to return.
Limit *int32 `query:"limit"`
// Number of results to skip.
Offset *int32 `query:"offset"`
}
Request to list the shipment numbers for a pick.
type ListPicksEndpoint ¶
type ListPicksEndpoint struct{}
Returns a paginated list of picks, soonest ship-by date first.
The `q` search term matches the pick number, the sales order number, the customer PO number, and the customer's name or number.
func (*ListPicksEndpoint) Materialize ¶
func (e *ListPicksEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListPicksRequest, *apiresource.List[apiresource.Pick]]
type ListPicksRequest ¶
type ListPicksRequest struct {
apiresource.PaginationRequest
// Filter by pick status.
Status *constants.PickStatus `query:"status"`
// Filter by customer IDs.
CustomerIDs []string `query:"customer_ids"`
// Filter by product line IDs.
//
// Matches picks that contain at least one line for a product in any of the given product lines.
ProductLineIDs []string `query:"product_line_ids"`
// Filter by customer type group IDs.
//
// Matches picks whose customer's type group — the account group returned in the customer's `type` field — is one of the given groups.
CustomerGroupIDs []string `query:"customer_group_ids"`
// Filter by department IDs.
//
// Matches picks assigned to any of the given departments.
DepartmentIDs []string `query:"department_ids"`
// Only return picks created on or after this date (`YYYY-MM-DD`).
StartDate *string `query:"starts_at" validate:"omitempty,date_filter"`
// Only return picks created before this date (`YYYY-MM-DD`).
EndDate *string `query:"ends_at" validate:"omitempty,date_filter"`
// Orders the results: `ship_by_date` puts the soonest delivery commitment first, with picks whose order has no ship-by date last; `created_at` puts the newest pick first.
Sort constants.PickSort `query:"sort" default:"ship_by_date"`
}
Request to list picks.
type PackPickEndpoint ¶
type PackPickEndpoint struct{}
Packs a pick, creating a shipment from the picked lines.
Returns `202 Accepted` with a job, because packing writes a shipment, one shipment line per packed pick line, and the requested shipping cases. Poll the job at the returned `Location`; once it reports `completed`, its first result carries the new shipment's `id`, with the shipment line and shipping case ids in `sub_resource_ids`. Every unpacked line with a picked quantity greater than zero is marked as packed and added to a new shipment in `packed` status, which inherits the sales order's carrier, service level, and shipping address. When a sales order line still has outstanding quantity afterward and no unpacked pick line is already open for it, a new zero-quantity pick line is created for the remainder, so packing a partial pick leaves the pick open for the next round. The pick is marked finished only once every one of its lines is packed.
Returns a validation error if no line on the pick has a picked quantity greater than zero.
func (*PackPickEndpoint) Materialize ¶
func (e *PackPickEndpoint) Materialize() *apiendpoint.APIEndpoint[*PackPickRequest, *apiresource.Job]
type PackPickRequest ¶
type PackPickRequest struct {
// Pick ID.
PickID string `path:"id" validate:"required"`
// Number of shipping cases to create on the new shipment.
//
// Must be at least 1. Cases are numbered sequentially from the shipment number (e.g. `SO-001-1`, `SO-001-2`), and each starts with zero freight weight and freight cost for you to fill in later.
ShipmentCaseCount int32 `json:"shipment_case_count" validate:"required,gte=1"`
}
Request to pack a pick, creating a shipment from the picked lines.
func (*PackPickRequest) SchemaExample ¶
func (*PackPickRequest) SchemaExample() any
type PickAllLinesEndpoint ¶
type PickAllLinesEndpoint struct{}
Marks all lines on a pick as picked.
Sets each unpacked line's picked quantity to the quantity still outstanding on its sales order line, after accounting for what other pick lines for that order line have already picked. Lines that have already been packed are unaffected. Use this to fill in a full pick in one call instead of picking each line individually; nothing is shipped until the pick is packed.
func (*PickAllLinesEndpoint) Materialize ¶
func (e *PickAllLinesEndpoint) Materialize() *apiendpoint.APIEndpoint[*PickAllLinesRequest, *apiresource.Pick]
type PickAllLinesRequest ¶
type PickAllLinesRequest struct {
// Pick ID.
PickID string `path:"id" validate:"required"`
}
Request to mark all lines on a pick as picked.
type PickPickLineEndpoint ¶
type PickPickLineEndpoint struct{}
Marks a pick line as fully picked.
Sets the line's picked quantity to its sales order line's ordered quantity less everything already picked for that order line, including whatever this line had picked before the call. To record a short pick instead, set the quantity yourself with Update Pick Line. Has no effect on a line that has already been packed.
func (*PickPickLineEndpoint) Materialize ¶
func (e *PickPickLineEndpoint) Materialize() *apiendpoint.APIEndpoint[*PickPickLineRequest, *apiresource.PickLine]
type PickPickLineRequest ¶
type PickPickLineRequest struct {
// Pick ID.
PickID string `path:"pick_id" validate:"required"`
// Pick line ID.
PickLineID string `path:"id" validate:"required"`
}
Request to mark a pick line as picked.
type PickSvc ¶
type PickSvc interface {
ListPicks(ctx context.Context, req *ListPicksRequest) (*apiresource.List[apiresource.Pick], *apierror.APIError)
GetPick(ctx context.Context, req *RetrievePickRequest) (*apiresource.Pick, *apierror.APIError)
UpdatePick(ctx context.Context, req *UpdatePickRequest) (*apiresource.Pick, *apierror.APIError)
PickAllLines(ctx context.Context, req *PickAllLinesRequest) (*apiresource.Pick, *apierror.APIError)
VoidPick(ctx context.Context, req *VoidPickRequest) (*apiresource.Pick, *apierror.APIError)
PackPick(ctx context.Context, req *PackPickRequest) (*apiresource.Job, *apierror.APIError)
GetPickShipments(ctx context.Context, req *GetPickShipmentsRequest) (*apiresource.PickShipmentsResponse, *apierror.APIError)
UpdatePickLine(ctx context.Context, req *UpdatePickLineRequest) (*apiresource.PickLine, *apierror.APIError)
PickPickLine(ctx context.Context, req *PickPickLineRequest) (*apiresource.PickLine, *apierror.APIError)
VoidPickLine(ctx context.Context, req *VoidPickLineRequest) (*apiresource.PickLine, *apierror.APIError)
}
func NewPickSvc ¶
func NewPickSvc(config *PickSvcConfig) PickSvc
type PickSvcConfig ¶
type PickSvcConfig struct {
// CoreClient (required) is the core-service picking gRPC client.
CoreClient pb.CorePickingServiceClient
}
type RetrievePickEndpoint ¶
type RetrievePickEndpoint struct{}
Returns a pick by ID.
func (*RetrievePickEndpoint) Materialize ¶
func (e *RetrievePickEndpoint) Materialize() *apiendpoint.APIEndpoint[*RetrievePickRequest, *apiresource.Pick]
type RetrievePickRequest ¶
type RetrievePickRequest struct {
// Pick ID.
PickID string `path:"id" validate:"required"`
}
Request to retrieve a pick.
type UpdatePickEndpoint ¶
type UpdatePickEndpoint struct{}
Partially updates a pick's metadata.
Only the fields provided in the request are changed. This endpoint edits the pick record itself; use the pick and pack actions to change what has actually been picked.
func (*UpdatePickEndpoint) Materialize ¶
func (e *UpdatePickEndpoint) Materialize() *apiendpoint.APIEndpoint[*UpdatePickRequest, *apiresource.Pick]
type UpdatePickLineEndpoint ¶
type UpdatePickLineEndpoint struct{}
Updates a pick line's picked quantity.
Use this to record a short or partial pick; Pick Pick Line fills in the full outstanding quantity instead.
func (*UpdatePickLineEndpoint) Materialize ¶
func (e *UpdatePickLineEndpoint) Materialize() *apiendpoint.APIEndpoint[*UpdatePickLineRequest, *apiresource.PickLine]
type UpdatePickLineRequest ¶
type UpdatePickLineRequest struct {
// Pick ID.
PickID string `path:"pick_id" validate:"required"`
// Pick line ID.
PickLineID string `path:"id" validate:"required"`
// New picked quantity for the line, as a decimal string read in the unit the sales order line was sold in, stored as given and not capped at the ordered quantity.
//
// Must not be negative. Pulling more than was ordered is a real floor event and is kept as recorded; pulling a negative amount is not.
QuantityValue field.Optional[string] `json:"quantity_value,omitzero" validate:"omitempty,decimal,gte=0" format:"decimal"`
}
Request to update a pick line's picked quantity.
func (*UpdatePickLineRequest) SchemaExample ¶
func (*UpdatePickLineRequest) SchemaExample() any
type UpdatePickRequest ¶
type UpdatePickRequest struct {
// Pick ID.
PickID string `path:"id" validate:"required"`
// New number to assign to the pick.
//
// Maximum 255 characters. Renaming a pick does not rename the sales order it was created from.
Number field.Optional[string] `json:"number,omitzero" validate:"omitempty,max=255"`
// Timestamp when the pick was finished, in RFC 3339 format.
//
// Setting it closes the pick out even if lines are still unpacked; send `null` to clear it and reopen the pick.
FinishedAt field.Clearable[string] `json:"finished_at,omitzero" validate:"omitempty,datetime=2006-01-02T15:04:05Z07:00"`
}
Request to partially update a pick's metadata.
func (*UpdatePickRequest) SchemaExample ¶
func (*UpdatePickRequest) SchemaExample() any
type VoidPickEndpoint ¶
type VoidPickEndpoint struct{}
Voids a pick, undoing all picking work recorded on it.
Resets the picked quantity on every unpacked line to zero and clears the pick's `finished_at` timestamp, so the pick starts over as open with nothing picked. The pick itself is not deleted, and the sales order is unaffected.
Returns a validation error if any shipment exists for the pick's sales order. Voiding those shipments is not enough — they must be deleted, since a voided shipment still exists.
func (*VoidPickEndpoint) Materialize ¶
func (e *VoidPickEndpoint) Materialize() *apiendpoint.APIEndpoint[*VoidPickRequest, *apiresource.Pick]
type VoidPickLineEndpoint ¶
type VoidPickLineEndpoint struct{}
Voids a pick line, undoing the picking work recorded on it.
Resets the line's picked quantity to zero without deleting the line, so the quantity can be picked again. Returns a validation error if the line has already been packed.
func (*VoidPickLineEndpoint) Materialize ¶
func (e *VoidPickLineEndpoint) Materialize() *apiendpoint.APIEndpoint[*VoidPickLineRequest, *apiresource.PickLine]
type VoidPickLineRequest ¶
type VoidPickLineRequest struct {
// Pick ID.
PickID string `path:"pick_id" validate:"required"`
// Pick line ID.
PickLineID string `path:"id" validate:"required"`
}
Request to void a pick line.
type VoidPickRequest ¶
type VoidPickRequest struct {
// Pick ID.
PickID string `path:"id" validate:"required"`
}
Request to void a pick.