rateep

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateSvc

type RateSvc interface {
	UpdateRate(ctx context.Context, req *UpdateRateRequest) (*apiresource.Rate, *apierror.APIError)
}

func NewRateSvc

func NewRateSvc(config *RateSvcConfig) RateSvc

type RateSvcConfig

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

type UpdateRateEndpoint

type UpdateRateEndpoint struct{}

Updates the value or units of a rate in place.

A rate belongs to the resource that reports it — an item's unit price or cost, a department's labor rate, and so on — so this changes that resource's stored rate directly.

func (*UpdateRateEndpoint) Materialize

type UpdateRateRequest

type UpdateRateRequest struct {
	// Rate ID.
	RateID string `path:"id" validate:"required"`
	// New decimal value for the rate, expressed as the amount of the numerator unit per one denominator unit.
	Value field.Optional[string] `json:"value,omitzero"`
	// ID of the new unit for the rate's numerator (e.g. the currency of a price).
	//
	// The stored value is kept as-is and is not converted into the new unit, so send `value` alongside this when the amount should change too.
	NumeratorUnitID field.Optional[string] `json:"numerator_unit_id,omitzero" validate:"omitempty"`
	// ID of the new unit for the rate's denominator (the per-unit basis).
	//
	// As with the numerator, the value is not re-scaled when the unit changes.
	DenominatorUnitID field.Optional[string] `json:"denominator_unit_id,omitzero" validate:"omitempty"`
	// ID of the resource that owns this rate.
	//
	// Used together with `object_type` to verify the owning resource exists; it does not reassign the rate.
	ObjectID field.Optional[string] `json:"object_id,omitzero" validate:"omitempty"`
	// Type of the resource that owns this rate.
	//
	// Determines the permission required for the update. Must be `item`, `production_step`, or `department`.
	ObjectType field.Optional[string] `json:"object_type,omitzero" validate:"omitempty,max=255"`
}

Request to partially update a rate.

func (*UpdateRateRequest) SchemaExample

func (*UpdateRateRequest) SchemaExample() any

Jump to

Keyboard shortcuts

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