handlers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package handlers contains HTTP handlers for the core module of nutrix.

The handlers in this package are used to handle incoming HTTP requests for the core module of nutrix. The handlers are used to interact with the services package, which contains the business logic of the core module.

The handlers in this package are used to create a RESTful API for the core module of nutrix. The API endpoints are documented using the Swagger specification.

Package handlers contains HTTP handlers for the core module of nutrix.

The handlers in this package are used to handle incoming HTTP requests for the core module of nutrix. They interact with the services package, which contains the business logic of the core module.

The handlers in this package create a RESTful API for the core module of nutrix. The API endpoints are documented using the Swagger specification. Each handler function is responsible for processing HTTP requests, calling the appropriate service methods, and returning HTTP responses.

Package handlers contains HTTP handlers for the core module of nutrix.

The handlers in this package are used to handle incoming HTTP requests for the core module of nutrix. The handlers are used to interact with the services package, which contains the business logic of the core module.

The handlers in this package are used to create a RESTful API for the core module of nutrix. The API endpoints are documented using the Swagger specification.

Package handlers contains HTTP handlers for the core module of nutrix.

The handlers in this package are used to handle incoming HTTP requests for the core module of nutrix. The handlers are used to interact with the services package, which contains the business logic of the core module.

The handlers in this package are used to create a RESTful API for the core module of nutrix. The API endpoints are documented using the Swagger specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMaterial

func AddMaterial(config config.Config, logger logger.ILogger) http.HandlerFunc

AddMaterial returns a HTTP handler function to add a new material to the database.

func CalculateMaterialCost

func CalculateMaterialCost(config config.Config, logger logger.ILogger) http.HandlerFunc

CalculateMaterialCost returns a HTTP handler function to calculate the cost of a material entry.

This handler retrieves the entry ID, material ID, and quantity from the query string, and uses the MaterialService to calculate and return the cost.

func CancelOrder

func CancelOrder(config config.Config, logger logger.ILogger) http.HandlerFunc

CancelOrder returns a HTTP handler function to cancel an order.

func DeleteCategory

func DeleteCategory(config config.Config, logger logger.ILogger) http.HandlerFunc

DeleteCategory returns a HTTP handler function to delete a Category from the database.

func DeleteEntry

func DeleteEntry(config config.Config, logger logger.ILogger) http.HandlerFunc

DeleteEntry returns a HTTP handler function to delete an entry in the material database.

func DeleteProduct

func DeleteProduct(config config.Config, logger logger.ILogger) http.HandlerFunc

DeleteProduct returns a HTTP handler function to delete a product from the database.

func EditMaterial

func EditMaterial(config config.Config, logger logger.ILogger) http.HandlerFunc

EditMaterial returns a HTTP handler function to edit an existing material in the database.

func FinishOrder

func FinishOrder(config config.Config, logger logger.ILogger) http.HandlerFunc

FinishOrder returns a HTTP handler function to finish an order.

func GetCategories

func GetCategories(config config.Config, logger logger.ILogger) http.HandlerFunc

GetCategories returns a HTTP handler function to retrieve a list of Categories from the database.

func GetMaterialLogs

func GetMaterialLogs(config config.Config, logger logger.ILogger) http.HandlerFunc

GetMaterialLogs returns a HTTP handler function to retrieve a list of logs for a material.

func GetMaterials

func GetMaterials(config config.Config, logger logger.ILogger) http.HandlerFunc

GetMaterials returns a HTTP handler function to retrieve a list of materials from the database.

func GetOrder

func GetOrder(config config.Config, logger logger.ILogger) http.HandlerFunc

GetOrder returns a HTTP handler function to retrieve an order.

func GetOrders

func GetOrders(config config.Config, logger logger.ILogger) http.HandlerFunc

GetOrders returns a HTTP handler function to retrieve a list of orders. to use pagination, send a "first" and "rows" query string to select all rows, send a "rows" query string with value -1 to filter for orders that contains a specific display_id, just send a display_id query string

func GetProductReadyNumber

func GetProductReadyNumber(config config.Config, logger logger.ILogger) http.HandlerFunc

GetProductReadyNumber returns a HTTP handler function to retrieve the ready number for a product. The product ID is required as query string.

