Add forgot-password SMS reset, client/staff user lists, and regenerate Swagger.

Fold follow-up migrations into init, expose GET /users/clients and /users/staff, and refresh seed data.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-14 16:42:47 +05:00
parent 5e3c46da83
commit 514b9ca5fc
24 changed files with 1477 additions and 473 deletions

View File

@@ -6,6 +6,7 @@ func TestNormalizePhone(t *testing.T) {
tests := []struct {
in, want string
}{
{"+99361531216", "+993 61 53 12 16"},
{"+993 61 92 92 48", "+993 61 92 92 48"},
{"+99361929248", "+993 61 92 92 48"},
{"99361929248", "+993 61 92 92 48"},
@@ -26,4 +27,22 @@ func TestNormalizePhone(t *testing.T) {
if _, err := NormalizePhone("123"); err != ErrInvalidPhone {
t.Errorf("NormalizePhone(123) error = %v, want ErrInvalidPhone", err)
}
validPrefixes := []string{"61", "62", "63", "64", "65", "71", "72"}
for _, prefix := range validPrefixes {
in := prefix + "929248"
if _, err := NormalizePhone(in); err != nil {
t.Errorf("NormalizePhone(%q) unexpected error: %v", in, err)
}
}
invalid := []string{
"60929248", "66929248", "70929248", "73929248", "81929248",
"+99366531216", "+99360929248",
}
for _, in := range invalid {
if _, err := NormalizePhone(in); err != ErrInvalidPhone {
t.Errorf("NormalizePhone(%q) error = %v, want ErrInvalidPhone", in, err)
}
}
}