subscriptions

package
v1.801.477 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package subscriptions is the fleet SUBSCRIPTION view (/v1/admin/subscriptions) — every tenant's plan subscription: customer/org, plan, status, monthly-normalized MRR, and the current-period start/renews. SuperAdmin only (core.Admit).

It reads the ONE shared warehouse (commerce.events) — the table the commerce analytics collector lands every subscription-lifecycle event in — over the SAME client (datastore.Query) the o11y/compute lenses use, with ZERO per-org fan-out: one GROUP BY resolves each subscription's LATEST lifecycle state (argMax by timestamp), so the whole fleet is one query, not N per-org commerce reads. Honest by construction: no datastore connected or the collector's table not provisioned yet → the real empty list, never a fabricated tenant. The MRR is the monthly-normalized figure the emitter already computed (cents). Optional ?org= scopes to one tenant, ?status= filters the LATEST status, ?limit= caps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(z *zip.App)

Routes registers the fleet subscription view (SuperAdmin only, cross-tenant).

Types

type SubscriptionRow

type SubscriptionRow struct {
	ID       string `json:"id"`
	Org      string `json:"org"`
	Display  string `json:"display"`
	User     string `json:"user"`
	Plan     string `json:"plan"`
	Status   string `json:"status"`
	MRRCents int64  `json:"mrrCents"`
	Started  string `json:"started"`
	Renews   string `json:"renews"`
}

SubscriptionRow is one row of GET /v1/admin/subscriptions — a tenant's subscription at a glance, tagged with its owning org. MRR is USD cents; timestamps are RFC3339 strings.

type SubscriptionsIn

type SubscriptionsIn struct {
	// Status filters on the subscription's LATEST lifecycle status (active, trialing,
	// canceled, …), matched case-insensitively.
	Status string `json:"status"`
	// Org filters to one tenant, matched exactly.
	Org string `json:"org"`
	// Limit caps the rows returned. total still reports the full match count.
	Limit string `json:"limit"`
}

SubscriptionsIn is the GET /v1/admin/subscriptions filter.

type SubscriptionsOut

type SubscriptionsOut struct {
	Status string            `json:"status"`
	Msg    string            `json:"msg"`
	Data   []SubscriptionRow `json:"data"`
	Total  *int              `json:"total,omitempty"`
}

SubscriptionsOut is the GET /v1/admin/subscriptions envelope. total is the count BEFORE limit truncates.

func Subscriptions

func Subscriptions(ctx context.Context, in *SubscriptionsIn) (*SubscriptionsOut, error)

Subscriptions answers GET /v1/admin/subscriptions.

GET /v1/admin/subscriptions?org=&status=&limit=

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL