Subscription Lifecycle (State Machine)
Trial, active, past-due and cancelled states.
Make it your own.
title "Subscription lifecycle"
state Trial
state Active
state PastDue
state Cancelled final
initial Trial
transition Trial -> Active on "subscribe"
transition Trial -> Cancelled on "expire"
transition Active -> PastDue on "payment_failed"
transition PastDue -> Active on "payment_recovered"
transition PastDue -> Cancelled on "dunning_exhausted"
transition Active -> Cancelled on "cancel"