scan-flow: geolocation scan, location-aware SMS throttle (log sender), finder contact, sms_enabled toggle, branding — 19/19 phase-2 scenarios pass

This commit is contained in:
2026-08-05 18:23:34 +10:00
parent 4666751e92
commit c2fa04afd0
26 changed files with 698 additions and 43 deletions

View File

@@ -0,0 +1,21 @@
package sms
import "strings"
// NormalizeAU normalises a phone number to international AU format without a
// leading '+' or zero:
//
// "+61432374487" -> "61432374487"
// "0432374487" -> "61432374487"
func NormalizeAU(phone string) string {
s := strings.Map(func(r rune) rune {
if r >= '0' && r <= '9' {
return r
}
return -1
}, phone)
if strings.HasPrefix(s, "0") && len(s) >= 10 {
s = "61" + s[1:]
}
return s
}