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.
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 ¶
Constants ¶
const ( DTOOrderItemRefundDestination_Inventory = "inventory" DTOOrderItemRefundDestination_Disposals = "disposals" DTOOrderItemRefundDestination_Waste = "waste" DTOOrderItemRefundDestination_Custom = "custom" )
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 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 OrderItemRefundMaterialDTO ¶ added in v0.0.14
type OrderItemRefundProductAddDTO ¶ added in v0.0.14
type OrderItemRefundRequest ¶ added in v0.0.14
type OrderItemRefundRequest struct {
	OrderId         string                         `json:"order_id" bson:"order_id"`
	ItemId          string                         `json:"order_item_id" bson:"order_item_id"`
	ProductId       string                         `json:"product_id" bson:"product_id"`
	Reason          string                         `json:"reason" bons:"reason"`
	RefundValue     float64                        `json:"refund_value"`
	Destination     string                         `json:"destination" bson:"destination"`
	MaterialRefunds []OrderItemRefundMaterialDTO   `json:"material_refunds"`
	ProductAdd      []OrderItemRefundProductAddDTO `json:"products_add"`
}
    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.