Enhance Notification Management with New Endpoints and Response Structures

- Added new endpoints for retrieving notifications for both admins and users, improving the flexibility of the notification system.
- Implemented query parameters for filtering notifications by status, method, event type, type, and recipient, enhancing usability.
- Introduced new response structures for notifications, including pagination information, to provide better data handling in API responses.
- Updated API documentation with Swagger comments for the new endpoints and response formats, ensuring clarity for API consumers.
- Refactored notification handling logic to support the new features, promoting a more robust notification management system.
This commit is contained in:
n.nakhostin
2025-09-20 17:41:21 +03:30
parent ab6eb3b3ed
commit 19cd346b1c
13 changed files with 1637 additions and 16 deletions
+8 -9
View File
@@ -134,8 +134,10 @@ func RegisterAdminRoutes(e *echo.Echo, userHandler *user.Handler, companyHandler
// Admin Notifications Routes
notificationsGP := adminV1.Group("/notifications")
{
// notificationsGP.Use(userHandler.AuthMiddleware())
notificationsGP.Use(userHandler.AuthMiddleware())
notificationsGP.POST("", notificationHandler.Send)
notificationsGP.GET("", notificationHandler.GetNotifications)
notificationsGP.GET("/my", notificationHandler.AdminNotifications)
}
}
@@ -209,12 +211,9 @@ func RegisterPublicRoutes(e *echo.Echo, customerHandler *customer.Handler, tende
}
// Public Notifications Routes
// notificationsGP := v1.Group("/notifications")
// {
// notificationsGP.Use(customerHandler.AuthMiddleware())
// notificationsGP.GET("", notificationHandler.GetNotifications)
// notificationsGP.GET("/stats", notificationHandler.GetNotificationStats)
// notificationsGP.POST("/mark-read", notificationHandler.MarkAsRead)
// notificationsGP.GET("/:id", notificationHandler.GetNotificationByID)
// }
notificationsGP := v1.Group("/notifications")
{
notificationsGP.Use(customerHandler.AuthMiddleware())
notificationsGP.GET("", notificationHandler.CustomerNotifications)
}
}