controllers

package
v0.0.0-...-b8be85b Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCustomer

func CreateCustomer(c *fiber.Ctx) error

CreateCustomer registers a new customer.

func CreateEmployee

func CreateEmployee(c *fiber.Ctx) error

CreateEmployee registers a new shop employee.

func CreateInventory

func CreateInventory(c *fiber.Ctx) error

CreateInventory creates a new inventory for a shop.

func CreateItem

func CreateItem(c *fiber.Ctx) error

CreateItem creates a new item under a given inventory.

func CreateShop

func CreateShop(c *fiber.Ctx) error

CreateShop creates a new shop along with its owner.

func DefaultRoute

func DefaultRoute(c *fiber.Ctx) error

DefaultRoute handles the root endpoint.

func DeleteEmployee

func DeleteEmployee(c *fiber.Ctx) error

DeleteEmployee deletes a shop employee by ID.

func DeleteInventory

func DeleteInventory(c *fiber.Ctx) error

DeleteInventory deletes an inventory by its ID.

func DeleteItem

func DeleteItem(c *fiber.Ctx) error

DeleteItem deletes an item by its ID.

func GetCustomers

func GetCustomers(c *fiber.Ctx) error

GetCustomers retrieves all customers with selected fields.

func GetEmployee

func GetEmployee(c *fiber.Ctx) error

GetEmployee retrieves a single shop employee by ID.

func GetEmployees

func GetEmployees(c *fiber.Ctx) error

GetEmployees retrieves all shop employees.

func GetInventories

func GetInventories(c *fiber.Ctx) error

GetInventories retrieves all inventories with their items.

func GetInventory

func GetInventory(c *fiber.Ctx) error

GetInventory retrieves a single inventory by ID, including its items.

func GetItem

func GetItem(c *fiber.Ctx) error

GetItem retrieves a single item by its ID.

func GetItems

func GetItems(c *fiber.Ctx) error

GetItems retrieves all items.

func GetShops

func GetShops(c *fiber.Ctx) error

GetShops retrieves all shops with their owners.

func LoginCustomer

func LoginCustomer(c *fiber.Ctx) error

LoginCustomer authenticates a customer and issues a JWT token.

func LoginShopOwner

func LoginShopOwner(c *fiber.Ctx) error

LoginShopOwner authenticates a shop owner and returns a JWT token.

func NotFoundRoute

func NotFoundRoute(c *fiber.Ctx) error

NotFoundRoute handles undefined endpoints.

func SetupRoutes

func SetupRoutes(app *fiber.App)

SetupRoutes defines all the API routes.

func UpdateEmployee

func UpdateEmployee(c *fiber.Ctx) error

UpdateEmployee updates an existing shop employee.

func UpdateInventory

func UpdateInventory(c *fiber.Ctx) error

UpdateInventory updates an existing inventory record.

func UpdateItem

func UpdateItem(c *fiber.Ctx) error

UpdateItem updates an existing item.

func UpdateShop

func UpdateShop(c *fiber.Ctx) error

UpdateShop updates existing shop

Types

type CreateShopRequest

type CreateShopRequest struct {
	Name  string           `json:"name"`
	Email string           `json:"email"`
	Owner models.ShopOwner `json:"owner"`
}

CreateShopRequest represents the JSON payload for creating a shop and its owner.

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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