billing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(opts Options) http.Handler

NewHandler returns the JSON report surface plus trusted create, funding, and credit-policy commands. The caller owns authentication/diagnostics protection and path mounting.

Types

type EconomicDetailReader

type EconomicDetailReader = corebilling.EconomicDetailReader

EconomicDetailReader is the durable scoped economic detail port.

type EconomicHealthReader

type EconomicHealthReader = corebilling.EconomicHealthReader

EconomicHealthReader is the durable bounded economics health port.

type EconomicHealthSink

type EconomicHealthSink func(corebilling.EconomicHealthSnapshot)

EconomicHealthSink receives the bounded snapshot for observability projection. It is an optional, inert port: a nil sink is a no-op and the sink never receives raw content or per-request identities.

type OperatorReports

type OperatorReports struct {
	EconomicDetail  EconomicDetailReader
	Discrepancies   economics.DiscrepancyReader
	Allowances      economics.AllowanceReader
	StatementLines  economics.StatementLineReader
	Adjustments     economics.AdjustmentReader
	Health          EconomicHealthReader
	StatementImport *StatementImportOptions
}

OperatorReports carries the optional 16.2A operator readers. Nil members leave their routes reporting disabled; stock startup leaves the zero value, which enables no new route beyond the pre-existing surface.

type Options

type Options struct {
	Queries  Queries
	Commands corebilling.AccountProvisioner
	Recovery corebilling.ExposureRecovery
	Operator OperatorReports
	// HealthSink optionally projects the bounded economics health snapshot
	// into an observability port (for example Prometheus gauges). A nil sink
	// leaves the protected JSON health route fully functional.
	HealthSink      EconomicHealthSink
	DefaultPageSize int
	MaxPageSize     int
}

Options configures the bounded billing report and trusted-command handler. Operator carries the optional 16.2A operator readers; its zero value leaves every new operator route reporting disabled while the pre-existing surface behaves exactly as before.

type Queries

type Queries = corebilling.ReportingStore

Queries is the read-only billing report port. Implementations must return domain values; database handles and provider payloads never cross this edge.

type StatementImportAuthorizer

type StatementImportAuthorizer func(*http.Request) error

StatementImportAuthorizer authorizes one normalized statement import request before its body is read. Any non-nil error rejects the request with 403 and the importer is never invoked.

type StatementImportOptions

type StatementImportOptions struct {
	Importer     economics.StatementImporter
	Authorize    StatementImportAuthorizer
	MaxBodyBytes int64
}

StatementImportOptions opts a reports mount into the normalized statement import route. Both Importer and Authorize are required; MaxBodyBytes caps the batch body and defaults when non-positive.

Jump to

Keyboard shortcuts

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