61 lines
1.9 KiB
Go
61 lines
1.9 KiB
Go
package inventory
|
|
|
|
import (
|
|
"BE-MiniERP/modules/inventory/handler"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func RegisterRoutes(r fiber.Router) {
|
|
category := handler.NewCategoryHandler()
|
|
r.Get("/categories", category.GetAll)
|
|
r.Post("/categories", category.Create)
|
|
r.Put("/categories/:id", category.Update)
|
|
r.Delete("/categories/:id", category.Delete)
|
|
|
|
collection := handler.NewCollectionHandler()
|
|
r.Get("/collections", collection.GetAll)
|
|
r.Post("/collections", collection.Create)
|
|
r.Put("/collections/:id", collection.Update)
|
|
r.Delete("/collections/:id", collection.Delete)
|
|
|
|
colour := handler.NewColourHandler()
|
|
r.Get("/colours", colour.GetAll)
|
|
r.Post("/colours", colour.Create)
|
|
r.Put("/colours/:id", colour.Update)
|
|
r.Delete("/colours/:id", colour.Delete)
|
|
|
|
size := handler.NewSizeHandler()
|
|
r.Get("/sizes", size.GetAll)
|
|
r.Post("/sizes", size.Create)
|
|
r.Put("/sizes/:id", size.Update)
|
|
r.Delete("/sizes/:id", size.Delete)
|
|
|
|
product := handler.NewProductHandler()
|
|
r.Get("/products", product.GetAll)
|
|
r.Post("/products", product.Create)
|
|
r.Put("/products/:id", product.Update)
|
|
r.Delete("/products/:id", product.Delete)
|
|
|
|
warehouse := handler.NewWarehouseHandler()
|
|
r.Get("/warehouses", warehouse.GetAll)
|
|
r.Post("/warehouses", warehouse.Create)
|
|
r.Put("/warehouses/:id", warehouse.Update)
|
|
r.Delete("/warehouses/:id", warehouse.Delete)
|
|
|
|
stock := handler.NewStockMovementHandler()
|
|
r.Get("/stock-movements", stock.GetAll)
|
|
r.Post("/stock-movements", stock.Create)
|
|
|
|
component := handler.NewProductComponentHandler()
|
|
r.Get("/product-components", component.GetAll)
|
|
r.Post("/product-components", component.Create)
|
|
r.Delete("/product-components/:id", component.Delete)
|
|
|
|
po := handler.NewProductionOrderHandler()
|
|
r.Get("/production-orders", po.GetAll)
|
|
r.Post("/production-orders", po.Create)
|
|
r.Put("/production-orders/:id", po.Update)
|
|
r.Delete("/production-orders/:id", po.Delete)
|
|
}
|