func GetProducts

func GetProducts(config config.Config, logger logger.ILogger) http.HandlerFunc

GetProducts returns a HTTP handler function to retrieve a list of products from the database. It requires two query string parameters: first_index: the index of the first product to be retrieved rows: the number of products to be retrieved

func GetRecipeAvailability

func GetRecipeAvailability(config config.Config, logger logger.ILogger) http.HandlerFunc

GetRecipeAvailability returns a HTTP handler function to check the availability of multiple recipes. The recipe IDs are required as query string, comma separated.

func GetRecipeTree

func GetRecipeTree(config config.Config, logger logger.ILogger) http.HandlerFunc

GetRecipeTree returns a HTTP handler function to retrieve a recipe tree. The recipe ID is required as query string.

func GetSalesLog

func GetSalesLog(config config.Config, logger logger.ILogger) http.HandlerFunc

GetSalesLog returns a HTTP handler function to retrieve a sales log.

func GetSalesPerDay

func GetSalesPerDay(config config.Config, logger logger.ILogger) http.HandlerFunc

GetSalesPerDay returns a HTTP handler function to retrieve sales data per day. It requires two query string parameters: first_index: the index of the first record to be retrieved rows: the number of records to be retrieved

func GetSettings

func GetSettings(conf config.Config, logger logger.ILogger) http.HandlerFunc

GetSettings is an http get handlers that just returns the settings object from the db

func GetStashedOrders

func GetStashedOrders(config config.Config, logger logger.ILogger) http.HandlerFunc

GetStashedOrders returns a HTTP handler function to get all orders in stash.

func GetUnpaidOrders

func GetUnpaidOrders(config config.Config, logger logger.ILogger) http.HandlerFunc

GetUnpaidOrders returns a HTTP handler function to get all unpaid orders.

func HandleNotificationsWsRequest

func HandleNotificationsWsRequest(config config.Config, logger logger.ILogger, notificationService services.INotificationService) http.HandlerFunc

HandleNotificationsWsRequest returns a HTTP handler function to handle WebSocket requests.

The function takes a configuration object, a logger object, and a INotificationService object as input. It returns a HTTP handler function that handles WebSocket requests.

func InesrtNewProduct

func InesrtNewProduct(config config.Config, logger logger.ILogger) http.HandlerFunc

InesrtNewProduct returns a HTTP handler function to insert a new product in the database.

func InsertCategory

func InsertCategory(config config.Config, logger logger.ILogger) http.HandlerFunc

InsertCategory returns a HTTP handler function to insert a Category into the database.

func OrderRemoveFromStash

func OrderRemoveFromStash(config config.Config, logger logger.ILogger) http.HandlerFunc

OrderRemoveFromStash returns a HTTP handler function to remove an order from the stash.

func OrderStash

func OrderStash(config config.Config, logger logger.ILogger) http.HandlerFunc

OrderStash returns a HTTP handler function to stash an order.

func PayUnpaidOrder

func PayUnpaidOrder(config config.Config, logger logger.ILogger) http.HandlerFunc

PayUnpaidOrder returns a HTTP handler function to pay an unpaid order.

func PushMaterialEntry

func PushMaterialEntry(config config.Config, logger logger.ILogger) http.HandlerFunc

PushMaterialEntry returns a HTTP handler function to add a new entry to a material in the database.

func StartOrder

func StartOrder(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc

StartOrder returns a HTTP handler function to start an order.

func SubmitOrder

func SubmitOrder(config config.Config, logger logger.ILogger) http.HandlerFunc

SubmitOrder returns a HTTP handler function to submit an order.

func UpdateCategory

func UpdateCategory(config config.Config, logger logger.ILogger) http.HandlerFunc

UpdateCategory returns a HTTP handler function to update a Category in the database.

func UpdateProduct

func UpdateProduct(config config.Config, logger logger.ILogger) http.HandlerFunc

UpdateProduct returns a HTTP handler function to update a product in the database.

func UpdateSettings

func UpdateSettings(conf config.Config, logger logger.ILogger) http.HandlerFunc

UpdateSettings is a post request handler that updates the settings in the database send a models.Settings directory to body to use it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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