Integrate Notification Management into Tender Management System

- Added a new notification domain, including entities, services, handlers, and repositories to manage notifications effectively.
- Implemented CRUD operations for notifications, allowing for creation, retrieval, updating, and deletion of notifications via the API.
- Enhanced API documentation with Swagger comments for new notification endpoints, ensuring clarity for API consumers.
- Updated routes to include notification management, improving administrative capabilities within the web panel.
- Introduced validation for notification requests and responses, ensuring data integrity and proper error handling.
- Updated the go.mod file to include the latest version of the go-redis library, ensuring compatibility with the notification service.
This commit is contained in:
n.nakhostin
2025-09-17 16:01:49 +03:30
parent 6906577f6e
commit a06dc5097e
12 changed files with 2244 additions and 16 deletions
+28 -2
View File
@@ -7,6 +7,7 @@ import (
"tm/internal/customer"
"tm/internal/feedback"
"tm/internal/inquiry"
"tm/internal/notification"
"tm/internal/tender"
"tm/internal/tender_approval"
"tm/internal/user"
@@ -14,7 +15,7 @@ import (
"github.com/labstack/echo/v4"
)
func RegisterAdminRoutes(e *echo.Echo, userHandler *user.Handler, companyHandler *company.Handler, customerHandler *customer.Handler, tenderHandler *tender.TenderHandler, feedbackHandler *feedback.Handler, tenderApprovalHandler *tender_approval.Handler, inquiryHandler *inquiry.Handler, categoryHandler *company_category.Handler, flagHandler *assets.Handler) {
func RegisterAdminRoutes(e *echo.Echo, userHandler *user.Handler, companyHandler *company.Handler, customerHandler *customer.Handler, tenderHandler *tender.TenderHandler, feedbackHandler *feedback.Handler, tenderApprovalHandler *tender_approval.Handler, inquiryHandler *inquiry.Handler, categoryHandler *company_category.Handler, flagHandler *assets.Handler, notificationHandler *notification.NotificationHandler) {
adminV1 := e.Group("/admin/v1")
// Admin Users Routes
@@ -128,9 +129,24 @@ func RegisterAdminRoutes(e *echo.Echo, userHandler *user.Handler, companyHandler
{
flagsGP.GET("/:country_code", flagHandler.AdminGetFlagSVG)
}
// Admin Notifications Routes
// notificationsGP := adminV1.Group("/notifications")
// {
// notificationsGP.Use(userHandler.AuthMiddleware())
// notificationsGP.POST("", notificationHandler.CreateNotification)
// notificationsGP.POST("/bulk", notificationHandler.CreateBulkNotification)
// notificationsGP.GET("", notificationHandler.GetNotifications)
// notificationsGP.GET("/stats", notificationHandler.GetNotificationStats)
// notificationsGP.POST("/mark-read", notificationHandler.MarkAsRead)
// notificationsGP.POST("/process-pending", notificationHandler.ProcessPendingNotifications)
// notificationsGP.GET("/:id", notificationHandler.GetNotificationByID)
// notificationsGP.PUT("/:id", notificationHandler.UpdateNotification)
// notificationsGP.DELETE("/:id", notificationHandler.DeleteNotification)
// }
}
func RegisterPublicRoutes(e *echo.Echo, customerHandler *customer.Handler, tenderHandler *tender.TenderHandler, feedbackHandler *feedback.Handler, tenderApprovalHandler *tender_approval.Handler, companyHandler *company.Handler, inquiryHandler *inquiry.Handler, categoryHandler *company_category.Handler, flagHandler *assets.Handler) {
func RegisterPublicRoutes(e *echo.Echo, customerHandler *customer.Handler, tenderHandler *tender.TenderHandler, feedbackHandler *feedback.Handler, tenderApprovalHandler *tender_approval.Handler, companyHandler *company.Handler, inquiryHandler *inquiry.Handler, categoryHandler *company_category.Handler, flagHandler *assets.Handler, notificationHandler *notification.NotificationHandler) {
v1 := e.Group("/api/v1")
customerGP := v1.Group("/profile")
@@ -198,4 +214,14 @@ func RegisterPublicRoutes(e *echo.Echo, customerHandler *customer.Handler, tende
{
flagsGP.GET("/:country_code", flagHandler.GetFlagSVG)
}
// 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)
// }
}