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:
@@ -1,5 +1,9 @@
|
||||
package mongo
|
||||
|
||||
import (
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
// Logger defines the interface for logging operations
|
||||
type Logger interface {
|
||||
Info(message string, fields map[string]interface{})
|
||||
@@ -28,19 +32,19 @@ type IDSetter interface {
|
||||
|
||||
// Model provides a common base for MongoDB documents
|
||||
type Model struct {
|
||||
ID string `bson:"_id,omitempty" json:"id,omitempty"`
|
||||
CreatedAt int64 `bson:"created_at" json:"created_at"`
|
||||
UpdatedAt int64 `bson:"updated_at" json:"updated_at"`
|
||||
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
|
||||
CreatedAt int64 `bson:"created_at" json:"created_at"`
|
||||
UpdatedAt int64 `bson:"updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
// GetID returns the document ID
|
||||
func (b *Model) GetID() string {
|
||||
return b.ID
|
||||
return b.ID.Hex()
|
||||
}
|
||||
|
||||
// SetID sets the document ID
|
||||
func (b *Model) SetID(id string) {
|
||||
b.ID = id
|
||||
b.ID, _ = primitive.ObjectIDFromHex(id)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the creation timestamp
|
||||
|
||||
Reference in New Issue
Block a user