Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListMachineStatusEndpoint ¶
type ListMachineStatusEndpoint struct{}
Returns what every machine is running right now, how much is left on it, and what is queued behind that.
The whole floor comes back in one response rather than a page at a time, so a wall display can render it in a single call.
Assembled from the published schedule, the batches the floor has scanned against each campaign, and any open downtime. A campaign is `current` once its week is released and while it still has batches to scan; when the last one is scanned it hands over to the next, so this advances on its own as a shift progresses.
A machine with an open stoppage reads `down` even when it has a released campaign, because a broken machine is not producing whatever the plan says. A machine with nothing released reads `idle`, which is a state worth seeing rather than an absence from the list.
Reads the published version rather than the newest draft: the floor works to what was committed, and a draft regenerating underneath a wall display would make machines appear to change job on their own. With nothing published every machine reads idle rather than the request failing.
func (*ListMachineStatusEndpoint) Materialize ¶
func (e *ListMachineStatusEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListMachineStatusRequest, *apiresource.List[apiresource.MachineStatus]]
type ListMachineStatusRequest ¶
type ListMachineStatusRequest struct {
// Only include machines in these departments.
DepartmentIDs []string `query:"department_ids"`
// The moment to read the floor at.
//
// Chooses the week the campaigns are read for, and the published schedule whose horizon covers that moment; open downtime and scan progress are always read as they stand now. Omit it to read the floor as it is at this instant.
AsOf *time.Time `query:"as_of"`
}
Request for the state of the floor.
type MachineStatusSvc ¶
type MachineStatusSvc interface {
ListMachineStatus(ctx context.Context, req *ListMachineStatusRequest) (*apiresource.List[apiresource.MachineStatus], *apierror.APIError)
}
func NewMachineStatusSvc ¶
func NewMachineStatusSvc(cfg *MachineStatusSvcConfig) MachineStatusSvc
type MachineStatusSvcConfig ¶
type MachineStatusSvcConfig struct {
// CoreClient (required) is the core-service fulfillment gRPC client.
CoreClient pb.CoreFulfillmentServiceClient
}