handlers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: GPL-2.0 Imports: 18 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. 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCustomer

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

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 DeleteCustomer

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

func DeleteDisposal added in v0.0.14

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

DeleteDisposal returns a HTTP handler function to delete a disposal 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 DeleteMaterial

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

func DeleteOrder

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

DeleteOrder an http handler to delete an order resource

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 GetAvailableLanguages

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

GetAvailableLanguages reads available language files in the /assets/core/languages folder it reads the language code and name from the file and returns json response of available installed langs

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 GetCustomer

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

func GetCustomers

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

func GetDisposal added in v0.0.14

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

func GetDisposals added in v0.0.14

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

GetDisposals returns a HTTP handler function to retrieve a list of disposals from the database.

func GetLanguage

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

GetLanguage is an http handler that receives a lang code like "en" or "ar" and reads the related language pack json file and return it as response.

func GetMaterialLogs

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

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 GetOrderLogs added in v0.0.14

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

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 GetProduct

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

GetProduct gets a single product from the db

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 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 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 InsertDisposal added in v0.0.14

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

InsertDisposal returns a HTTP handler function to insert a new disposal in the database.

func Payorder

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

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

func PrintClientReceipt

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

func PrintKitchenReceipt

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

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 RefundOrderItem added in v0.0.14

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

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, settings models.Settings) 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 UpdateCustomer

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

func UpdateDisposal added in v0.0.14

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

UpdateDisposal returns a HTTP handler function to update a disposal 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 UpdateProductImage

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

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.

func WasteOrderItem added in v0.0.14

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

Types

type JSONAPIMeta

type JSONAPIMeta struct {
	TotalRecords int `json:"total_records"`
	PageNumber   int `json:"page_number"`
	PageSize     int `json:"page_size"`
	PageCount    int `json:"page_count"`
}

type JSONApiOkResponse

type JSONApiOkResponse struct {
	Data interface{} `json:"data"`
	Meta JSONAPIMeta `json:"meta"`
}

Jump to

Keyboard shortcuts

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