dto

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: GPL-2.0 Imports: 1 Imported by: 0

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

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 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 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 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 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.

Jump to

Keyboard shortcuts

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