operatingcalendarep

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOperatingCalendarClosureEndpoint

type CreateOperatingCalendarClosureEndpoint struct{}

Closes a calendar on a date.

Every ship-by date resolved against this calendar afterwards walks past the closure: a carrier that does not move on Thanksgiving pushes the day an order has to leave earlier, and a plant shutdown does the same.

Closing the same date twice is a no-op rather than an error, so re-seeding a year is safe and never renames a closure somebody has relabelled.

type CreateOperatingCalendarClosureRequest

type CreateOperatingCalendarClosureRequest struct {
	// Operating calendar ID.
	OperatingCalendarID string `path:"id" validate:"required"`
	// The date nothing operates. Truncated to a day.
	ClosedOn time.Time `json:"closed_on" validate:"required"`
	// What the closure is, such as "Thanksgiving Day" or "Summer shutdown".
	Name string `json:"name" validate:"required,max=255"`
}

Request to close a calendar on a date.

func (*CreateOperatingCalendarClosureRequest) SchemaExample

func (*CreateOperatingCalendarClosureRequest) SchemaExample() any

type CreateOperatingCalendarEndpoint

type CreateOperatingCalendarEndpoint struct{}

Creates an operating calendar.

The days govern every ship-by date resolved against this calendar: a plant that tenders freight Monday to Thursday never gets committed to a Friday shipment, and a customer's promised delivery date is worked back from a day they can actually receive on.

A calendar starts with no closures. Add holidays and shutdowns to it separately.

type CreateOperatingCalendarRequest

type CreateOperatingCalendarRequest struct {
	// Short stable identifier, unique per account.
	Code string `json:"code" validate:"required,max=32"`
	// Human-readable name.
	Name string `json:"name" validate:"required,max=255"`
	// Which side of a shipment this calendar describes.
	Kind constants.OperatingCalendarKind `json:"kind" validate:"required"`
	// Open weekdays as seven characters of '0' or '1', Monday first. "1111100" is Monday to Friday; "1111000" is a Monday-to-Thursday plant. At least one day must be open.
	DaysOfWeek string `json:"days_of_week" validate:"required,len=7"`
	// Local time freight has to be tendered by, as "15:00". Only a shipping calendar accepts one.
	CutoffAt field.Optional[string] `json:"cutoff_at,omitzero" validate:"omitempty,max=8"`
	// IANA zone the cutoff is read in, such as "America/Chicago". On a receiving calendar, leave it unset to take the zone from the ship-to address.
	Timezone field.Optional[string] `json:"timezone,omitzero" validate:"omitempty,max=64"`
	// Make this the calendar used when nothing more specific is linked. Setting it demotes whichever calendar of the same kind held the role.
	IsDefault field.Optional[bool] `json:"is_default,omitzero"`
}

Request to create an operating calendar.

func (*CreateOperatingCalendarRequest) SchemaExample

func (*CreateOperatingCalendarRequest) SchemaExample() any

type DeleteOperatingCalendarClosureEndpoint

type DeleteOperatingCalendarClosureEndpoint struct{}

Reopens a date the calendar was closed on.

Used to drop a seeded holiday a plant actually works through. Orders already issued keep the dates they were stamped with.

type DeleteOperatingCalendarClosureRequest

type DeleteOperatingCalendarClosureRequest struct {
	// Operating calendar ID.
	OperatingCalendarID string `path:"id" validate:"required"`
	// Closure ID.
	ClosureID string `path:"closure_id" validate:"required"`
}

Request to reopen a closed date.

type DeleteOperatingCalendarEndpoint

type DeleteOperatingCalendarEndpoint struct{}

Deletes an operating calendar.

Refused while any address, customer, customer group, or account setting still points at it. Deleting a calendar out from under its references would quietly return every affected order to a plain Monday-to-Friday week, which reads as the feature breaking rather than as a decision anybody made — so re-point them first.

type DeleteOperatingCalendarRequest

type DeleteOperatingCalendarRequest struct {
	// Operating calendar ID.
	OperatingCalendarID string `path:"id" validate:"required"`
}

Request to delete an operating calendar.

type ListOperatingCalendarClosuresEndpoint

type ListOperatingCalendarClosuresEndpoint struct{}

Lists the dates a calendar is shut, within a date window.

Bounded rather than exhaustive: a calendar accumulates closures indefinitely, and the useful answer is the year either side of today. Widen it with `from_date` and `to_date`.

type ListOperatingCalendarClosuresRequest

type ListOperatingCalendarClosuresRequest struct {
	// Operating calendar ID.
	OperatingCalendarID string `path:"id" validate:"required"`
	// Earliest closure date to return. Defaults to a year ago.
	FromDate *time.Time `query:"from_date" validate:"omitempty"`
	// Latest closure date to return. Defaults to a year ahead.
	ToDate *time.Time `query:"to_date" validate:"omitempty"`
}

Request to list a calendar's closures.

type ListOperatingCalendarsEndpoint

type ListOperatingCalendarsEndpoint struct{}

Lists the operating calendars configured for the account.

Both kinds are returned unless `kind` narrows it, ordered with each kind's default first.

type ListOperatingCalendarsRequest

type ListOperatingCalendarsRequest struct {
	// Return only shipping or only receiving calendars.
	Kind *constants.OperatingCalendarKind `query:"kind" validate:"omitempty"`
}

Request to list an account's operating calendars.

type OperatingCalendarSvcConfig

type OperatingCalendarSvcConfig struct {
	// CoreClient (required) is the core-service production-schedule gRPC client, which carries the calendar RPCs.
	CoreClient pb.CoreProductionScheduleServiceClient
}

type RetrieveOperatingCalendarEndpoint

type RetrieveOperatingCalendarEndpoint struct{}

Retrieves one operating calendar by ID.

type RetrieveOperatingCalendarRequest

type RetrieveOperatingCalendarRequest struct {
	// Operating calendar ID.
	OperatingCalendarID string `path:"id" validate:"required"`
}

Request to retrieve one operating calendar.

type UpdateOperatingCalendarEndpoint

type UpdateOperatingCalendarEndpoint struct{}

Updates an operating calendar.

A calendar's kind cannot change: a shipping calendar that became a receiving one would silently drop the pickup cutoff every commitment resolved against it depends on. Create a second calendar instead.

Changes apply to commitments made from now on. Orders already issued keep the dates they were stamped with, so adding a holiday never retroactively makes a past order late.

type UpdateOperatingCalendarRequest

type UpdateOperatingCalendarRequest struct {
	// Operating calendar ID.
	OperatingCalendarID string `path:"id" validate:"required"`
	// Human-readable name.
	Name field.Optional[string] `json:"name,omitzero" validate:"omitempty,max=255"`
	// Open weekdays as seven characters of '0' or '1', Monday first. At least one day must be open.
	DaysOfWeek field.Optional[string] `json:"days_of_week,omitzero" validate:"omitempty,len=7"`
	// Local time freight has to be tendered by. Clearing it leaves the ship-by date a day with no time of day attached.
	CutoffAt field.Clearable[string] `json:"cutoff_at,omitzero" validate:"omitempty,max=8"`
	// IANA zone the cutoff is read in. Clearing it on a receiving calendar returns to taking the zone from the ship-to address.
	Timezone field.Clearable[string] `json:"timezone,omitzero" validate:"omitempty,max=64"`
	// Make this the calendar used when nothing more specific is linked. Setting it demotes whichever calendar of the same kind held the role.
	IsDefault field.Optional[bool] `json:"is_default,omitzero"`
}

Request to update an operating calendar.

Jump to

Keyboard shortcuts

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