hub apis
This commit is contained in:
@@ -237,6 +237,28 @@ func RegisterRoutes(app *fiber.App, cfg *config.Config) {
|
||||
adminAuth.Get("/exceptions/:id", controllers.GetExceptionDetails)
|
||||
adminAuth.Put("/exceptions/:id/status", controllers.ResolveException)
|
||||
|
||||
// --------------------
|
||||
// HUB CONSOLE APIS
|
||||
// --------------------
|
||||
hub := api.Group("/hub")
|
||||
hub.Post("/login", controllers.HubStaffLogin(cfg))
|
||||
|
||||
// Authenticated Hub Console routes (role 6)
|
||||
hubAuth := hub.Use(middlewares.HubStaffAuth(cfg))
|
||||
hubAuth.Get("/dashboard", controllers.GetHubDashboardStats)
|
||||
hubAuth.Get("/bookings/unassigned", controllers.GetHubUnassignedBookings)
|
||||
hubAuth.Get("/inbound/today", controllers.GetHubInboundToday)
|
||||
hubAuth.Post("/bookings/:id/inbound", controllers.CreateInboundScan)
|
||||
hubAuth.Get("/batches", controllers.GetHubBatches)
|
||||
hubAuth.Post("/batches", controllers.CreateHubBatch)
|
||||
hubAuth.Patch("/batches/:id/status", controllers.UpdateBatchStatus)
|
||||
hubAuth.Get("/milers", controllers.GetHubMilers)
|
||||
|
||||
// Hub management — enforced Doormile-staff-only inside each handler
|
||||
hubAuth.Post("/staff", controllers.CreateHubStaffAccount)
|
||||
hubAuth.Get("/hubs", controllers.GetHubsInCity)
|
||||
hubAuth.Post("/hubs", controllers.CreateCityHub)
|
||||
|
||||
// Redis active user caching utilities
|
||||
redisUsers := api.Group("/utils/users/redis")
|
||||
redisUsers.Post("/", controllers.CreateUserRedis)
|
||||
|
||||
Reference in New Issue
Block a user