Implement Company Search and Update API Documentation

- Introduced a new search functionality for companies, allowing advanced filtering capabilities including tags, business criteria, and location.
- Updated the API documentation to reflect changes in the search endpoint, enhancing clarity for API consumers.
- Refactored existing company-related API endpoints for consistency, including renaming and restructuring routes.
- Enhanced response structures to return company entities directly, simplifying the response handling in API endpoints.
- Removed unused query parameters and handlers, streamlining the company management functionality.
This commit is contained in:
n.nakhostin
2025-09-08 11:23:15 +03:30
parent 777bbfd714
commit ee830f8c1b
16 changed files with 589 additions and 5338 deletions
+7 -18
View File
@@ -47,24 +47,13 @@ func RegisterAdminRoutes(e *echo.Echo, userHandler *user.Handler, companyHandler
companiesGP := adminV1.Group("/companies")
{
companiesGP.Use(userHandler.AuthMiddleware())
companiesGP.POST("", companyHandler.CreateCompany)
companiesGP.GET("", companyHandler.ListCompanies)
companiesGP.GET("/:id", companyHandler.GetCompany)
companiesGP.PUT("/:id", companyHandler.UpdateCompany)
companiesGP.DELETE("/:id", companyHandler.DeleteCompany)
companiesGP.GET("/search", companyHandler.SearchCompanies)
companiesGP.PATCH("/:id/status", companyHandler.UpdateCompanyStatus)
companiesGP.PATCH("/:id/verification", companyHandler.UpdateCompanyVerification)
companiesGP.PUT("/:id/tags", companyHandler.UpdateCompanyTags)
companiesGP.POST("/:id/tags/add", companyHandler.AddTags)
companiesGP.POST("/:id/tags/remove", companyHandler.RemoveTags)
companiesGP.POST("/:id/verify", companyHandler.VerifyCompany)
companiesGP.POST("/:id/suspend", companyHandler.SuspendCompany)
companiesGP.POST("/:id/activate", companyHandler.ActivateCompany)
companiesGP.GET("/stats", companyHandler.GetCompanyStats)
companiesGP.GET("/type/:type", companyHandler.GetCompaniesByType)
companiesGP.GET("/status/:status", companyHandler.GetCompaniesByStatus)
companiesGP.GET("/industry/:industry", companyHandler.GetCompaniesByIndustry)
companiesGP.POST("", companyHandler.Create)
companiesGP.GET("", companyHandler.Search)
companiesGP.GET("/:id", companyHandler.Get)
companiesGP.PUT("/:id", companyHandler.Update)
companiesGP.DELETE("/:id", companyHandler.Delete)
companiesGP.PATCH("/:id/status", companyHandler.UpdateStatus)
companiesGP.PATCH("/:id/verification", companyHandler.UpdateVerification)
}
// Admin Customers Routes