Documentation
¶
Overview ¶
Package dto contains structs for data transfer objects (DTOs) used in the core module of nutrix.
Package dto contains Data Transfer Objects (DTOs) which are used to transfer data between application components. It is usually used for client-server communication.
Package dto contains structs for data transfer objects (DTOs) used in the core module of nutrix.
Package dto contains all the data transfer objects that are used in the API. These struct will be used to unmarshal json data from the request body and return data to the client.
RecipeAvailability is a DTO containing the id of a recipe and the availability of that recipe. The availability is a sum of the available and ready quantity. The component requirements are also included in this DTO.
Index ¶
- type ComponentQuantity
- type FinishOrderRequest
- type GetComponentConsumeLogsRequest
- type HttpComponent
- type MaterialEditRequest
- type Order
- type OrderItem
- type OrderRemoveStashRequest
- type OrderStartRequest
- type OrderStartRequestIngredient
- type OrderStashRequest
- type OrderStashResponse
- type RecipeAvailability
- type RequestComponentEntryAdd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentQuantity ¶
type ComponentQuantity struct {
ComponentId string `json:"component_id"` // The ID of the component.
Quantity float64 `json:"quantity"` // The quantity of the component.
}
ComponentQuantity is a DTO containing the ID of a component and the quantity of this component.
type FinishOrderRequest ¶
type FinishOrderRequest struct {
Id string `json:"order_id"`
}
FinishOrderRequest is a DTO used in the request body in the POST /order/finish endpoint. It contains the order id.
type GetComponentConsumeLogsRequest ¶
type GetComponentConsumeLogsRequest struct {
Name string `json:"name"`
}
GetComponentConsumeLogsRequest is a DTO used in the request body in the GET /material/consume_logs endpoint. It contains the material name.
type HttpComponent ¶
type HttpComponent struct {
Name string `json:"name"`
Unit string `json:"unit"`
Quantity float32 `json:"quantity"`
Company string `json:"company"`
}
HttpComponent is a DTO containing the most important information about Material. It is used to return data from the API to the client.
type MaterialEditRequest ¶
MaterialEditRequest is a DTO used for editing material details.
type Order ¶
type Order struct {
models.Order `bson:",inline"`
Ingredients [][]OrderStartRequestIngredient `json:"ingredients"`
}
Order is a DTO used to return data from the API to the client. It contains the ingredients and the order information.
type OrderItem ¶
type OrderItem struct {
Name string `json:"name"`
Components []HttpComponent `json:"components"`
}
OrderItem is a DTO containing the most important information about OrderItem. It is used to return data from the API to the client.
type OrderRemoveStashRequest ¶
type OrderRemoveStashRequest struct {
OrderDisplayId string `json:"order_display_id"`
}
OrderRemoveStashRequest is a DTO used in the request body in the POST /order/remove_stash endpoint. It contains the order display id to remove from stash.
type OrderStartRequest ¶
type OrderStartRequest struct {
Id string `json:"order_id"`
Items []models.OrderItem `json:"items"`
}
OrderStartRequest is a DTO used in the request body in the POST /order/start endpoint. It contains the order id and the items to start.
type OrderStartRequestIngredient ¶
type OrderStartRequestIngredient struct {
ComponentId string `json:"component_id" bson:"component_id"`
EntryId string `json:"entry_id" bson:"entry_id"`
Name string `json:"name"`
Quantity float32 `json:"quantity"`
Company string `json:"company"`
}
OrderStartRequestIngredient is a DTO used in the request body in the POST /order/start endpoint. It contains the information about the component, entry and quantity.
type OrderStashRequest ¶
OrderStashRequest is a DTO used in the request body in the POST /order/stash endpoint. It contains the order to stash.
type OrderStashResponse ¶
OrderStashResponse is a DTO used in the response body in the POST /order/stash endpoint. It contains the stashed order.
type RecipeAvailability ¶
type RecipeAvailability struct {
RecipeId string `json:"recipe_id"`
Available float64 `json:"available"`
Ready float64 `json:"ready"`
ComponentRequirements map[string]float64 `json:"component_requirements"`
}
RecipeAvailability is a DTO containing the id of a recipe and the availability of that recipe. The availability is a sum of the available and ready quantity. The component requirements are also included in this DTO.
The component requirements are a map of component id to the required quantity.
type RequestComponentEntryAdd ¶
type RequestComponentEntryAdd struct {
ComponentId string `json:"component_id"`
Entries []models.MaterialEntry `json:"entries"`
}
RequestComponentEntryAdd is a DTO used in the request body in the POST /material/entry endpoint. It contains the component id and the entries.