Documentation
¶
Index ¶
- type GetLatestSysPropertyValueEndpoint
- type GetLatestSysPropertyValueRequest
- type ListSysPropertiesEndpoint
- type ListSysPropertiesRequest
- type RetrieveSysPropertyEndpoint
- type RetrieveSysPropertyRequest
- type SysPropertySvc
- type SysPropertySvcConfig
- type UpdateSysPropertyEndpoint
- type UpdateSysPropertyRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetLatestSysPropertyValueEndpoint ¶
type GetLatestSysPropertyValueEndpoint struct{}
Returns the next available counter value for a system property type.
Initializes the counter at `1` if it does not yet exist for the account. If the current value is already used by an existing record (for example, a transaction with that number), the counter is incremented before the value is returned. The `sscc_count` counter is returned as-is, without a duplicate check.
func (*GetLatestSysPropertyValueEndpoint) Materialize ¶
func (e *GetLatestSysPropertyValueEndpoint) Materialize() *apiendpoint.APIEndpoint[*GetLatestSysPropertyValueRequest, *apiresource.SysPropertyValue]
type GetLatestSysPropertyValueRequest ¶
type GetLatestSysPropertyValueRequest struct {
// Code identifying which number series to read.
//
// - `transaction_number`: numbering for financial transactions such as payments, credit memos, adjustments, and rebates.
// - `settlement_number`: numbering for settlements that apply transactions to invoices.
// - `sales_order_number`: numbering for sales orders.
// - `purchase_order_number`: numbering for purchase orders.
// - `customer_number`: identifiers assigned to new customers.
// - `supplier_number`: identifiers assigned to new suppliers.
// - `production_run_number`: numbering for production runs.
// - `sscc_count`: serial component of the GS1 SSCC-18 codes assigned to shipping cases.
TypeCode constants.SysPropertyTypeCode `path:"type_code" validate:"required"`
}
Request to get the latest value for a system property type.
type ListSysPropertiesEndpoint ¶
type ListSysPropertiesEndpoint struct{}
Returns a paginated list of system properties for the current account.
A counter appears here only once its number series has been used at least once, so an account may have fewer counters than there are counter types. The `q` search term is matched against the counter type name.
func (*ListSysPropertiesEndpoint) Materialize ¶
func (e *ListSysPropertiesEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListSysPropertiesRequest, *apiresource.List[apiresource.SysProperty]]
type ListSysPropertiesRequest ¶
type ListSysPropertiesRequest struct {
apiresource.PaginationRequest
}
Request to list system properties.
type RetrieveSysPropertyEndpoint ¶
type RetrieveSysPropertyEndpoint struct{}
Returns a system property by ID.
func (*RetrieveSysPropertyEndpoint) Materialize ¶
func (e *RetrieveSysPropertyEndpoint) Materialize() *apiendpoint.APIEndpoint[*RetrieveSysPropertyRequest, *apiresource.SysProperty]
type RetrieveSysPropertyRequest ¶
type RetrieveSysPropertyRequest struct {
// System property ID.
SysPropertyID string `path:"id" validate:"required"`
}
Request to retrieve a system property by ID.
type SysPropertySvc ¶
type SysPropertySvc interface {
ListSysProperties(ctx context.Context, req *ListSysPropertiesRequest) (*apiresource.List[apiresource.SysProperty], *apierror.APIError)
GetSysProperty(ctx context.Context, req *RetrieveSysPropertyRequest) (*apiresource.SysProperty, *apierror.APIError)
UpdateSysProperty(ctx context.Context, req *UpdateSysPropertyRequest) (*apiresource.SysProperty, *apierror.APIError)
GetLatestSysPropertyValue(ctx context.Context, req *GetLatestSysPropertyValueRequest) (*apiresource.SysPropertyValue, *apierror.APIError)
}
func NewSysPropertySvc ¶
func NewSysPropertySvc(config *SysPropertySvcConfig) SysPropertySvc
type SysPropertySvcConfig ¶
type SysPropertySvcConfig struct {
// CoreClient (required) is the core-service gRPC client.
CoreClient pb.CoreServiceClient
}
type UpdateSysPropertyEndpoint ¶
type UpdateSysPropertyEndpoint struct{}
Overrides the value of a system property counter.
Use this to restart or realign a number series, for example to continue the numbering used in a previous system. Records that already carry a number keep it; only the numbers handed out from now on are affected.
func (*UpdateSysPropertyEndpoint) Materialize ¶
func (e *UpdateSysPropertyEndpoint) Materialize() *apiendpoint.APIEndpoint[*UpdateSysPropertyRequest, *apiresource.SysProperty]
type UpdateSysPropertyRequest ¶
type UpdateSysPropertyRequest struct {
// System property ID.
SysPropertyID string `path:"id" validate:"required"`
// The number to move the counter to, so the series carries on from there.
Value field.Optional[int32] `json:"value,omitzero"`
}
Request to update a system property.
func (*UpdateSysPropertyRequest) SchemaExample ¶
func (*UpdateSysPropertyRequest) SchemaExample() any