add user management functionality with OTP verification and consent handling, DI introduced

This commit is contained in:
2025-08-10 10:38:49 +03:00
parent 6a9061a3de
commit 5d80a68b44
30 changed files with 828 additions and 528 deletions

View File

@ -0,0 +1,19 @@
package phoneutil
import (
"errors"
"github.com/nyaruka/phonenumbers"
)
func ParseAndFormatPhoneNumber(phoneNumber string) (string, error) {
parsedNumber, err := phonenumbers.Parse(phoneNumber, "RU")
if err != nil {
return "", err
}
result := phonenumbers.Format(parsedNumber, phonenumbers.E164)
if result == "" {
return "", errors.New("failed to format phone number")
}
return result, nil
}