Refactor Notification Management and Enhance Customer Features

- Updated the notification handling logic to utilize a new SDK for sending notifications, improving the flexibility and scalability of the notification system.
- Introduced new methods in the notification service for sending notifications to users and customers based on various target audience types, enhancing the notification delivery capabilities.
- Added a new endpoint to assign companies to a customer, improving customer management functionalities.
- Refactored the customer entity and forms to replace 'CompanyIDs' with 'Companies', ensuring consistency across the data model.
- Enhanced API documentation with Swagger comments for the new endpoint and updated notification structures, ensuring clarity for API consumers.
This commit is contained in:
n.nakhostin
2025-09-20 16:54:51 +03:30
parent d2f7c6a1e5
commit 9037cb5917
18 changed files with 607 additions and 1471 deletions
+5 -13
View File
@@ -132,19 +132,11 @@ func RegisterAdminRoutes(e *echo.Echo, userHandler *user.Handler, companyHandler
}
// 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)
// }
notificationsGP := adminV1.Group("/notifications")
{
// notificationsGP.Use(userHandler.AuthMiddleware())
notificationsGP.POST("", notificationHandler.Send)
}
}
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) {