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
+5 -3
View File
@@ -2,6 +2,8 @@ package user
import (
"tm/pkg/mongo"
"go.mongodb.org/mongo-driver/bson/primitive"
)
// UserRole represents user roles in the system
@@ -25,7 +27,7 @@ const (
// User represents a system user (admin/manager/operator)
type User struct {
mongo.Model
mongo.Model `bson:",inline"`
FullName string `bson:"full_name" json:"full_name"`
Username string `bson:"username" json:"username"`
Email string `bson:"email" json:"email"`
@@ -45,12 +47,12 @@ type User struct {
// SetID sets the user ID (implements IDSetter interface)
func (u *User) SetID(id string) {
u.ID = id
u.ID, _ = primitive.ObjectIDFromHex(id)
}
// GetID returns the user ID (implements IDGetter interface)
func (u *User) GetID() string {
return u.ID
return u.ID.Hex()
}
// SetCreatedAt sets the created timestamp (implements Timestampable interface)