subscriptions

package
v1.801.86 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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.Guard).

Like invoices (and revenue) it fans out the org directory concurrently and reads each org's subscriptions via the admin S2S seam, tagging every row with its owning org. The MRR is monthly-normalized in the commerce reader so a yearly plan is comparable to a monthly one. Best-effort per org (a failed read contributes no rows, never fabricated ones); optional ?org= scopes to one tenant, ?status= filters, ?limit= caps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(app *zip.App, s *cloud.Service[core.State])

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

func Subscriptions

func Subscriptions(s *cloud.Service[core.State], c *zip.Ctx) error

Subscriptions answers GET /v1/admin/subscriptions.

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

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.

Jump to

Keyboard shortcuts

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