Documentation
¶
Index ¶
- type AdminUpdateShippingCaseTrackingEndpoint
- type AdminUpdateShippingCaseTrackingRequest
- type DeleteShippingCaseEndpoint
- type DeleteShippingCaseRequest
- type GetShippingCaseLabelEndpoint
- type GetShippingCaseLabelRequest
- type RetrieveShippingCaseEndpoint
- type RetrieveShippingCaseRequest
- type ShippingCaseSvc
- type ShippingCaseSvcConfig
- type UpdateShippingCaseEndpoint
- type UpdateShippingCaseRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminUpdateShippingCaseTrackingEndpoint ¶
type AdminUpdateShippingCaseTrackingEndpoint struct{}
Rewrites the tracking number of a shipping case that has already shipped. Administrators only: it is the deliberate override for a case dispatched under the wrong number, and it rejects a case that has not shipped yet.
func (*AdminUpdateShippingCaseTrackingEndpoint) Materialize ¶
func (e *AdminUpdateShippingCaseTrackingEndpoint) Materialize() *apiendpoint.APIEndpoint[*AdminUpdateShippingCaseTrackingRequest, *apiresource.ShippingCase]
type AdminUpdateShippingCaseTrackingRequest ¶
type AdminUpdateShippingCaseTrackingRequest struct {
// Shipping case ID.
ShippingCaseID string `path:"id" validate:"required"`
// Carrier tracking number the case actually travelled under, replacing any number already recorded.
TrackingNumber field.Optional[string] `json:"tracking_number,omitzero" validate:"omitempty,max=255"`
}
! separate endpoint due to SDK type resttrictions Request to correct a shipped shipping case's tracking number.
func (*AdminUpdateShippingCaseTrackingRequest) SchemaExample ¶
func (*AdminUpdateShippingCaseTrackingRequest) SchemaExample() any
type DeleteShippingCaseEndpoint ¶
type DeleteShippingCaseEndpoint struct{}
Permanently deletes a shipping case.
Only the case is removed; its shipment, the shipment's lines, and the shipment's other cases are left untouched. Deleting a case that has already been deleted returns an error rather than succeeding again.
func (*DeleteShippingCaseEndpoint) Materialize ¶
func (e *DeleteShippingCaseEndpoint) Materialize() *apiendpoint.APIEndpoint[*DeleteShippingCaseRequest, *apiresource.EmptyResource]
type DeleteShippingCaseRequest ¶
type DeleteShippingCaseRequest struct {
// Shipping case ID.
ShippingCaseID string `path:"id" validate:"required"`
}
Request to delete a shipping case.
type GetShippingCaseLabelEndpoint ¶
type GetShippingCaseLabelEndpoint struct{}
Returns a temporary download link for the shipping case's label image.
The link expires one hour after it is issued, so fetch it when the label is about to be printed rather than storing it. No link is returned until a label has been generated for the case.
func (*GetShippingCaseLabelEndpoint) Materialize ¶
func (e *GetShippingCaseLabelEndpoint) Materialize() *apiendpoint.APIEndpoint[*GetShippingCaseLabelRequest, *apiresource.ShippingCaseLabelURL]
type GetShippingCaseLabelRequest ¶
type GetShippingCaseLabelRequest struct {
// Shipping case ID.
ShippingCaseID string `path:"id" validate:"required"`
}
Request to retrieve a shipping case label URL.
type RetrieveShippingCaseEndpoint ¶
type RetrieveShippingCaseEndpoint struct{}
Returns a shipping case by ID.
func (*RetrieveShippingCaseEndpoint) Materialize ¶
func (e *RetrieveShippingCaseEndpoint) Materialize() *apiendpoint.APIEndpoint[*RetrieveShippingCaseRequest, *apiresource.ShippingCase]
type RetrieveShippingCaseRequest ¶
type RetrieveShippingCaseRequest struct {
// Shipping case ID.
ShippingCaseID string `path:"id" validate:"required"`
}
Request to retrieve a shipping case by ID.
type ShippingCaseSvc ¶
type ShippingCaseSvc interface {
GetShippingCase(ctx context.Context, req *RetrieveShippingCaseRequest) (*apiresource.ShippingCase, *apierror.APIError)
UpdateShippingCase(ctx context.Context, req *UpdateShippingCaseRequest) (*apiresource.ShippingCase, *apierror.APIError)
AdminUpdateShippingCaseTracking(ctx context.Context, req *AdminUpdateShippingCaseTrackingRequest) (*apiresource.ShippingCase, *apierror.APIError)
DeleteShippingCase(ctx context.Context, req *DeleteShippingCaseRequest) (*apiresource.EmptyResource, *apierror.APIError)
GetShippingCaseLabel(ctx context.Context, req *GetShippingCaseLabelRequest) (*apiresource.ShippingCaseLabelURL, *apierror.APIError)
}
func NewShippingCaseSvc ¶
func NewShippingCaseSvc(config *ShippingCaseSvcConfig) ShippingCaseSvc
type ShippingCaseSvcConfig ¶
type ShippingCaseSvcConfig struct {
// CoreClient (required) is the core-service shipping-case gRPC client.
CoreClient pb.CoreShippingCaseServiceClient
}
type UpdateShippingCaseEndpoint ¶
type UpdateShippingCaseEndpoint struct{}
Partially updates a shipping case's tracking number and freight quantities.
Fields left out of the request keep their current values. The freight cost and weight recorded here are the case's own actual charge and weight; they do not change the freight billed on the sales order.
func (*UpdateShippingCaseEndpoint) Materialize ¶
func (e *UpdateShippingCaseEndpoint) Materialize() *apiendpoint.APIEndpoint[*UpdateShippingCaseRequest, *apiresource.ShippingCase]
type UpdateShippingCaseRequest ¶
type UpdateShippingCaseRequest struct {
// Shipping case ID.
ShippingCaseID string `path:"id" validate:"required"`
// Carrier tracking number to set on the case, replacing any number already recorded.
TrackingNumber field.Optional[string] `json:"tracking_number,omitzero" validate:"omitempty,max=255"`
// New value for the case's freight cost, as a decimal string.
FreightAmountValue field.Optional[string] `json:"freight_amount_value,omitzero"`
// ID of the currency unit the case's freight cost is expressed in.
//
// Changing the unit relabels the stored freight cost; the number itself is never converted, so send `freight_amount_value` alongside it when the amount should change too.
FreightAmountUnitID field.Optional[string] `json:"freight_amount_unit_id,omitzero" validate:"omitempty"`
// New value for the case's freight weight, as a decimal string.
FreightWeightValue field.Optional[string] `json:"freight_weight_value,omitzero"`
// ID of the unit the case's freight weight is expressed in.
//
// Changing the unit relabels the stored weight; the number itself is never converted, so send `freight_weight_value` alongside it when the weight should change too.
FreightWeightUnitID field.Optional[string] `json:"freight_weight_unit_id,omitzero" validate:"omitempty"`
}
Request to update a shipping case.
func (*UpdateShippingCaseRequest) SchemaExample ¶
func (*UpdateShippingCaseRequest) SchemaExample() any