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:
n.nakhostin
2025-09-24 12:57:23 +03:30
parent 080c1d18e5
commit 939f940499
6 changed files with 65 additions and 9 deletions
+3 -1
View File
@@ -15,15 +15,17 @@ type Handler struct {
authService authorization.AuthorizationService
userHandler *user.Handler
logger logger.Logger
validator ValidationService
}
// NewHandler creates a new customer handler
func NewHandler(service Service, userHandler *user.Handler, authService authorization.AuthorizationService, logger logger.Logger) *Handler {
func NewHandler(service Service, userHandler *user.Handler, authService authorization.AuthorizationService, logger logger.Logger, validator ValidationService) *Handler {
return &Handler{
service: service,
authService: authService,
userHandler: userHandler,
logger: logger,
validator: validator,
}
}