Add lifecycle_status = 'published' to the public-catalog queries (plans and add-ons listings) and reject checkout before any Stripe call unless the product behind the price clears the shared member gate (published + active + public). The currently-enrolled ladder rung stays renderable even if its product is later drafted or retired, fetched directly so members keep seeing what they are on. Introduce a single evaluateMemberGate definition shared by the catalog paths and the operator readiness panel so the surfaces cannot disagree about what is publishable for members.
29 lines
1.2 KiB
Go
29 lines
1.2 KiB
Go
package maintenance
|
|
|
|
import (
|
|
"git.coopcloud.tech/wiki-cafe/member-console/internal/workflows/common"
|
|
"go.temporal.io/sdk/workflow"
|
|
)
|
|
|
|
// EnsureWebhookPartitionsWorkflow keeps core.webhook_events' monthly RANGE
|
|
// partitions provisioned ahead of need. It runs on a recurring schedule as
|
|
// the backstop to the console's own boot pass: the boot pass covers every
|
|
// deployment on every restart, Temporal-configured or not, but a deployment
|
|
// that runs for longer than the partition lookahead window without
|
|
// restarting needs this schedule to keep extending it (design.md D3,
|
|
// webhook-partition-maintenance spec, "Long-running deployment never
|
|
// exhausts partitions").
|
|
func EnsureWebhookPartitionsWorkflow(ctx workflow.Context) error {
|
|
logger := workflow.GetLogger(ctx)
|
|
ctx = workflow.WithActivityOptions(ctx, common.DefaultActivityOptions())
|
|
|
|
var activities *Activities
|
|
var out EnsureWebhookPartitionsOutput
|
|
if err := workflow.ExecuteActivity(ctx, activities.EnsureWebhookPartitionsActivity).Get(ctx, &out); err != nil {
|
|
logger.Error("EnsureWebhookPartitionsActivity failed", "error", err)
|
|
return err
|
|
}
|
|
logger.Info("EnsureWebhookPartitionsWorkflow completed", "monthsAhead", out.MonthsAhead)
|
|
return nil
|
|
}
|