mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-06-03 20:13:00 +00:00
18 lines
453 B
Go
18 lines
453 B
Go
package shared
|
|
|
|
import "strings"
|
|
|
|
// NormalizePlanCode canonicalizes plan codes from various sources
|
|
// (Paddle checkout, webhook payloads, database records) into stable
|
|
// internal identifiers used across the billing and tenancy domains.
|
|
func NormalizePlanCode(planCode string) string {
|
|
switch strings.TrimSpace(planCode) {
|
|
case "growth":
|
|
return "pro"
|
|
case "multi-location":
|
|
return "business"
|
|
default:
|
|
return strings.TrimSpace(planCode)
|
|
}
|
|
}
|