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 ¶
- func AddCustomer(config config.Config, logger logger.ILogger) http.HandlerFunc
- func AddMaterial(config config.Config, logger logger.ILogger) http.HandlerFunc
- func CalculateMaterialCost(config config.Config, logger logger.ILogger) http.HandlerFunc
- func CancelOrder(config config.Config, logger logger.ILogger) http.HandlerFunc
- func DeleteCategory(config config.Config, logger logger.ILogger) http.HandlerFunc
- func DeleteCustomer(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func DeleteDisposal(config config.Config, logger logger.ILogger) http.HandlerFunc
- func DeleteEntry(config config.Config, logger logger.ILogger) http.HandlerFunc
- func DeleteMaterial(config config.Config, logger logger.ILogger) http.HandlerFunc
- func DeleteOrder(config config.Config, logger logger.ILogger) http.HandlerFunc
- func DeleteProduct(config config.Config, logger logger.ILogger) http.HandlerFunc
- func EditMaterial(config config.Config, logger logger.ILogger) http.HandlerFunc
- func FinishOrder(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetAvailableLanguages(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetCategories(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetCustomer(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetCustomers(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func GetDisposal(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetDisposals(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetLanguage(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetMaterialLogs(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetMaterials(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetOrder(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetOrderLogs(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func GetOrders(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetProduct(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetProducts(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetRecipeAvailability(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetRecipeTree(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetSalesPerDay(config config.Config, logger logger.ILogger) http.HandlerFunc
- func GetSettings(conf config.Config, logger logger.ILogger) http.HandlerFunc
- func GetUnpaidOrders(config config.Config, logger logger.ILogger) http.HandlerFunc
- func HandleNotificationsWsRequest(config config.Config, logger logger.ILogger, ...) http.HandlerFunc
- func InesrtNewProduct(config config.Config, logger logger.ILogger) http.HandlerFunc
- func InsertCategory(config config.Config, logger logger.ILogger) http.HandlerFunc
- func InsertDisposal(config config.Config, logger logger.ILogger) http.HandlerFunc
- func Payorder(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func PrintClientReceipt(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func PrintKitchenReceipt(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func PushMaterialEntry(config config.Config, logger logger.ILogger) http.HandlerFunc
- func RefundOrderItem(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func StartOrder(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func SubmitOrder(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- func UpdateCategory(config config.Config, logger logger.ILogger) http.HandlerFunc
- func UpdateCustomer(config config.Config, logger logger.ILogger) http.HandlerFunc
- func UpdateDisposal(config config.Config, logger logger.ILogger) http.HandlerFunc
- func UpdateProduct(config config.Config, logger logger.ILogger) http.HandlerFunc
- func UpdateProductImage(config config.Config, logger logger.ILogger) http.HandlerFunc
- func UpdateSettings(conf config.Config, logger logger.ILogger) http.HandlerFunc
- func WasteOrderItem(config config.Config, logger logger.ILogger, settings models.Settings) http.HandlerFunc
- type JSONAPIMeta
- type JSONApiOkResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCustomer ¶
func AddMaterial ¶
AddMaterial returns a HTTP handler function to add a new material to the database.
func CalculateMaterialCost ¶
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 ¶
CancelOrder returns a HTTP handler function to cancel an order.
func DeleteCategory ¶
DeleteCategory returns a HTTP handler function to delete a Category from the database.
func DeleteCustomer ¶
func DeleteDisposal ¶ added in v0.0.14
DeleteDisposal returns a HTTP handler function to delete a disposal from the database.
func DeleteEntry ¶
DeleteEntry returns a HTTP handler function to delete an entry in the material database.
func DeleteMaterial ¶
func DeleteOrder ¶
DeleteOrder an http handler to delete an order resource
func DeleteProduct ¶
DeleteProduct returns a HTTP handler function to delete a product from the database.
func EditMaterial ¶
EditMaterial returns a HTTP handler function to edit an existing material in the database.
func FinishOrder ¶
FinishOrder returns a HTTP handler function to finish an order.
func GetAvailableLanguages ¶
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 ¶
GetCategories returns a HTTP handler function to retrieve a list of Categories from the database.
func GetCustomer ¶
func GetCustomers ¶
func GetDisposal ¶ added in v0.0.14
func GetDisposals ¶ added in v0.0.14
GetDisposals returns a HTTP handler function to retrieve a list of disposals from the database.
func GetLanguage ¶
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 GetMaterials ¶
GetMaterials returns a HTTP handler function to retrieve a list of materials from the database.
func GetOrderLogs ¶ added in v0.0.14
func GetOrders ¶
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 ¶
GetProduct gets a single product from the db
func GetProducts ¶
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 ¶
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 ¶
GetRecipeTree returns a HTTP handler function to retrieve a recipe tree. The recipe ID is required as query string.
func GetSalesPerDay ¶
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 ¶
GetSettings is an http get handlers that just returns the settings object from the db
func GetUnpaidOrders ¶
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 ¶
InesrtNewProduct returns a HTTP handler function to insert a new product in the database.
func InsertCategory ¶
InsertCategory returns a HTTP handler function to insert a Category into the database.
func InsertDisposal ¶ added in v0.0.14
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 PrintKitchenReceipt ¶
func PushMaterialEntry ¶
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 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 ¶
UpdateCategory returns a HTTP handler function to update a Category in the database.
func UpdateCustomer ¶
func UpdateDisposal ¶ added in v0.0.14
UpdateDisposal returns a HTTP handler function to update a disposal in the database.
func UpdateProduct ¶
UpdateProduct returns a HTTP handler function to update a product in the database.
func UpdateProductImage ¶
func UpdateSettings ¶
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
Types ¶
type JSONAPIMeta ¶
type JSONApiOkResponse ¶
type JSONApiOkResponse struct { Data interface{} `json:"data"` Meta JSONAPIMeta `json:"meta"` }