forked from Nixius/authelia
1
0
Fork 0
ATLAS/docker/ss-atlas/internal/pricing/tiers.go

23 lines
604 B
Go

package pricing
// Tier represents a pricing tier for new signups.
type Tier int
const (
TierFree Tier = iota // First 10: $0 for 3 months, auto-cancel
TierYear // Next 40: $20/year, then $100/month after
TierPremium // After 50: $200/month
)
// ForCustomer returns the tier for a new signup given current customer count.
// Count is the number of customers who have completed checkout (0-indexed slot).
func ForCustomer(count int, freeLimit, yearLimit int) Tier {
if count < freeLimit {
return TierFree
}
if count < yearLimit {
return TierYear
}
return TierPremium
}