Skip to content

SaaS Billing (ConnectSoft.Saas.BillingTemplate)

A Layer 3 SaaS microservice template for the Billing bounded context. Aggregate root: Subscription. Topic prefix: billing.subscriptions.v1.

It extends ConnectSoft.BaseTemplate via the base-template/ git submodule + MSBuild layering, inheriting cross-cutting infrastructure (auth, observability, health checks, REST/gRPC hosting). What is documented here is the Billing domain; shared behavior is covered by the Base Template and template layering.

Responsibility

Manages the subscription lifecycle for each tenant: create, upgrade, change edition, cancel; and records invoice/payment read-model events. It is the platform's reaction hub - consuming Tenants, Products Catalog, Entitlements, and Metering events and requesting entitlement syncs.

Single aggregate, by design

Billing owns exactly one aggregate root (ISubscription). Invoice, payment provider, dunning, and tax are explicitly out of scope (docs/out-of-scope.md) - deferred to ACLs or future repos. Invoice/payment are surfaced only as events, not aggregates.

External references (by id only)

  • TenantId -> Tenants context
  • EditionRef / PricingModelId -> Products Catalog context

dotnet new

dotnet new install ConnectSoft.Saas.BillingTemplate.Installer
dotnet new connectsoft-saas-billing -n ConnectSoft.MyBillingService

See also