Enhance Customer Module with Validation and Username Handling
- Introduced a new ValidationService for customer operations to ensure valid username formats. - Updated customer service and handler to utilize the new validation service, enhancing input validation during registration and updates. - Modified CreateCustomerForm and UpdateCustomerForm to enforce username validation rules. - Adjusted repository indexing to improve search efficiency by refining the text index for customer data. - Ensured consistent handling of usernames across the customer module, improving overall data integrity and user experience.
This commit is contained in:
@@ -43,7 +43,7 @@ func NewRepository(mongoManager *orm.ConnectionManager, logger logger.Logger) Re
|
||||
// Create indexes using the ORM's index management
|
||||
indexes := []orm.Index{
|
||||
*orm.CreateUniqueIndex("username_idx", bson.D{{Key: "username", Value: 1}}),
|
||||
*orm.CreateTextIndex("search_idx", "full_name", "email", "username", "phone"),
|
||||
*orm.CreateTextIndex("search_idx", "email", "username"),
|
||||
}
|
||||
|
||||
// Create indexes
|
||||
|
||||
Reference in New Issue
Block a user