Add Inquiry Management Functionality and Update API Documentation

- Introduced a new inquiry management feature, including CRUD operations for inquiries in both admin and public API endpoints.
- Implemented inquiry entity, service, repository, and handler layers following the clean architecture principles.
- Added new API routes for searching, retrieving, updating, and deleting inquiries, enhancing the overall functionality of the system.
- Updated Swagger documentation to include detailed descriptions and examples for the new inquiry endpoints, ensuring clarity for API consumers.
- Enhanced error handling for duplicate inquiries and validation, improving the robustness of the inquiry management process.
- Updated existing routes to integrate inquiry handling, ensuring a seamless user experience across the application.
This commit is contained in:
n.nakhostin
2025-09-07 14:36:16 +03:30
parent 34064e8b36
commit 857e911d40
11 changed files with 2255 additions and 5 deletions
+12 -3
View File
@@ -44,6 +44,9 @@ package main
// @tag.name Admin-TenderApprovals
// @tag.description Administrative tender approval management operations for web panel including CRUD operations, search, statistics, and comprehensive filtering with pagination
// @tag.name Admin-Inquiries
// @tag.description Administrative inquiry management operations for web panel including CRUD operations, search, statistics, and comprehensive filtering with pagination
// @tag.name Authorization
// @tag.description Customer authentication and authorization operations for mobile application including login, logout, token refresh, and profile access
@@ -59,6 +62,9 @@ package main
// @tag.name TenderApprovals
// @tag.description Public tender approval management operations for mobile application including tender approval listing and detailed tender approval information
// @tag.name Inquiries
// @tag.description Public inquiry management operations for mobile application including inquiry submission and inquiry listing
import (
"context"
"fmt"
@@ -67,6 +73,7 @@ import (
"tm/internal/company"
"tm/internal/customer"
"tm/internal/feedback"
"tm/internal/inquiry"
"tm/internal/tender"
"tm/internal/tender_approval"
"tm/internal/user"
@@ -115,6 +122,7 @@ func main() {
tenderRepository := tender.NewTenderRepository(mongoManager, logger)
feedbackRepo := feedback.NewFeedbackRepository(mongoManager, logger)
tenderApprovalRepository := tender_approval.NewTenderApprovalRepository(mongoManager, logger)
inquiryRepository := inquiry.NewInquiryRepository(mongoManager, logger)
logger.Info("Repositories initialized successfully", map[string]interface{}{
"repositories": []string{"customer", "user", "company", "tender", "feedback", "tender_approval"},
})
@@ -129,6 +137,7 @@ func main() {
tenderService := tender.NewTenderService(tenderRepository, companyService, logger)
feedbackService := feedback.NewFeedbackService(feedbackRepo, tenderService, logger)
tenderApprovalService := tender_approval.NewTenderApprovalService(tenderApprovalRepository, tenderService, logger)
inquiryService := inquiry.NewInquiryService(inquiryRepository, logger)
logger.Info("Services initialized successfully", map[string]interface{}{
"services": []string{"customer", "user", "company", "tender", "feedback", "tender_approval"},
})
@@ -140,7 +149,7 @@ func main() {
tenderHandler := tender.NewTenderHandler(tenderService, logger)
feedbackHandler := feedback.NewFeedbackHandler(feedbackService, userHandler, customerHandler, logger)
tenderApprovalHandler := tender_approval.NewHandler(tenderApprovalService, logger)
inquiryHandler := inquiry.NewHandler(inquiryService, logger)
logger.Info("Handlers initialized successfully", map[string]interface{}{
"handlers": []string{"customer", "user", "company", "tender", "feedback", "tender_approval"},
})
@@ -149,8 +158,8 @@ func main() {
e := bootstrap.InitHTTPServer(conf, logger)
// Register routes
router.RegisterAdminRoutes(e, userHandler, companyHandler, customerHandler, tenderHandler, feedbackHandler, tenderApprovalHandler)
router.RegisterPublicRoutes(e, customerHandler, tenderHandler, feedbackHandler, tenderApprovalHandler, companyHandler)
router.RegisterAdminRoutes(e, userHandler, companyHandler, customerHandler, tenderHandler, feedbackHandler, tenderApprovalHandler, inquiryHandler)
router.RegisterPublicRoutes(e, customerHandler, tenderHandler, feedbackHandler, tenderApprovalHandler, companyHandler, inquiryHandler)
// Start server
serverAddr := fmt.Sprintf("%s:%d", conf.Server.Host, conf.Server.Port)