Phase 14, part 1: plans, each team's account, and their limits
The multi-tenant edition's plans (Free and Paid as decided, or a plans file) and each team's billing account, with a 14-day trial of Paid. A team's plan caps what its people and agents may change: modules outside it stay readable, a lapsed team changes nothing, and agents, Market entries, crawls and background jobs keep to it. Without a Stripe key, no billing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ import (
|
||||
"supermarket/internal/ai"
|
||||
"supermarket/internal/appmail"
|
||||
"supermarket/internal/backup"
|
||||
"supermarket/internal/billing"
|
||||
"supermarket/internal/config"
|
||||
"supermarket/internal/content"
|
||||
"supermarket/internal/core"
|
||||
@@ -343,6 +344,13 @@ func run(log *slog.Logger) error {
|
||||
}
|
||||
defer teams.Close()
|
||||
srv.Teams, srv.Platform = teams, database
|
||||
if cfg.StripeKey != "" {
|
||||
plans, err := billing.Load(cfg.PlansFile, cfg.StripePrice, cfg.StripePriceYear, cfg.StripePriceStorage)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
srv.Plans = plans
|
||||
}
|
||||
if alone {
|
||||
srv.RecoverTeams(context.Background())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user