package validator import "regexp" // Shared helper functions for validators func isValidEmail(email string) bool { emailRegex := regexp.MustCompile(`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`) return emailRegex.MatchString(email) } func isValidPhone(phone string) bool { phoneRegex := regexp.MustCompile(`^\+?[1-9]\d{1,14}$`) return phoneRegex.MatchString(phone) } func isValidRole(role string) bool { validRoles := map[string]bool{ "admin": true, "manager": true, "cashier": true, } return validRoles[role] } func isValidPlanType(planType string) bool { validPlanTypes := map[string]bool{ "basic": true, "premium": true, "enterprise": true, } return validPlanTypes[planType] }