Billing Run
What It Models
A billing run is a reviewable batch of renewal work for one program and end-date range. It separates selection from execution so staff can inspect the proposed work before placing orders, requesting notices or dropping lapsed periods. Templates and recurring schedules reuse that configuration.
Identity and Attributes
The run copies configuration and stores the planning date, statistics and candidate actions. Each action preserves the term version that staff reviewed. Recurring configuration calculates selection dates from each local occurrence and can request automatic execution.
Relationships
Actions reference memberships and their candidate terms. Commerce owns resulting orders, and Platform owns requested communications. The run keeps references and outcomes for accountability.
Invariants
Uniqueness protects recurring occurrences and action keys. Version and status checks protect run changes, while stale-term checks protect execution. Notice and drop effects commit with their result; order placement crosses a separate transaction boundary and relies on the order key.
How It Is Stored and Shared
Billing owns templates, runs, actions, recurring configuration and execution records. Durable jobs process actions in slices. The Membership schedule dispatcher delivers recurring occurrences. These records declare no custom fields.
Open Design Questions
Commerce placement is a refusing stub, and notice purposes are not connected to sending. Organization recipients remain undecided. An execution job that never starts has no deployed reconciler to return the run to a usable state.