The two business classes of a stored subscription status

Read the model.

This page explains the two status classes that every subscription model shares. Six stored words still charge the buyer. Two stored words are ended.

The bad outcome it rules out

A model treats an ended subscription as live, or a live subscription as safe to discard.

The cast

Word Meaning
status word One stored value of the subscription status column.
live subscription A subscription that can still charge the buyer. Its plan must stay with its booking row.
ended subscription A subscription that no longer charges. A drop can remove its row or its plan.
drop An edit, a delete, or a merge that removes a booking row or its plan.

The walkthrough

Step 1: A live word still charges the buyer

LiveStatuses holds six words. A row with one of these words can still charge the buyer. The booking row must keep the plan, so an edit, a delete, or a merge cannot discard it. This set is a business class, not a copy of a production transition table.

Value This step
active live
incomplete live
past_due live
paused live
trialing live
unpaid live
count six words

Model rule: LiveStatuses

LiveStatuses == {"active", "incomplete", "past_due", "paused", "trialing", "unpaid"}

Step 2: An ended word no longer charges

EndedStatuses holds two words. A row with one of these words no longer charges. A drop can remove that row or its plan. The helper states the classes only. Each caller owns the facts and the safety claim.

Value This step
canceled ended
incomplete_expired ended
count two words

Model rule: EndedStatuses

EndedStatuses == {"canceled", "incomplete_expired"}

The safety claim

The helper does not claim safety by itself. It supplies the status classes that a model joins into its own safety rule.

The model checks two things:

Together, these checks cover every finite run of the model.

What this model does not prove

How to read the model text

Symbol Meaning
== This line defines a rule. It does not assign a value.
x' The value of x after the step.
/\ Both conditions must hold.
\/ One of the conditions must hold.
\A Every supplied value must satisfy the rule.
\E At least one supplied value must satisfy the rule.
\in The value belongs to the set.
=> If the left condition holds, the right condition must hold.

Read the model verification guide for the method and its limits.