Enhance API documentation and restructure routes for improved clarity

- Updated README.md to include comprehensive Swagger documentation details, highlighting new features and endpoint categories.
- Introduced a new router structure to streamline route registration for admin and public endpoints, enhancing maintainability.
- Updated health check endpoint documentation to reflect comprehensive server status information.
- Enhanced customer and company management routes with improved descriptions and examples in Swagger.
- Refactored customer and user handlers to remove obsolete route registrations, aligning with the new router structure.
- Improved response handling in customer and user services to utilize string IDs consistently.
- Updated validation rules and forms for customer management to support multiple company assignments.
- Enhanced logging practices across services to ensure better traceability and error handling.
This commit is contained in:
n.nakhostin
2025-08-11 18:24:34 +03:30
parent 566fa07574
commit 3e4831c2e7
23 changed files with 3605 additions and 2087 deletions
-27
View File
@@ -25,33 +25,6 @@ func NewHandler(service Service, userHandler *user.Handler, logger logger.Logger
}
}
// RegisterRoutes registers company routes
func (h *Handler) RegisterRoutes(e *echo.Echo) {
// Admin routes for web panel
adminV1 := e.Group("/admin/v1/companies")
adminV1.Use(h.userHandler.AuthMiddleware())
adminV1.POST("", h.CreateCompany)
adminV1.GET("", h.ListCompanies)
adminV1.GET("/:id", h.GetCompany)
adminV1.PUT("/:id", h.UpdateCompany)
adminV1.DELETE("/:id", h.DeleteCompany)
adminV1.GET("/search", h.SearchCompanies)
adminV1.PATCH("/:id/status", h.UpdateCompanyStatus)
adminV1.PATCH("/:id/verification", h.UpdateCompanyVerification)
adminV1.PUT("/:id/tags", h.UpdateCompanyTags)
adminV1.POST("/:id/tags/add", h.AddTags)
adminV1.POST("/:id/tags/remove", h.RemoveTags)
adminV1.POST("/:id/verify", h.VerifyCompany)
adminV1.POST("/:id/suspend", h.SuspendCompany)
adminV1.POST("/:id/activate", h.ActivateCompany)
adminV1.GET("/stats", h.GetCompanyStats)
adminV1.GET("/type/:type", h.GetCompaniesByType)
adminV1.GET("/status/:status", h.GetCompaniesByStatus)
adminV1.GET("/industry/:industry", h.GetCompaniesByIndustry)
}
// Web Panel Endpoints
// CreateCompany creates a new company (Web Panel)
// @Summary Create a new company
// @Description Create a new company with comprehensive information including business details, address, tags, and customer assignment. This endpoint is used by the web panel for full company registration.