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:
@@ -2,6 +2,8 @@ package company
|
||||
|
||||
import (
|
||||
"tm/pkg/mongo"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
// CompanyStatus represents company account status
|
||||
@@ -27,7 +29,7 @@ const (
|
||||
|
||||
// Company represents a company in the tender management system
|
||||
type Company struct {
|
||||
mongo.Model
|
||||
mongo.Model `bson:",inline"`
|
||||
Name string `bson:"name" json:"name"`
|
||||
Type CompanyType `bson:"type" json:"type"`
|
||||
Status CompanyStatus `bson:"status" json:"status"`
|
||||
@@ -73,12 +75,12 @@ type Company struct {
|
||||
|
||||
// SetID sets the company ID (implements IDSetter interface)
|
||||
func (c *Company) SetID(id string) {
|
||||
c.ID = id
|
||||
c.ID, _ = primitive.ObjectIDFromHex(id)
|
||||
}
|
||||
|
||||
// GetID returns the company ID (implements IDGetter interface)
|
||||
func (c *Company) GetID() string {
|
||||
return c.ID
|
||||
return c.ID.Hex()
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the created timestamp (implements Timestampable interface)
|
||||
@@ -175,7 +177,7 @@ type CompanyResponse struct {
|
||||
// ToResponse converts Company to CompanyResponse
|
||||
func (c *Company) ToResponse() *CompanyResponse {
|
||||
return &CompanyResponse{
|
||||
ID: c.ID,
|
||||
ID: c.ID.Hex(),
|
||||
Name: c.Name,
|
||||
Type: string(c.Type),
|
||||
Status: string(c.Status),
|
||||
|
||||
Reference in New Issue
Block a user